00001
00002
00003 #ifndef _LIBPANELAPPLETMM_APPLET_H
00004 #define _LIBPANELAPPLETMM_APPLET_H
00005
00006
00007 #include <glibmm.h>
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #include <panel-applet.h>
00028 #include <panel-applet-gconf.h>
00029
00030 #include <libpanelappletmm/enums.h>
00031 #include <gtkmm/eventbox.h>
00032
00033 #include <glibmm.h>
00034
00035 #include <gdkmm/color.h>
00036 #include <gdkmm/pixmap.h>
00037
00038 #include <gconfmm/value.h>
00039
00040 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00041 typedef struct _PanelApplet PanelApplet;
00042 typedef struct _PanelAppletClass PanelAppletClass;
00043 #endif
00044
00045
00046 namespace Gnome
00047 {
00048
00049 namespace Panel
00050 { class Applet_Class; }
00051
00052 }
00053 namespace Gnome
00054 {
00055
00056 namespace Panel
00057 {
00058
00059
00060 class Applet : public Gtk::EventBox
00061 {
00062 public:
00063 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00064 typedef Applet CppObjectType;
00065 typedef Applet_Class CppClassType;
00066 typedef PanelApplet BaseObjectType;
00067 typedef PanelAppletClass BaseClassType;
00068 #endif
00069
00070 virtual ~Applet();
00071
00072 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00073
00074 private:
00075 friend class Applet_Class;
00076 static CppClassType applet_class_;
00077
00078
00079 Applet(const Applet&);
00080 Applet& operator=(const Applet&);
00081
00082 protected:
00083 explicit Applet(const Glib::ConstructParams& construct_params);
00084 explicit Applet(PanelApplet* castitem);
00085
00086 #endif
00087
00088 public:
00089 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00090 static GType get_type() G_GNUC_CONST;
00091 static GType get_base_type() G_GNUC_CONST;
00092 #endif
00093
00095 PanelApplet* gobj() { return reinterpret_cast<PanelApplet*>(gobject_); }
00096
00098 const PanelApplet* gobj() const { return reinterpret_cast<PanelApplet*>(gobject_); }
00099
00100
00101 public:
00102
00103 #ifdef GLIBMM_VFUNCS_ENABLED
00104 #endif //GLIBMM_VFUNCS_ENABLED
00105
00106 protected:
00107
00108 #ifdef GLIBMM_VFUNCS_ENABLED
00109 #endif //GLIBMM_VFUNCS_ENABLED
00110
00111
00112 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
00113 virtual void on_change_orientation(AppletOrient orient);
00114 virtual void on_change_size(int size);
00115 virtual void on_change_background(AppletBackgroundType type, const Gdk::Color & color, const Glib::RefPtr<const Gdk::Pixmap>& pixmap);
00116 virtual void on_move_focus_out_of_applet(Gtk::DirectionType direction);
00117 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
00118
00119
00120 private:
00121
00122
00123 public:
00124
00125
00126 Applet();
00127
00128
00134 Glib::SignalProxy1< void,AppletOrient > signal_change_orientation();
00135
00136
00142 Glib::SignalProxy1< void,int > signal_change_size();
00143
00144
00150 Glib::SignalProxy3< void,AppletBackgroundType,const Gdk::Color &,const Glib::RefPtr<const Gdk::Pixmap>& > signal_change_background();
00151
00152
00158 Glib::SignalProxy1< void,Gtk::DirectionType > signal_move_focus_out_of_applet();
00159
00160
00161 AppletOrient get_orientation() const;
00162
00163 int get_size() const;
00164
00165 bool get_locked_down() const;
00166
00167
00168 void request_focus(guint32 timestamp);
00169
00170
00171 AppletBackgroundType get_background(Gdk::Color& color, Glib::RefPtr<Gdk::Pixmap>& pixmap) const;
00172
00173
00174 void set_background_widget(Gtk::Widget& widget);
00175
00176
00177 Glib::ustring get_preferences_key() const;
00178
00179 #ifdef GLIBMM_EXCEPTIONS_ENABLED
00180 void add_preferences(const Glib::ustring& schema_dir);
00181 #else
00182 void add_preferences(const Glib::ustring& schema_dir, std::auto_ptr<Glib::Error>& error);
00183 #endif //GLIBMM_EXCEPTIONS_ENABLED
00184
00185
00186 AppletFlags get_flags() const;
00187
00188 void set_flags(AppletFlags flags);
00189
00190 void set_size_hints(const Glib::ArrayHandle<int>& size_hints, int base_size);
00191
00192
00193 BonoboControl* get_control();
00194
00195 const BonoboControl* get_control() const;
00196
00197 BonoboUIComponent* get_popup_component();
00198
00199 const BonoboUIComponent* get_popup_component() const;
00200
00201 void setup_menu(const Glib::ArrayHandle<Glib::ustring>& xml, const BonoboUIVerb* verb_list, gpointer user_data);
00202
00203 void setup_menu(const Glib::ustring& xml, const BonoboUIVerb* verb_list, gpointer user_data);
00204
00205 void setup_menu(const Glib::ustring& opt_datadir, const Glib::ustring& file, const Glib::ustring& opt_app_name, const BonoboUIVerb* verb_list, gpointer user_data);
00206
00207
00208 Glib::ustring gconf_get_full_key(const Glib::ustring& key) const;
00209
00210 #ifdef GLIBMM_EXCEPTIONS_ENABLED
00211 void gconf_set(const Glib::ustring& key, bool the_bool);
00212 #else
00213 void gconf_set(const Glib::ustring& key, bool the_bool, std::auto_ptr<Glib::Error>& error);
00214 #endif //GLIBMM_EXCEPTIONS_ENABLED
00215
00216
00217 #ifdef GLIBMM_EXCEPTIONS_ENABLED
00218 void gconf_set(const Glib::ustring& key, int the_int);
00219 #else
00220 void gconf_set(const Glib::ustring& key, int the_int, std::auto_ptr<Glib::Error>& error);
00221 #endif //GLIBMM_EXCEPTIONS_ENABLED
00222
00223
00224 #ifdef GLIBMM_EXCEPTIONS_ENABLED
00225 void gconf_set(const Glib::ustring& key, const Glib::ustring& the_string);
00226 #else
00227 void gconf_set(const Glib::ustring& key, const Glib::ustring& the_string, std::auto_ptr<Glib::Error>& error);
00228 #endif //GLIBMM_EXCEPTIONS_ENABLED
00229
00230
00231 #ifdef GLIBMM_EXCEPTIONS_ENABLED
00232 void gconf_set(const Glib::ustring& key, double the_float);
00233 #else
00234 void gconf_set(const Glib::ustring& key, double the_float, std::auto_ptr<Glib::Error>& error);
00235 #endif //GLIBMM_EXCEPTIONS_ENABLED
00236
00237
00238 #ifdef GLIBMM_EXCEPTIONS_ENABLED
00239 void gconf_set(const Glib::ustring& key, const Gnome::Conf::Value& value);
00240 #else
00241 void gconf_set(const Glib::ustring& key, const Gnome::Conf::Value& value, std::auto_ptr<Glib::Error>& error);
00242 #endif //GLIBMM_EXCEPTIONS_ENABLED
00243
00244
00245 #ifdef GLIBMM_EXCEPTIONS_ENABLED
00246 bool gconf_get_bool(const Glib::ustring& key) const;
00247 #else
00248 bool gconf_get_bool(const Glib::ustring& key, std::auto_ptr<Glib::Error>& error) const;
00249 #endif //GLIBMM_EXCEPTIONS_ENABLED
00250
00251
00252 #ifdef GLIBMM_EXCEPTIONS_ENABLED
00253 int gconf_get_int(const Glib::ustring& key) const;
00254 #else
00255 int gconf_get_int(const Glib::ustring& key, std::auto_ptr<Glib::Error>& error) const;
00256 #endif //GLIBMM_EXCEPTIONS_ENABLED
00257
00258
00259 #ifdef GLIBMM_EXCEPTIONS_ENABLED
00260 Glib::ustring gconf_get_string(const Glib::ustring& key) const;
00261 #else
00262 Glib::ustring gconf_get_string(const Glib::ustring& key, std::auto_ptr<Glib::Error>& error) const;
00263 #endif //GLIBMM_EXCEPTIONS_ENABLED
00264
00265
00266 #ifdef GLIBMM_EXCEPTIONS_ENABLED
00267 double gconf_get_float(const Glib::ustring& key) const;
00268 #else
00269 double gconf_get_float(const Glib::ustring& key, std::auto_ptr<Glib::Error>& error) const;
00270 #endif //GLIBMM_EXCEPTIONS_ENABLED
00271
00272
00273 #ifdef GLIBMM_EXCEPTIONS_ENABLED
00274 Gnome::Conf::Value gconf_get_value(const Glib::ustring& key) const;
00275 #else
00276 Gnome::Conf::Value gconf_get_value(const Glib::ustring& key, std::auto_ptr<Glib::Error>& error) const;
00277 #endif //GLIBMM_EXCEPTIONS_ENABLED
00278
00279
00280
00281
00282 void gconf_set_list(const Glib::ustring& key, const Gnome::Conf::SListHandle_ValueBool& list);
00283 void gconf_set_list(const Glib::ustring& key, const Gnome::Conf::SListHandle_ValueInt& list);
00284 void gconf_set_list(const Glib::ustring& key, const Gnome::Conf::SListHandle_ValueString& list);
00285 void gconf_set_list(const Glib::ustring& key, const Gnome::Conf::SListHandle_ValueFloat& list);
00286
00287 Gnome::Conf::SListHandle_ValueBool gconf_get_bool_list(const Glib::ustring& key) const;
00288 Gnome::Conf::SListHandle_ValueInt gconf_get_int_list(const Glib::ustring& key) const;
00289 Gnome::Conf::SListHandle_ValueString gconf_get_string_list(const Glib::ustring& key) const;
00290 Gnome::Conf::SListHandle_ValueFloat gconf_get_float_list(const Glib::ustring& key) const;
00291
00292 #ifdef GLIBMM_PROPERTIES_ENABLED
00293
00299 Glib::PropertyProxy<Glib::ustring> property_name() ;
00300 #endif //#GLIBMM_PROPERTIES_ENABLED
00301
00302 #ifdef GLIBMM_PROPERTIES_ENABLED
00303
00309 Glib::PropertyProxy_ReadOnly<Glib::ustring> property_name() const;
00310 #endif //#GLIBMM_PROPERTIES_ENABLED
00311
00312 #ifdef GLIBMM_PROPERTIES_ENABLED
00313
00319 Glib::PropertyProxy<int> property_width_request() ;
00320 #endif //#GLIBMM_PROPERTIES_ENABLED
00321
00322 #ifdef GLIBMM_PROPERTIES_ENABLED
00323
00329 Glib::PropertyProxy_ReadOnly<int> property_width_request() const;
00330 #endif //#GLIBMM_PROPERTIES_ENABLED
00331
00332 #ifdef GLIBMM_PROPERTIES_ENABLED
00333
00339 Glib::PropertyProxy<int> property_height_request() ;
00340 #endif //#GLIBMM_PROPERTIES_ENABLED
00341
00342 #ifdef GLIBMM_PROPERTIES_ENABLED
00343
00349 Glib::PropertyProxy_ReadOnly<int> property_height_request() const;
00350 #endif //#GLIBMM_PROPERTIES_ENABLED
00351
00352 #ifdef GLIBMM_PROPERTIES_ENABLED
00353
00359 Glib::PropertyProxy<bool> property_visible() ;
00360 #endif //#GLIBMM_PROPERTIES_ENABLED
00361
00362 #ifdef GLIBMM_PROPERTIES_ENABLED
00363
00369 Glib::PropertyProxy_ReadOnly<bool> property_visible() const;
00370 #endif //#GLIBMM_PROPERTIES_ENABLED
00371
00372 #ifdef GLIBMM_PROPERTIES_ENABLED
00373
00379 Glib::PropertyProxy<bool> property_sensitive() ;
00380 #endif //#GLIBMM_PROPERTIES_ENABLED
00381
00382 #ifdef GLIBMM_PROPERTIES_ENABLED
00383
00389 Glib::PropertyProxy_ReadOnly<bool> property_sensitive() const;
00390 #endif //#GLIBMM_PROPERTIES_ENABLED
00391
00392 #ifdef GLIBMM_PROPERTIES_ENABLED
00393
00399 Glib::PropertyProxy<bool> property_app_paintable() ;
00400 #endif //#GLIBMM_PROPERTIES_ENABLED
00401
00402 #ifdef GLIBMM_PROPERTIES_ENABLED
00403
00409 Glib::PropertyProxy_ReadOnly<bool> property_app_paintable() const;
00410 #endif //#GLIBMM_PROPERTIES_ENABLED
00411
00412 #ifdef GLIBMM_PROPERTIES_ENABLED
00413
00419 Glib::PropertyProxy<bool> property_can_focus() ;
00420 #endif //#GLIBMM_PROPERTIES_ENABLED
00421
00422 #ifdef GLIBMM_PROPERTIES_ENABLED
00423
00429 Glib::PropertyProxy_ReadOnly<bool> property_can_focus() const;
00430 #endif //#GLIBMM_PROPERTIES_ENABLED
00431
00432 #ifdef GLIBMM_PROPERTIES_ENABLED
00433
00439 Glib::PropertyProxy<bool> property_has_focus() ;
00440 #endif //#GLIBMM_PROPERTIES_ENABLED
00441
00442 #ifdef GLIBMM_PROPERTIES_ENABLED
00443
00449 Glib::PropertyProxy_ReadOnly<bool> property_has_focus() const;
00450 #endif //#GLIBMM_PROPERTIES_ENABLED
00451
00452 #ifdef GLIBMM_PROPERTIES_ENABLED
00453
00459 Glib::PropertyProxy<bool> property_is_focus() ;
00460 #endif //#GLIBMM_PROPERTIES_ENABLED
00461
00462 #ifdef GLIBMM_PROPERTIES_ENABLED
00463
00469 Glib::PropertyProxy_ReadOnly<bool> property_is_focus() const;
00470 #endif //#GLIBMM_PROPERTIES_ENABLED
00471
00472 #ifdef GLIBMM_PROPERTIES_ENABLED
00473
00479 Glib::PropertyProxy<bool> property_can_default() ;
00480 #endif //#GLIBMM_PROPERTIES_ENABLED
00481
00482 #ifdef GLIBMM_PROPERTIES_ENABLED
00483
00489 Glib::PropertyProxy_ReadOnly<bool> property_can_default() const;
00490 #endif //#GLIBMM_PROPERTIES_ENABLED
00491
00492 #ifdef GLIBMM_PROPERTIES_ENABLED
00493
00499 Glib::PropertyProxy<bool> property_has_default() ;
00500 #endif //#GLIBMM_PROPERTIES_ENABLED
00501
00502 #ifdef GLIBMM_PROPERTIES_ENABLED
00503
00509 Glib::PropertyProxy_ReadOnly<bool> property_has_default() const;
00510 #endif //#GLIBMM_PROPERTIES_ENABLED
00511
00512 #ifdef GLIBMM_PROPERTIES_ENABLED
00513
00519 Glib::PropertyProxy<bool> property_receives_default() ;
00520 #endif //#GLIBMM_PROPERTIES_ENABLED
00521
00522 #ifdef GLIBMM_PROPERTIES_ENABLED
00523
00529 Glib::PropertyProxy_ReadOnly<bool> property_receives_default() const;
00530 #endif //#GLIBMM_PROPERTIES_ENABLED
00531
00532 #ifdef GLIBMM_PROPERTIES_ENABLED
00533
00539 Glib::PropertyProxy_ReadOnly<bool> property_composite_child() const;
00540 #endif //#GLIBMM_PROPERTIES_ENABLED
00541
00542
00543 #ifdef GLIBMM_PROPERTIES_ENABLED
00544
00550 Glib::PropertyProxy<bool> property_no_show_all() ;
00551 #endif //#GLIBMM_PROPERTIES_ENABLED
00552
00553 #ifdef GLIBMM_PROPERTIES_ENABLED
00554
00560 Glib::PropertyProxy_ReadOnly<bool> property_no_show_all() const;
00561 #endif //#GLIBMM_PROPERTIES_ENABLED
00562
00563 #ifdef GLIBMM_PROPERTIES_ENABLED
00564
00570 Glib::PropertyProxy<int> property_border_width() ;
00571 #endif //#GLIBMM_PROPERTIES_ENABLED
00572
00573 #ifdef GLIBMM_PROPERTIES_ENABLED
00574
00580 Glib::PropertyProxy_ReadOnly<int> property_border_width() const;
00581 #endif //#GLIBMM_PROPERTIES_ENABLED
00582
00583 #ifdef GLIBMM_PROPERTIES_ENABLED
00584
00590 Glib::PropertyProxy<bool> property_visible_window() ;
00591 #endif //#GLIBMM_PROPERTIES_ENABLED
00592
00593 #ifdef GLIBMM_PROPERTIES_ENABLED
00594
00600 Glib::PropertyProxy_ReadOnly<bool> property_visible_window() const;
00601 #endif //#GLIBMM_PROPERTIES_ENABLED
00602
00603 #ifdef GLIBMM_PROPERTIES_ENABLED
00604
00610 Glib::PropertyProxy<bool> property_above_child() ;
00611 #endif //#GLIBMM_PROPERTIES_ENABLED
00612
00613 #ifdef GLIBMM_PROPERTIES_ENABLED
00614
00620 Glib::PropertyProxy_ReadOnly<bool> property_above_child() const;
00621 #endif //#GLIBMM_PROPERTIES_ENABLED
00622
00623 #ifdef GLIBMM_PROPERTIES_ENABLED
00624
00630 Glib::PropertyProxy<Gtk::Style> property_style() ;
00631 #endif //#GLIBMM_PROPERTIES_ENABLED
00632
00633 #ifdef GLIBMM_PROPERTIES_ENABLED
00634
00640 Glib::PropertyProxy_ReadOnly<Gtk::Style> property_style() const;
00641 #endif //#GLIBMM_PROPERTIES_ENABLED
00642
00643 #ifdef GLIBMM_PROPERTIES_ENABLED
00644
00650 Glib::PropertyProxy<Glib::Object> property_parent() ;
00651 #endif //#GLIBMM_PROPERTIES_ENABLED
00652
00653 #ifdef GLIBMM_PROPERTIES_ENABLED
00654
00660 Glib::PropertyProxy_ReadOnly<Glib::Object> property_parent() const;
00661 #endif //#GLIBMM_PROPERTIES_ENABLED
00662
00663 #ifdef GLIBMM_PROPERTIES_ENABLED
00664
00670 Glib::PropertyProxy_WriteOnly<Glib::Object> property_child() ;
00671 #endif //#GLIBMM_PROPERTIES_ENABLED
00672
00673
00674 };
00675
00676 }
00677 }
00678
00679
00680 namespace Glib
00681 {
00690 Gnome::Panel::Applet* wrap(PanelApplet* object, bool take_copy = false);
00691 }
00692
00693
00694 #endif
00695