client.h

Go to the documentation of this file.
00001 // -*- c++ -*-
00002 // Generated by gtkmmproc -- DO NOT MODIFY!
00003 #ifndef _LIBGNOMEUIMM_CLIENT_H
00004 #define _LIBGNOMEUIMM_CLIENT_H
00005 
00006 
00007 #include <glibmm.h>
00008 
00009 /* $Id: client.hg,v 1.13 2002/09/16 12:18:30 murrayc Exp $ */
00010 
00011 
00012 /* client.hg
00013  * 
00014  * Copyright (C) 1999 The Gtk-- Development Team
00015  *
00016  * This library is free software; you can redistribute it and/or
00017  * modify it under the terms of the GNU Library General Public
00018  * License as published by the Free Software Foundation; either
00019  * version 2 of the License, or (at your option) any later version.
00020  *
00021  * This library is distributed in the hope that it will be useful,
00022  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00023  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00024  * Library General Public License for more details.
00025  *
00026  * You should have received a copy of the GNU Library General Public
00027  * License along with this library; if not, write to the Free
00028  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00029  */
00030 
00031 #include <glibmm/arrayhandle.h>
00032 #include <gtkmm/dialog.h>
00033 #include <libgnomeui/gnome-client.h>
00034 
00035 
00036 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00037 typedef struct _GnomeClient GnomeClient;
00038 typedef struct _GnomeClientClass GnomeClientClass;
00039 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
00040 
00041 
00042 namespace Gnome
00043 {
00044 
00045 namespace UI
00046 { class Client_Class; } // namespace UI
00047 
00048 } // namespace Gnome
00049 namespace Gnome
00050 {
00051 
00052 namespace UI
00053 {
00054 
00055 
00061 enum SaveStyle
00062 {
00063   SAVE_GLOBAL,
00064   SAVE_LOCAL,
00065   SAVE_BOTH
00066 };
00067 
00068 } // namespace UI
00069 
00070 } // namespace Gnome
00071 
00072 
00073 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00074 namespace Glib
00075 {
00076 
00077 template <>
00078 class Value<Gnome::UI::SaveStyle> : public Glib::Value_Enum<Gnome::UI::SaveStyle>
00079 {
00080 public:
00081   static GType value_type() G_GNUC_CONST;
00082 };
00083 
00084 } // namespace Glib
00085 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
00086 
00087 
00088 namespace Gnome
00089 {
00090 
00091 namespace UI
00092 {
00093 
00097 enum InteractStyle
00098 {
00099   INTERACT_NONE,
00100   INTERACT_ERRORS,
00101   INTERACT_ANY
00102 };
00103 
00104 } // namespace UI
00105 
00106 } // namespace Gnome
00107 
00108 
00109 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00110 namespace Glib
00111 {
00112 
00113 template <>
00114 class Value<Gnome::UI::InteractStyle> : public Glib::Value_Enum<Gnome::UI::InteractStyle>
00115 {
00116 public:
00117   static GType value_type() G_GNUC_CONST;
00118 };
00119 
00120 } // namespace Glib
00121 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
00122 
00123 
00124 namespace Gnome
00125 {
00126 
00127 namespace UI
00128 {
00129 
00130 
00131 class Client : public Gtk::Object
00132 {
00133   public:
00134 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00135   typedef Client CppObjectType;
00136   typedef Client_Class CppClassType;
00137   typedef GnomeClient BaseObjectType;
00138   typedef GnomeClientClass BaseClassType;
00139 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
00140 
00141   virtual ~Client();
00142 
00143 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00144 
00145 private:
00146   friend class Client_Class;
00147   static CppClassType client_class_;
00148 
00149   // noncopyable
00150   Client(const Client&);
00151   Client& operator=(const Client&);
00152 
00153 protected:
00154   explicit Client(const Glib::ConstructParams& construct_params);
00155   explicit Client(GnomeClient* castitem);
00156 
00157 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
00158 
00159 public:
00160 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00161   static GType get_type()      G_GNUC_CONST;
00162   static GType get_base_type() G_GNUC_CONST;
00163 #endif
00164 
00166   GnomeClient*       gobj()       { return reinterpret_cast<GnomeClient*>(gobject_); }
00167 
00169   const GnomeClient* gobj() const { return reinterpret_cast<GnomeClient*>(gobject_); }
00170 
00171 
00172 public:
00173   //C++ methods used to invoke GTK+ virtual functions:
00174 #ifdef GLIBMM_VFUNCS_ENABLED
00175 #endif //GLIBMM_VFUNCS_ENABLED
00176 
00177 protected:
00178   //GTK+ Virtual Functions (override these to change behaviour):
00179 #ifdef GLIBMM_VFUNCS_ENABLED
00180 #endif //GLIBMM_VFUNCS_ENABLED
00181 
00182   //Default Signal Handlers::
00183 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
00184   virtual bool on_save_yourself(int phase, SaveStyle save_style, bool shutdown, InteractStyle interact_style, bool fast);
00185   virtual void on_die();
00186   virtual void on_save_complete();
00187   virtual void on_shutdown_cancelled();
00188   virtual void on_connect(bool restarted);
00189   virtual void on_disconnect();
00190 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
00191 
00192 
00193 private:
00194 
00195 public:
00196 
00197   Client(bool connect_to_session_manager = true);
00198 
00199   
00200   static Client* master_client();
00201   
00202   Glib::ustring get_config_prefix();
00203   
00204   Glib::ustring get_global_config_prefix();
00205   
00206   void set_global_config_prefix(const Glib::ustring& prefix);
00207   
00208   GnomeClientFlags get_flags();
00209   
00210   void set_restart_style(GnomeRestartStyle style);
00211   
00212   void set_priority(guint priority);
00213 
00214   // We keep the argc, argv versions because they can be more
00215   // convenient that the vector<string> ones
00216   
00217   void set_restart_command(gint argc, char** argv);
00218   void set_restart_command(const Glib::ArrayHandle<Glib::ustring>& argv);
00219 
00220 //   _WRAP_METHOD(void gnome_client_add_static_arg(GnomeClient*, ...),
00221 //            void add_static_arg(...));
00222 
00223   
00224   void set_discard_command(gint argc, char** argv);
00225   void set_discard_command(const Glib::ArrayHandle<Glib::ustring>& argv);
00226 
00227   
00228   void set_resign_command(gint argc, char** argv);
00229   void set_resign_command(const Glib::ArrayHandle<Glib::ustring>& argv);
00230 
00231   
00232   void set_shutdown_command(gint argc, char** argv);
00233   void set_shutdown_command(const Glib::ArrayHandle<Glib::ustring>& argv);
00234 
00235   
00236   void set_current_directory(const Glib::ustring& dir);
00237   
00238   void set_environment(const Glib::ustring& name, const Glib::ustring& value);
00239 
00240   
00241   void set_clone_command(gint argc, char** argv);
00242   void set_clone_command(const Glib::ArrayHandle<Glib::ustring>& argv);
00243 
00244   
00245    void set_process_id(pid_t pid);
00246   
00247   void set_program(const Glib::ustring& program);
00248   
00249   void set_user_id(const Glib::ustring& user_id);
00250 
00251   
00252   void save_any_dialog(Gtk::Dialog& dialog);
00253   
00254   void save_error_dialog(Gtk::Dialog& dialog);
00255   
00256   void request_phase_2();
00257   
00258   void request_save(SaveStyle save_style, bool shutdown, InteractStyle interact_style, bool fast, bool global);
00259   
00260   void flush();
00261 
00262   // Note : there's a naming convention breach here, due to the
00263   // existence of the connect() signal which isn't emitted after
00264   // gnome_client_connect() is called
00265   //
00266   
00267   void connect_to_session_manager();
00268   bool is_connected();
00269   
00270   void disconnect();
00271 
00272 
00273   void set_id(const Glib::ustring& client_id);
00274   
00275   Glib::ustring get_id() const;
00276   
00277   Glib::ustring get_previous_id() const;
00278   
00279   Glib::ustring get_desktop_id() const;
00280 
00281   //TODO: Use a slot, using gnome_client_request_interaction_interp.
00282   
00283   void request_interaction(GnomeDialogType dialog, GnomeInteractFunction func, gpointer client_data);
00284 
00285   
00286   static void gnome_interaction_key_return(gint key, bool cancel_shutdown);
00287 
00288   
00294   Glib::SignalProxy5< bool,int,SaveStyle,bool,InteractStyle,bool > signal_save_yourself();
00295 
00296   
00302   Glib::SignalProxy0< void > signal_die();
00303 
00304   
00310   Glib::SignalProxy0< void > signal_save_complete();
00311 
00312   
00318   Glib::SignalProxy0< void > signal_shutdown_cancelled();
00319 
00320   
00326   Glib::SignalProxy1< void,bool > signal_connect();
00327 
00328   
00334   Glib::SignalProxy0< void > signal_disconnect();
00335 
00336 
00337 };
00338 
00339 } /* namespace UI */
00340 } /* namespace Gnome */
00341 
00342 
00343 namespace Glib
00344 {
00353   Gnome::UI::Client* wrap(GnomeClient* object, bool take_copy = false);
00354 } //namespace Glib
00355 
00356 
00357 #endif /* _LIBGNOMEUIMM_CLIENT_H */
00358 

Generated on Wed Sep 19 19:41:23 2007 for libgnomeuimm by  doxygen 1.5.3