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 
00175 protected:
00176   //GTK+ Virtual Functions (override these to change behaviour):
00177 
00178   //Default Signal Handlers::
00179   virtual bool on_save_yourself(int phase, SaveStyle save_style, bool shutdown, InteractStyle interact_style, bool fast);
00180   virtual void on_die();
00181   virtual void on_save_complete();
00182   virtual void on_shutdown_cancelled();
00183   virtual void on_connect(bool restarted);
00184   virtual void on_disconnect();
00185 
00186 
00187 private:
00188 
00189 public:
00190 
00191   Client(bool connect_to_session_manager = true);
00192 
00193   
00194   static Client* master_client();
00195   
00196   Glib::ustring get_config_prefix();
00197   
00198   Glib::ustring get_global_config_prefix();
00199   
00200   void set_global_config_prefix(const Glib::ustring& prefix);
00201   
00202   GnomeClientFlags get_flags();
00203   
00204   void set_restart_style(GnomeRestartStyle style);
00205   
00206   void set_priority(guint priority);
00207 
00208   // We keep the argc, argv versions because they can be more
00209   // convenient that the vector<string> ones
00210   
00211   void set_restart_command(gint argc, char** argv);
00212   void set_restart_command(const Glib::ArrayHandle<Glib::ustring>& argv);
00213 
00214 //   _WRAP_METHOD(void gnome_client_add_static_arg(GnomeClient*, ...),
00215 //            void add_static_arg(...));
00216 
00217   
00218   void set_discard_command(gint argc, char** argv);
00219   void set_discard_command(const Glib::ArrayHandle<Glib::ustring>& argv);
00220 
00221   
00222   void set_resign_command(gint argc, char** argv);
00223   void set_resign_command(const Glib::ArrayHandle<Glib::ustring>& argv);
00224 
00225   
00226   void set_shutdown_command(gint argc, char** argv);
00227   void set_shutdown_command(const Glib::ArrayHandle<Glib::ustring>& argv);
00228 
00229   
00230   void set_current_directory(const Glib::ustring& dir);
00231   
00232   void set_environment(const Glib::ustring& name, const Glib::ustring& value);
00233 
00234   
00235   void set_clone_command(gint argc, char** argv);
00236   void set_clone_command(const Glib::ArrayHandle<Glib::ustring>& argv);
00237 
00238   
00239    void set_process_id(pid_t pid);
00240   
00241   void set_program(const Glib::ustring& program);
00242   
00243   void set_user_id(const Glib::ustring& user_id);
00244 
00245   
00246   void save_any_dialog(Gtk::Dialog& dialog);
00247   
00248   void save_error_dialog(Gtk::Dialog& dialog);
00249   
00250   void request_phase_2();
00251   
00252   void request_save(SaveStyle save_style, bool shutdown, InteractStyle interact_style, bool fast, bool global);
00253   
00254   void flush();
00255 
00256   // Note : there's a naming convention breach here, due to the
00257   // existence of the connect() signal which isn't emitted after
00258   // gnome_client_connect() is called
00259   //
00260   
00261   void connect_to_session_manager();
00262   bool is_connected();
00263   
00264   void disconnect();
00265 
00266 
00267   void set_id(const Glib::ustring& client_id);
00268   
00269   Glib::ustring get_id() const;
00270   
00271   Glib::ustring get_previous_id() const;
00272   
00273   Glib::ustring get_desktop_id() const;
00274 
00275   //TODO: Use a slot, using gnome_client_request_interaction_interp.
00276   
00277   void request_interaction(GnomeDialogType dialog, GnomeInteractFunction func, gpointer client_data);
00278 
00279   
00280   static void gnome_interaction_key_return(gint key, bool cancel_shutdown);
00281 
00282   
00283   Glib::SignalProxy5< bool,int,SaveStyle,bool,InteractStyle,bool > signal_save_yourself();
00284 
00285   
00286   Glib::SignalProxy0< void > signal_die();
00287 
00288   
00289   Glib::SignalProxy0< void > signal_save_complete();
00290 
00291   
00292   Glib::SignalProxy0< void > signal_shutdown_cancelled();
00293 
00294   
00295   Glib::SignalProxy1< void,bool > signal_connect();
00296 
00297   
00298   Glib::SignalProxy0< void > signal_disconnect();
00299 
00300 
00301 };
00302 
00303 } /* namespace UI */
00304 } /* namespace Gnome */
00305 
00306 
00307 namespace Glib
00308 {
00314   Gnome::UI::Client* wrap(GnomeClient* object, bool take_copy = false);
00315 } //namespace Glib
00316 
00317 
00318 #endif /* _LIBGNOMEUIMM_CLIENT_H */
00319 

Generated on Fri Mar 17 09:40:40 2006 for libgnomeuimm by  doxygen 1.4.6