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


#include <glibmm.h>

/* $Id: client.hg,v 1.13 2002/09/16 12:18:30 murrayc Exp $ */


/* client.hg
 * 
 * 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 <glibmm/arrayhandle.h>
#include <gtkmm/dialog.h>
#include <libgnomeui/gnome-client.h>


#ifndef DOXYGEN_SHOULD_SKIP_THIS
typedef struct _GnomeClient GnomeClient;
typedef struct _GnomeClientClass GnomeClientClass;
#endif /* DOXYGEN_SHOULD_SKIP_THIS */


namespace Gnome
{

namespace UI
{ class Client_Class; } // namespace UI

} // namespace Gnome
namespace Gnome
{

namespace UI
{


/** @addtogroup libgnomeuimmEnums Enums and Flags */

/**
 * @ingroup libgnomeuimmEnums
 */
enum SaveStyle
{
  SAVE_GLOBAL,
  SAVE_LOCAL,
  SAVE_BOTH
};

} // namespace UI

} // namespace Gnome


#ifndef DOXYGEN_SHOULD_SKIP_THIS
namespace Glib
{

template <>
class Value<Gnome::UI::SaveStyle> : public Glib::Value_Enum<Gnome::UI::SaveStyle>
{
public:
  static GType value_type() G_GNUC_CONST;
};

} // namespace Glib
#endif /* DOXYGEN_SHOULD_SKIP_THIS */


namespace Gnome
{

namespace UI
{

/**
 * @ingroup libgnomeuimmEnums
 */
enum InteractStyle
{
  INTERACT_NONE,
  INTERACT_ERRORS,
  INTERACT_ANY
};

} // namespace UI

} // namespace Gnome


#ifndef DOXYGEN_SHOULD_SKIP_THIS
namespace Glib
{

template <>
class Value<Gnome::UI::InteractStyle> : public Glib::Value_Enum<Gnome::UI::InteractStyle>
{
public:
  static GType value_type() G_GNUC_CONST;
};

} // namespace Glib
#endif /* DOXYGEN_SHOULD_SKIP_THIS */


namespace Gnome
{

namespace UI
{


class Client : public Gtk::Object
{
  public:
#ifndef DOXYGEN_SHOULD_SKIP_THIS
  typedef Client CppObjectType;
  typedef Client_Class CppClassType;
  typedef GnomeClient BaseObjectType;
  typedef GnomeClientClass BaseClassType;
#endif /* DOXYGEN_SHOULD_SKIP_THIS */

  virtual ~Client();

#ifndef DOXYGEN_SHOULD_SKIP_THIS

private:
  friend class Client_Class;
  static CppClassType client_class_;

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

protected:
  explicit Client(const Glib::ConstructParams& construct_params);
  explicit Client(GnomeClient* 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.
  GnomeClient*       gobj()       { return reinterpret_cast<GnomeClient*>(gobject_); }

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


public:
  //C++ methods used to invoke GTK+ virtual functions:
#ifdef GLIBMM_VFUNCS_ENABLED
#endif //GLIBMM_VFUNCS_ENABLED

protected:
  //GTK+ Virtual Functions (override these to change behaviour):
#ifdef GLIBMM_VFUNCS_ENABLED
#endif //GLIBMM_VFUNCS_ENABLED

  //Default Signal Handlers::
#ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
  virtual bool on_save_yourself(int phase, SaveStyle save_style, bool shutdown, InteractStyle interact_style, bool fast);
  virtual void on_die();
  virtual void on_save_complete();
  virtual void on_shutdown_cancelled();
  virtual void on_connect(bool restarted);
  virtual void on_disconnect();
#endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED


private:

public:

  Client(bool connect_to_session_manager = true);

  
  static Client* master_client();
  
  Glib::ustring get_config_prefix();
  
  Glib::ustring get_global_config_prefix();
  
  void set_global_config_prefix(const Glib::ustring& prefix);
  
  GnomeClientFlags get_flags();
  
  void set_restart_style(GnomeRestartStyle style);
  
  void set_priority(guint priority);

  // We keep the argc, argv versions because they can be more
  // convenient that the vector<string> ones
  
  void set_restart_command(gint argc, char** argv);
  void set_restart_command(const Glib::ArrayHandle<Glib::ustring>& argv);

//   _WRAP_METHOD(void gnome_client_add_static_arg(GnomeClient*, ...),
// 	      void add_static_arg(...));

  
  void set_discard_command(gint argc, char** argv);
  void set_discard_command(const Glib::ArrayHandle<Glib::ustring>& argv);

  
  void set_resign_command(gint argc, char** argv);
  void set_resign_command(const Glib::ArrayHandle<Glib::ustring>& argv);

  
  void set_shutdown_command(gint argc, char** argv);
  void set_shutdown_command(const Glib::ArrayHandle<Glib::ustring>& argv);

  
  void set_current_directory(const Glib::ustring& dir);
  
  void set_environment(const Glib::ustring& name, const Glib::ustring& value);

  
  void set_clone_command(gint argc, char** argv);
  void set_clone_command(const Glib::ArrayHandle<Glib::ustring>& argv);

  
   void set_process_id(pid_t pid);
  
  void set_program(const Glib::ustring& program);
  
  void set_user_id(const Glib::ustring& user_id);

  
  void save_any_dialog(Gtk::Dialog& dialog);
  
  void save_error_dialog(Gtk::Dialog& dialog);
  
  void request_phase_2();
  
  void request_save(SaveStyle save_style, bool shutdown, InteractStyle interact_style, bool fast, bool global);
  
  void flush();

  // Note : there's a naming convention breach here, due to the
  // existence of the connect() signal which isn't emitted after
  // gnome_client_connect() is called
  //
  
  void connect_to_session_manager();
  bool is_connected();
  
  void disconnect();


  void set_id(const Glib::ustring& client_id);
  
  Glib::ustring get_id() const;
  
  Glib::ustring get_previous_id() const;
  
  Glib::ustring get_desktop_id() const;

  //TODO: Use a slot, using gnome_client_request_interaction_interp.
  
  void request_interaction(GnomeDialogType dialog, GnomeInteractFunction func, gpointer client_data);

  
  static void gnome_interaction_key_return(gint key, bool cancel_shutdown);

  
  /**
   * @par Prototype:
   * <tt>bool on_my_%save_yourself(int phase, SaveStyle save_style, bool shutdown, InteractStyle interact_style, bool fast)</tt>
   */

  Glib::SignalProxy5< bool,int,SaveStyle,bool,InteractStyle,bool > signal_save_yourself();

  
  /**
   * @par Prototype:
   * <tt>void on_my_%die()</tt>
   */

  Glib::SignalProxy0< void > signal_die();

  
  /**
   * @par Prototype:
   * <tt>void on_my_%save_complete()</tt>
   */

  Glib::SignalProxy0< void > signal_save_complete();

  
  /**
   * @par Prototype:
   * <tt>void on_my_%shutdown_cancelled()</tt>
   */

  Glib::SignalProxy0< void > signal_shutdown_cancelled();

  
  /**
   * @par Prototype:
   * <tt>void on_my_%connect(bool restarted)</tt>
   */

  Glib::SignalProxy1< void,bool > signal_connect();

  
  /**
   * @par Prototype:
   * <tt>void on_my_%disconnect()</tt>
   */

  Glib::SignalProxy0< void > signal_disconnect();


};

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


namespace Glib
{
  /** A Glib::wrap() method for this object.
   * 
   * @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.
   *
   * @relates Gnome::UI::Client
   */
  Gnome::UI::Client* wrap(GnomeClient* object, bool take_copy = false);
} //namespace Glib


#endif /* _LIBGNOMEUIMM_CLIENT_H */

