// -*- c++ -*-
// Generated by gtkmmproc -- DO NOT MODIFY!
#ifndef _LIBGNOMEUIMM_APP_H
#define _LIBGNOMEUIMM_APP_H

#include <glibmm.h>

// -*- C++ -*-
/* $Id: app.hg,v 1.18 2003/08/27 18:03:20 murrayc Exp $ */

/* app.hg, app.h for libgnomeuimm
 * 
 * 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 <gtkmm/window.h>
//#include <bonobomm/widgets/dock.h>
#include <libgnomeuimm/app-helper.h>
#include <libgnomeuimm/types.h>
#include <libgnomeuimm/ui-items-stock.h>


//#include <libgnome/gnome-i18n.h>
#include <libgnomeui/gnome-app.h>
#include <libgnomeui/gnome-app-util.h>
#include <list>

#ifndef DOXYGEN_SHOULD_SKIP_THIS
typedef struct _GnomeApp GnomeApp;
typedef struct _GnomeAppClass GnomeAppClass;
#endif /* DOXYGEN_SHOULD_SKIP_THIS */


namespace Gnome
{

namespace UI
{ class App_Class; } // namespace UI

} // namespace Gnome
namespace Gtk
{
  class MenuBar;
  class Toolbar;
}

namespace Gnome
{

namespace UI
{


class App : public Gtk::Window
{
  public:
#ifndef DOXYGEN_SHOULD_SKIP_THIS
  typedef App CppObjectType;
  typedef App_Class CppClassType;
  typedef GnomeApp BaseObjectType;
  typedef GnomeAppClass BaseClassType;
#endif /* DOXYGEN_SHOULD_SKIP_THIS */

  virtual ~App();

#ifndef DOXYGEN_SHOULD_SKIP_THIS

private:
  friend class App_Class;
  static CppClassType app_class_;

  // noncopyable
  App(const App&);
  App& operator=(const App&);

protected:
  explicit App(const Glib::ConstructParams& construct_params);
  explicit App(GnomeApp* castitem);

#endif /* DOXYGEN_SHOULD_SKIP_THIS */

public:
#ifndef DOXYGEN_SHOULD_SKIP_THIS
  static GType get_type()      G_GNUC_CONST;
  static GType get_base_type() G_GNUC_CONST;
#endif

  ///Provides access to the underlying C GtkObject.
  GnomeApp*       gobj()       { return reinterpret_cast<GnomeApp*>(gobject_); }

  ///Provides access to the underlying C GtkObject.
  const GnomeApp* gobj() const { return reinterpret_cast<GnomeApp*>(gobject_); }


public:
  //C++ methods used to invoke GTK+ virtual functions:

protected:
  //GTK+ Virtual Functions (override these to change behaviour):

  //Default Signal Handlers::


private:

  
public:
  App(const Glib::ustring& name);

  /** Create an application.
   *  appname is used to save preferences.
   * title is for the App window.
   */
  App(const Glib::ustring& appname, const Glib::ustring& 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 Glib::ustring& name,
                     BonoboDockItemBehavior behavior,
                     BonoboDockPlacement placement,
                     int band_num,
                     int band_position,
                     int offset);

  
  Gtk::Widget* add_docked(Gtk::Widget& widget,
                     const Glib::ustring& name,
                     BonoboDockItemBehavior behavior,
                     BonoboDockPlacement placement,
                     int band_num,
                     int band_position,
                     int offset);
  //TODO:
  
  void add_dock_item(BonoboDockItem* item,
                                 BonoboDockPlacement placement,
                                 int band_num,
                                 int band_position,
                                 int offset);

  
  void enable_layout_config(gboolean enable);

  
  BonoboDock* get_dock();

  
  BonoboDockItem* get_dock_item_by_name(const Glib::ustring& name);
    
 
   /// Create menus from UI.
   Items::Array<Items::SubTree>& create_menus(const Items::Array<Items::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().
    */
   Items::Array<Items::Info>& insert_menus(const Glib::ustring& path, const Items::Array<Items::Info>& menuinfo);

  
  void remove_menus(const Glib::ustring& path, int items);

  
  void remove_menu_range(const Glib::ustring& path, int start, int 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.
   Items::Array<Items::Info>& create_toolbar(const Items::Array<Items::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);


private:
  /** add() is not applicable
   * Because App is a compound widget, you would
   * only use the set_content() function.
   */
  void add(Gtk::Widget&);
  
  Items::Array<Items::SubTree> menus_;
  Items::Array<Items::Info> toolbars_;

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


};

} /* namespace UI */
} /* namespace Gnome */

namespace Glib
{
  /** @relates Gnome::UI::App
   * @param object The C instance
   * @param take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref.
   * @result A C++ instance that wraps this C instance.
   */
  Gnome::UI::App* wrap(GnomeApp* object, bool take_copy = false);
}
#endif /* _LIBGNOMEUIMM_APP_H */

