GFC Logo GFC Title Logo
Reference Manual
Main Page  |  Namespace List  |  Alphabetical List  |  Class List  |  File List

action.hh

Go to the documentation of this file.
00001 /* GFC-UI: GTK+ Foundation Classes (User Interface Library) 00002 * Copyright (C) 2004 The GFC Development Team. 00003 * 00004 * This program is free software; you can redistribute it and/or modify 00005 * it under the terms of the GNU General Public License as published by 00006 * the Free Software Foundation; either version 2 of the License, or 00007 * (at your option) any later version. 00008 * 00009 * This program is distributed in the hope that it will be useful, 00010 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 * GNU Library General Public License for more details. 00013 * 00014 * You should have received a copy of the GNU Library General Public License 00015 * along with this program; if not, write to the Free Software 00016 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 00017 */ 00018 00024 00025 #ifndef GFC_GTK_ACTION_HH 00026 #define GFC_GTK_ACTION_HH 00027 00028 #ifndef GFC_G_OBJECT_HH 00029 #include <gfc/glib/object.hh> 00030 #endif 00031 00032 #ifndef GFC_G_PROPERTY_HH 00033 #include <gfc/glib/property.hh> 00034 #endif 00035 00036 #ifndef GFC_GTK_ENUMS_HH 00037 #include <gfc/gtk/enums.hh> 00038 #endif 00039 00040 #ifndef __GTK_ACTION_H__ 00041 #include <gtk/gtkaction.h> 00042 #endif 00043 00044 #ifndef _CPP_VECTOR 00045 #include <vector> 00046 #endif 00047 00048 namespace GFC { 00049 00050 namespace Gtk { 00051 00052 class AccelGroup; 00053 class Image; 00054 class MenuItem; 00055 class StockId; 00056 class ToolItem; 00057 class Widget; 00058 00088 00089 class Action : public G::Object 00090 { 00091 friend class G::Object; 00092 00093 Action(const Action&); 00094 Action& operator=(const Action&); 00095 00096 protected: 00099 00100 explicit Action(GtkAction *action, bool owns_reference = true); 00106 00110 00111 void block_activate_from(Widget& proxy); 00117 00118 void unblock_activate_from(Widget& proxy); 00124 00128 00129 typedef G::Property<String> LabelPropertyType; 00130 typedef G::PropertyProxy<G::Object, LabelPropertyType> LabelPropertyProxy; 00131 static const LabelPropertyType label_property; 00133 00134 typedef G::Property<String> ShortLabelPropertyType; 00135 typedef G::PropertyProxy<G::Object, ShortLabelPropertyType> ShortLabelPropertyProxy; 00136 static const ShortLabelPropertyType short_label_property; 00138 00139 typedef G::Property<String> TooltipPropertyType; 00140 typedef G::PropertyProxy<G::Object, TooltipPropertyType> TooltipPropertyProxy; 00141 static const TooltipPropertyType tooltip_property; 00143 00144 typedef G::Property<String> StockIdPropertyType; 00145 typedef G::PropertyProxy<G::Object, StockIdPropertyType> StockIdPropertyProxy; 00146 static const StockIdPropertyType stock_id_property; 00148 00149 typedef G::Property<bool> IsImportantPropertyType; 00150 typedef G::PropertyProxy<G::Object, IsImportantPropertyType> IsImportantPropertyProxy; 00151 static const IsImportantPropertyType is_important_property; 00153 00154 typedef G::Property<bool> HideIfEmptyPropertyType; 00155 typedef G::PropertyProxy<G::Object, HideIfEmptyPropertyType> HideIfEmptyPropertyProxy; 00156 static const HideIfEmptyPropertyType hide_if_empty_property; 00158 00159 typedef G::Property<bool> SensitivePropertyType; 00160 typedef G::PropertyProxy<G::Object, SensitivePropertyType> SensitivePropertyProxy; 00161 static const SensitivePropertyType sensitive_property; 00163 00164 typedef G::Property<bool> VisiblePropertyType; 00165 typedef G::PropertyProxy<G::Object, VisiblePropertyType> VisiblePropertyProxy; 00166 static const VisiblePropertyType visible_property; 00168 00169 typedef G::Property<bool> VisibleHorizontalPropertyType; 00170 typedef G::PropertyProxy<G::Object, VisibleHorizontalPropertyType> VisibleHorizontalPropertyProxy; 00171 static const VisibleHorizontalPropertyType visible_horizontal_property; 00173 00174 typedef G::Property<bool> VisibleVerticalPropertyType; 00175 typedef G::PropertyProxy<G::Object, VisibleVerticalPropertyType> VisibleVerticalPropertyProxy; 00176 static const VisibleVerticalPropertyType visible_vertical_property; 00178 00182 00183 typedef G::Signal<void> ActivateSignalType; 00184 typedef G::SignalProxy<TypeInstance, ActivateSignalType> ActivateSignalProxy; 00185 static const ActivateSignalType activate_signal; 00190 00192 00193 public: 00196 00197 Action(const char *name, const char *label); 00198 Action(const String& name, const String& label); 00205 00206 Action(const char *name, const StockId& stock_id); 00207 Action(const String& name, const StockId& stock_id); 00214 00215 Action(const char *name, const char *label, const StockId& stock_id); 00216 Action(const String& name, const String& label, const StockId& stock_id); 00225 00226 virtual ~Action(); 00228 00232 00233 GtkAction* gtk_action() const; 00235 00236 operator GtkAction* () const; 00238 00239 String get_name() const; 00242 00243 bool get_proxies(std::vector<Widget*>& proxies) const; 00247 00248 bool get_sensitive() const; 00253 00254 bool get_visible() const; 00259 00260 bool is_sensitive() const; 00263 00264 bool is_visible() const; 00267 00271 00272 void activate(); 00276 00277 Image* create_icon(IconSize icon_size); 00282 00283 MenuItem* create_menu_item(); 00286 00287 ToolItem* create_tool_item(); 00290 00291 void connect_proxy(Widget& proxy); 00299 00300 void disconnect_proxy(Widget& proxy); 00303 00304 void connect_accelerator(); 00310 00311 void disconnect_accelerator(); 00313 00314 void set_accel_path(const char *accel_path); 00315 void set_accel_path(const String& accel_path); 00321 00322 void set_accel_group(AccelGroup *accel_group); 00326 00327 void set_tooltip(const char *tooltip); 00328 void set_tooltip(const String& tooltip); 00331 00335 00336 const LabelPropertyProxy prop_label(); 00338 00339 const ShortLabelPropertyProxy prop_short_label(); 00341 00342 const TooltipPropertyProxy prop_tooltip(); 00344 00345 const StockIdPropertyProxy prop_stock_id(); 00347 00348 const IsImportantPropertyProxy prop_is_important(); 00351 00352 const HideIfEmptyPropertyProxy prop_hide_if_empty(); 00354 00355 const SensitivePropertyProxy prop_sensitive(); 00357 00358 const VisiblePropertyProxy prop_visible(); 00360 00361 const VisibleHorizontalPropertyProxy prop_visible_horizontal(); 00363 00364 const VisibleVerticalPropertyProxy prop_visible_vertical(); 00366 00370 00371 const ActivateSignalProxy sig_activate(); 00373 00375 }; 00376 00377 } // namespace Gtk 00378 00379 } // namespace GFC 00380 00381 #include <gfc/gtk/inline/action.inl> 00382 00383 #endif // GFC_GTK_ACTION_HH 00384

Generated on Tue Aug 24 00:34:30 2004 for GFC-UI by doxygen 1.3.8