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

actiongroup.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 00023 00024 #ifndef GFC_GTK_ACTION_GROUP_HH 00025 #define GFC_GTK_ACTION_GROUP_HH 00026 00027 #ifndef GFC_G_OBJECT_HH 00028 #include <gfc/glib/object.hh> 00029 #endif 00030 00031 #ifndef GFC_GTK_RADIO_ACTION_HH 00032 #include <gfc/gtk/radioaction.hh> 00033 #endif 00034 00035 #ifndef __GTK_ACTION_GROUP_H__ 00036 #include <gtk/gtkactiongroup.h> 00037 #endif 00038 00039 namespace GFC { 00040 00041 namespace Gtk { 00042 00043 class AccelKey; 00044 00151 00152 class ActionGroup : public G::Object 00153 { 00154 friend class G::Object; 00155 00156 ActionGroup(const ActionGroup&); 00157 ActionGroup& operator=(const ActionGroup&); 00158 00159 protected: 00162 00163 explicit ActionGroup(GtkActionGroup *action_group, bool owns_reference = true); 00170 00174 00175 typedef G::Signal<void, Action&, Widget&> ConnectProxySignalType; 00176 typedef G::SignalProxy<TypeInstance, ConnectProxySignalType> ConnectProxySignalProxy; 00177 static const ConnectProxySignalType connect_proxy_signal; 00184 00185 typedef G::Signal<void, Action&, Widget&> DisconnectProxySignalType; 00186 typedef G::SignalProxy<TypeInstance, DisconnectProxySignalType> DisconnectProxySignalProxy; 00187 static const DisconnectProxySignalType disconnect_proxy_signal; 00194 00195 typedef G::Signal<void, Action&> PreActivateSignalType; 00196 typedef G::SignalProxy<TypeInstance, PreActivateSignalType> PreActivateSignalProxy; 00197 static const PreActivateSignalType pre_activate_signal; 00203 00204 typedef G::Signal<void, Action&> PostActivateSignalType; 00205 typedef G::SignalProxy<TypeInstance, PostActivateSignalType> PostActivateSignalProxy; 00206 static const PostActivateSignalType post_activate_signal; 00212 00214 00215 public: 00216 typedef sigc::slot<void> ActivateSlot; 00223 00224 typedef sigc::slot<void, RadioAction&> ChangedSlot; 00232 00235 00236 ActionGroup(const char *name); 00237 ActionGroup(const String& name); 00242 00243 virtual ~ActionGroup(); 00245 00249 00250 GtkActionGroup* gtk_action_group() const; 00252 00253 operator GtkActionGroup* () const; 00255 00256 bool get_sensitive() const; 00262 00263 bool get_visible() const; 00270 00271 String get_name() const; 00274 00275 Action* get_action(const char *action_name); 00276 Action* get_action(const String& action_name); 00280 00284 00285 void set_sensitive(bool sensitive); 00288 00289 void set_visible(bool visible); 00292 00293 bool list_actions(std::vector<Action*>& actions) const; 00297 00298 void add_action(Action& action); 00305 00306 void add_action(Action& action, const AccelKey& accel_key); 00312 00313 void add_action(Action& action, const ActivateSlot& slot); 00321 00322 void add_action(Action& action, const AccelKey& accel_key, const ActivateSlot& slot); 00332 00333 void add_action(RadioAction& action, const AccelKey& accel_key); 00339 00340 void add_action(RadioAction& action, const ChangedSlot& slot); 00352 00353 void add_action(RadioAction& action, const AccelKey& accel_key, const ChangedSlot& slot); 00367 00368 void add_actions(const RadioActions& group, int value, const ChangedSlot& slot); 00378 00379 void remove_action(Action& action); 00382 00386 00387 Action* add(const char *name, const char *label, const char *tooltip = 0); 00392 00393 Action* add(const char *name, const char *label, const AccelKey& accel_key, const char *tooltip = 0); 00399 00400 Action* add(const char *name, const StockId& stock_id, const char *tooltip = 0); 00405 00406 Action* add(const char *name, const StockId& stock_id, const AccelKey& accel_key, const char *tooltip = 0); 00412 00413 Action* add(const char *name, const char *label, const StockId& stock_id, const char *tooltip = 0); 00419 00420 Action* add(const char *name, const char *label, const StockId& stock_id, const AccelKey& accel_key, const char *tooltip = 0); 00427 00431 00432 ToggleAction* add(const char *name, const StockId& stock_id, bool is_active, const char *tooltip = 0); 00438 00439 ToggleAction* add(const char *name, const StockId& stock_id, const AccelKey& accel_key, bool is_active, const char *tooltip = 0); 00446 00447 ToggleAction* add(const char *name, const char *label, bool is_active, const char *tooltip = 0); 00453 00454 ToggleAction* add(const char *name, const char *label, const AccelKey& accel_key, bool is_active, const char *tooltip = 0); 00461 00462 ToggleAction* add(const char *name, const char *label, const StockId& stock_id, bool is_active, const char *tooltip = 0); 00469 00470 ToggleAction* add(const char *name, const char *label, const StockId& stock_id, const AccelKey& accel_key, bool is_active, const char *tooltip = 0); 00478 00482 00483 const ConnectProxySignalProxy sig_connect_proxy(); 00490 00491 const DisconnectProxySignalProxy sig_disconnect_proxy(); 00495 00496 const PreActivateSignalProxy sig_pre_activate(); 00500 00501 const PostActivateSignalProxy sig_post_activate(); 00505 00507 }; 00508 00509 } // namespace Gtk 00510 00511 } // namespace GFC 00512 00513 #include <gfc/gtk/inline/actiongroup.inl> 00514 00515 #endif // GFC_GTK_ACTION_GROUP_HH 00516

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