Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

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

Generated on Sun Sep 11 19:04:57 2005 for libgnomeuimm by  doxygen 1.4.4