// -*- c++ -*-
//  Generated by gtkmmproc from ./../app.gen_h -- DO NOT MODIFY!
#ifndef _GNOMEMM_APP_H
#define _GNOMEMM_APP_H

// -*- C++ -*-
/* $Id: app.gen_h,v 1.80 2001/07/20 22:09:29 murrayc Exp $ */

/***************************************************************
WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
****************************************************************
 This file has been subject to rapid changes.  Don't assume
 things will still work.
***************************************************************/

/* app.gen_h, app.h for gnome--
 *
 * Copyright (C) 2000 The Gtk-- Development Team
 * Copyright (C) 1998 EMC Capital Management Inc.
 * Developed by Havoc Pennington <hp@pobox.com>
 *
 * Copyright (C) 1999 The Gtk-- Development Team
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Library General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Library General Public License for more details.
 *
 * You should have received a copy of the GNU Library General Public
 * License along with this library; if not, write to the Free
 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */

#include <gnome--/dock.h>
#include <gnome--/dialog.h>
#include <gnome--/stock.h>
#include <libgnome/gnome-i18n.h>
#include <libgnomeui/gnome-app.h>
#include <libgnomeui/gnome-app-util.h>
#include <gnome--/app-helper.h>
#include <gnome--/types.h>
#include <list>

namespace Gtk {
  class MenuBar;
  class Toolbar;
}

namespace Gnome {
class App;
class App_Class;
}
namespace Gtk { Gnome::App *wrap (GnomeApp *o); }
namespace Gnome
{
class DockItem;
class Dock;
class App;

namespace App_Helpers {

class Progress
{
public:
  typedef SigC::Slot0<void> Cancel;
  typedef SigC::Slot0<gdouble> Update;

  void set(gdouble percent);
  void done();

  Progress(Gnome::App&, const Gtk::string &description, Cancel cancel=0);
  Progress(Gnome::App&, const Gtk::string &description, guint32 interval,
           Update percent, Cancel cancel=0);

protected:
  GnomeAppProgressKey key_;
};

} // namespace App_Helpers

using std::list; //TODO remove this oneday.

class App : public Gtk::Window
{

public:
  typedef App          CppObjectType;
  typedef App_Class    CppClassType;
  typedef GnomeApp           BaseObjectType;
  typedef GnomeAppClass      BaseClassType;

private:
  friend class App_Class;
  static CppClassType app_class;

  App(const App&);
  App& operator=(const App&); // not implemented

protected:
  void   initialize_class();
  explicit App(GnomeApp *castitem);

public:
  static GtkType get_type();
  GnomeApp* gtkobj()             { return (GnomeApp*)(gtkobject); }
  const GnomeApp* gtkobj() const { return (GnomeApp*)(gtkobject); }
  static bool isA(Gtk::Object *checkcast);

  // Hook for proxies
  static const char* const signal_names[];

  virtual ~App();

private:

public:



  App(const Gtk::string &name);

  //: Create an application.
  //- appname is used to save preferences.
  //- title is for the App window.
  App(const Gtk::string &appname,const Gtk::string &title);

/*** From gnome-app.h ***/
  //: Set the menubar on the top.


  void set_menus(Gtk::MenuBar& menubar);

  //: Set the toolbar on the bottom.


  void set_toolbar(Gtk::Toolbar& toolbar);



  void set_statusbar(Gtk::Widget& statusbar);

  //: Sets the status bar with container.
  //- uses the given container widget rather than creating a new one.



  void set_statusbar_custom(Gtk::Container& container,Gtk::Widget& statusbar);

  //: Set the contents in the middle.


  void set_contents(Gtk::Widget& contents);

  void add_toolbar(Gtk::Toolbar& toolbar,const Gtk::string& name,GnomeDockItemBehavior behavior,GnomeDockPlacement placement,gint band_num,gint band_position,gint offset);

  void add_docked(Gtk::Widget& widget,const Gtk::string& name,GnomeDockItemBehavior behavior,GnomeDockPlacement placement,gint band_num,gint band_position,gint offset);

  void add_dock_item(DockItem& item,GnomeDockPlacement placement,gint band_num,gint band_position,gint offset);



  void enable_layout_config(gboolean enable);



  Gnome::Dock* get_dock();




  Gnome::DockItem* get_dock_item_by_name(const Gtk::string& name);


   //: Create menus from UI.
   UI::Array<UI::SubTree>& create_menus(const UI::Array<UI::SubTree> &info);

   //: Insert menu items at the specified path (e.g. "File/Open" or "File/Open Recent/").
   //- This allocates some memory that will only be release when the app is destroyed,
   //- even if you call remove_menus() or remove_menu_range().
   UI::Array<UI::Info>& insert_menus(const Gtk::string &path, const UI::Array<UI::Info> &menuinfo);

   // void gnome_app_insert_menus_with_data (GnomeApp *app, const gchar *path, GnomeUIInfo *menuinfo, gpointer data);




  void remove_menus(const Gtk::string& path,gint items);



  void remove_menu_range(const Gtk::string& path,gint start,gint items);

   //: Adds hints to status bar.
   //- must be called if create_menus is used after status bar is
   //- established.
   void install_menu_hints();

   //: Create toolbar from UI.
   UI::Array<UI::Info>& create_toolbar(const UI::Array<UI::Info> &info);


// These are probably not necessary.
// Please tell us if you find any example of their use.
//   static void install_appbar_menu_hints    (const AppBar &app,
//                                             UIInfoTree &menuinfo);
//   static void install_statusbar_menu_hints (const Gtk::Statusbar &bar,
//                                             UIInfoTree &menuinfo);


/*** From gnome-app-util.h ***/

  //: Flash a status message on the status bar
  //-   If there isn't a status bar do nothing.  Intended for
  //-   trivial messages.


  void flash(const Gtk::string& msg);


  // These functions create popup messages of various types attached
  // to this application.  The result is a managed widget which may
  // be 0.  (must check)  You do not need to delete them; they will delete
  // when closed.

  //: Popup a status message (ok style).


  Gnome::Dialog* message(const Gtk::string& msg);



  Gnome::Dialog* error(const Gtk::string& msg);



  Gnome::Dialog* warning(const Gtk::string& msg);

  //: Create a question dialog.
  Gnome::Dialog* question(const Gtk::string& message, ReplyCallback cb = 0);
  //: Create a question dialog (modal).
  Gnome::Dialog* question_modal(const Gtk::string& msg, ReplyCallback cb = 0);

  //: Create a okay/cancel dialog.
  Gnome::Dialog* ok_cancel(const Gtk::string& msg, ReplyCallback cb = 0);
  //: Create a okay/cancel dialog (modal).
  Gnome::Dialog* ok_cancel_modal(const Gtk::string& msg, ReplyCallback cb = 0);

  //: Create a request string dialog.
  Gnome::Dialog* request_string(const Gtk::string &prompt,StringCallback cb = 0);
  //: Create a request password dialog.
  Gnome::Dialog* request_password(const Gtk::string &prompt,StringCallback cb = 0);

  typedef App_Helpers::Progress Progress;
  //: Create a progress indicator.
  Progress progress(const Gtk::string &description, Progress::Cancel cancel=0);

  //: Create a progress indicator at intervals.
  Progress progress(const Gtk::string &description, guint32 interval,
                    Progress::Update percent, Progress::Cancel cancel=0);

private:
  //: add() is not applicable
  //- Because a App is a compound widget, you would
  //- only use the set_content() function.
  void add(Gtk::Widget&);

  UI::Array<UI::SubTree> menus_;
  UI::Array<UI::Info> toolbars_;

  //To store dynamically-added UI::Info,
  //because GNOME does not make its own copy of some data.
  // e.g. see insert_menus().
  list< UI::Array<UI::Info> > listUIArray_;

public:

protected:
  // impl functions

};



}

#endif
