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


#include <glibmm.h>

/* $Id: main.hg,v 1.10 2006/04/03 06:17:28 murrayc Exp $ */
// -*- C++ -*- // this is for the .hg, I realize gensig puts one in

/* main.h
 * 
 * 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 Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 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
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free
 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */

#include <libgnomemm/moduleinfo.h>
#include <libgnomemm/program.h>
#include <gtkmm/main.h>
//#include <libgnome/libgnome.h>


namespace Gnome
{

class Main : public Gtk::Main
{
public:

  /** Initialises the current GNOME libraries for use by the application.
   * Every GNOME application will need to use this early in its lifetime to initialize the various GNOME 
   * libraries in a consistent fashion. This function is very flexible in allowing the user to specify which 
   * modules should be initialised and any special parameter values that should be passed to these modules 
   * (along with processing commandline options).
   * It loads the specified module_info, and pulls in all 
   * the dependencies. Programs that are not running in setuid or setgid mode will also load modules specified 
   * in the --load-modules and also in the GNOME_MODULES environment variable. 
   *
   * @param app_id Application ID string. 
   * @param app_version Application Version String. This could be defined in your auto-generated config.h file.
   * @param The module to init with this program. This should come from a call such as Gnome::UI::module_info_get().
   * @param argc The number of command line arguments contanied in @a argv.
   * @param argv A string array of command line arguments.
   */
  Main(const Glib::ustring& app_id, const Glib::ustring& app_version,
       const ModuleInfo& module_info,
       int argc, char** argv);

  /** Initialises the current GNOME libraries for use by the application, and takes a  table of popt options (popt is the command line argument parsing library).
   *
   * Every GNOME application will need to use this early in its lifetime to initialize the various GNOME 
   * libraries in a consistent fashion. This function is very flexible in allowing the user to specify which 
   * modules should be initialised and any special parameter values that should be passed to these modules 
   * (along with processing commandline options).
   * It loads the specified module_info, and pulls in all 
   * the dependencies. Programs that are not running in setuid or setgid mode will also load modules specified 
   * in the --load-modules and also in the GNOME_MODULES environment variable. 
   *
   * @param app_id Application ID string. 
   * @param app_version Application Version String. This could be defined in your auto-generated config.h file.
   * @param The module to init with this program. This should come from a call such as Gnome::UI::module_info_get().
   * @param argc The number of command line arguments contanied in @a argv.
   * @param argv A string array of command line arguments.
   * @param options poptOption table with options to parse.
   * @param popt flags.
   * @param return_ctx The popt context is returned here.
   *
   * @deprecated Use the constructor that takes a Glib::OptionContext instead.
   */
  Main(const Glib::ustring& app_id, const Glib::ustring& app_version,
       const ModuleInfo& module_info,
       int argc, char **argv,
       const struct poptOption *options, int flags, poptContext* return_ctx);
 
  /** Initialises the current GNOME libraries for use by the application, and takes an OptionContext for command line arguments.
   *
   * Every GNOME application will need to use this early in its lifetime to initialize the various GNOME 
   * libraries in a consistent fashion. This function is very flexible in allowing the user to specify which 
   * modules should be initialised and any special parameter values that should be passed to these modules 
   * (along with processing commandline options).
   * It loads the specified module_info, and pulls in all 
   * the dependencies. Programs that are not running in setuid or setgid mode will also load modules specified 
   * in the --load-modules and also in the GNOME_MODULES environment variable. 
   *
   * @param app_id Application ID string. 
   * @param app_version Application Version String. This could be defined in your auto-generated config.h file.
   * @param The module to init with this program. This should come from a call such as Gnome::UI::module_info_get().
   * @param argc The number of command line arguments contanied in @a argv.
   * @param argv A string array of command line arguments.
   * @param options Context with options to parse.
   */
  Main(const Glib::ustring& app_id, const Glib::ustring& app_version,
       const ModuleInfo& module_info,
       int argc, char **argv,
       Glib::OptionContext& options);
 
  ~Main();
  
protected:
  Main();
  void set_ids(const Glib::ustring& app_id,const Glib::ustring& app_version);

  static char* app_id_;
  static char* app_version_;

  Glib::RefPtr<Program> m_refProgram;
};

} /* namespace Gnome */


#endif /* _LIBGNOMEMM_MAIN_H */

