Remove ancient/unused flowcanvas and libglademm from repository.
[ardour.git] / libs / gtkmm2 / gtk / gtkmm / actiongroup.h
1 // -*- c++ -*-
2 // Generated by gtkmmproc -- DO NOT MODIFY!
3 #ifndef _GTKMM_ACTIONGROUP_H
4 #define _GTKMM_ACTIONGROUP_H
5
6
7 #include <glibmm.h>
8
9 /* $Id$ */
10
11 /* Copyright (C) 2003 The gtkmm Development Team
12  *
13  * This library is free software; you can redistribute it and/or
14  * modify it under the terms of the GNU Library General Public
15  * License as published by the Free Software Foundation; either
16  * version 2 of the License, or (at your option) any later version.
17  *
18  * This library is distributed in the hope that it will be useful,
19  * but WITHOUT ANY WARRANTY; without even the implied warranty of
20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
21  * Library General Public License for more details.
22  *
23  * You should have received a copy of the GNU Library General Public
24  * License along with this library; if not, write to the Free
25  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
26  */
27
28 #include <gtkmm/widget.h>
29 #include <gtkmm/action.h>
30 #include <gtkmm/accelkey.h>
31  
32
33 #ifndef DOXYGEN_SHOULD_SKIP_THIS
34 typedef struct _GtkActionGroup GtkActionGroup;
35 typedef struct _GtkActionGroupClass GtkActionGroupClass;
36 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
37
38
39 namespace Gtk
40 { class ActionGroup_Class; } // namespace Gtk
41 namespace Gtk
42 {
43   
44
45 class ActionGroup : public Glib::Object
46 {
47   
48 #ifndef DOXYGEN_SHOULD_SKIP_THIS
49
50 public:
51   typedef ActionGroup CppObjectType;
52   typedef ActionGroup_Class CppClassType;
53   typedef GtkActionGroup BaseObjectType;
54   typedef GtkActionGroupClass BaseClassType;
55
56 private:  friend class ActionGroup_Class;
57   static CppClassType actiongroup_class_;
58
59 private:
60   // noncopyable
61   ActionGroup(const ActionGroup&);
62   ActionGroup& operator=(const ActionGroup&);
63
64 protected:
65   explicit ActionGroup(const Glib::ConstructParams& construct_params);
66   explicit ActionGroup(GtkActionGroup* castitem);
67
68 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
69
70 public:
71   virtual ~ActionGroup();
72
73 #ifndef DOXYGEN_SHOULD_SKIP_THIS
74   static GType get_type()      G_GNUC_CONST;
75   static GType get_base_type() G_GNUC_CONST;
76 #endif
77
78   ///Provides access to the underlying C GObject.
79   GtkActionGroup*       gobj()       { return reinterpret_cast<GtkActionGroup*>(gobject_); }
80
81   ///Provides access to the underlying C GObject.
82   const GtkActionGroup* gobj() const { return reinterpret_cast<GtkActionGroup*>(gobject_); }
83
84   ///Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.
85   GtkActionGroup* gobj_copy();
86
87 private:
88
89
90 protected:
91   explicit ActionGroup(const Glib::ustring& name = Glib::ustring());
92
93 public:
94   
95   static Glib::RefPtr<ActionGroup> create(const Glib::ustring& name =  Glib::ustring());
96
97   
98   /** Gets the name of the action group.
99    * @return The name of the action group.
100    * 
101    * @newin2p4.
102    */
103   Glib::ustring get_name() const;
104
105   
106   /** Return value: <tt>true</tt> if the group is sensitive.
107    * @return <tt>true</tt> if the group is sensitive.
108    * 
109    * @newin2p4.
110    */
111   bool get_sensitive() const;
112   
113   /** Changes the sensitivity of @a action_group 
114    * 
115    * @newin2p4
116    * @param sensitive New sensitivity.
117    */
118   void set_sensitive(bool sensitive = true);
119   
120   /** Return value: <tt>true</tt> if the group is visible.
121    * @return <tt>true</tt> if the group is visible.
122    * 
123    * @newin2p4.
124    */
125   bool get_visible() const;
126   
127   /** Changes the visible of @a action_group .
128    * 
129    * @newin2p4
130    * @param visible New visiblity.
131    */
132   void set_visible(bool visible = true);
133                                       
134   
135   /** Looks up an action in the action group by name.
136    * @param action_name The name of the action.
137    * @return The action, or <tt>0</tt> if no action by that name exists
138    * 
139    * @newin2p4.
140    */
141   Glib::RefPtr<Action> get_action(const Glib::ustring& action_name);
142   
143   /** Looks up an action in the action group by name.
144    * @param action_name The name of the action.
145    * @return The action, or <tt>0</tt> if no action by that name exists
146    * 
147    * @newin2p4.
148    */
149   Glib::RefPtr<const Action> get_action(const Glib::ustring& action_name) const;
150
151   
152   /** Lists the actions in the action group.
153    * @return An allocated list of the action objects in the action group
154    * 
155    * @newin2p4.
156    */
157   Glib::ListHandle< Glib::RefPtr<Action> > get_actions();
158   
159   /** Lists the actions in the action group.
160    * @return An allocated list of the action objects in the action group
161    * 
162    * @newin2p4.
163    */
164   Glib::ListHandle< Glib::RefPtr<const Action> > get_actions() const;
165     
166   void add(const Glib::RefPtr<Action>& action);
167   
168   //We want it to always try to use the stock accelerator,
169   //so we use gtk_action_group_add_action_with_accel(), instead of gtk_action_group_add_action(),
170   //passing null for the accelerator.
171
172   void add(const Glib::RefPtr<Action>& action, const AccelKey& accel_key);
173   
174   //We need to duplicate the gtk_action_group_add_action_with_accel() implementation, because we want to
175   //use AccelKey, not just the accelerator string format that is _one_ of the ways to create an AccelKey.
176    
177   //TODO: Could this whole class have an STL-style interface?
178   void add(const Glib::RefPtr<Action>& action, const Action::SlotActivate& slot);
179   void add(const Glib::RefPtr<Action>& action, const AccelKey& accel_key, const Action::SlotActivate& slot);
180   
181   /** Removes an action object from the action group.
182    * 
183    * @newin2p4
184    * @param action An action.
185    */
186   void remove(const Glib::RefPtr<Action>& action);
187   
188    //TODO: We probably need to use this in our add_actions() implementation:
189   
190   /** Translates a string using the specified translate_func(). This
191    * is mainly intended for language bindings.
192    * @param string A string.
193    * @return The translation of @a string 
194    * 
195    * @newin2p6.
196    */
197   Glib::ustring translate_string(const Glib::ustring& str) const;
198   
199
200   //These are just C convenience methods:
201   
202   //These are also just C convenience methods that are useless unless you are using the other convenience methods:
203   
204
205   /** The connect_proxy signal is emitted after connecting a proxy to 
206    * an action in the group. Note that the proxy may have been connected 
207    * to a different action before.
208    *
209    * This is intended for simple customizations for which a custom action
210    * class would be too clumsy, e.g. showing tooltips for menuitems in the
211    * statusbar.
212    *
213    * UIManager proxies the signal and provides global notification 
214    * just before any action is connected to a proxy, which is probably more
215    * convenient to use.
216    *
217    * @param action the action
218    * @param proxy the proxy
219    *
220    * @par Prototype:
221    * <tt>void on_my_%connect_proxy(const Glib::RefPtr<Action>& action, Widget* proxy)</tt>
222    */
223
224   Glib::SignalProxy2< void,const Glib::RefPtr<Action>&,Widget* > signal_connect_proxy();
225
226   
227   /** The disconnect_proxy signal is emitted after disconnecting a proxy 
228    * from an action in the group. 
229    *
230    * UIManager proxies the signal and provides global notification 
231    * just before any action is connected to a proxy, which is probably more
232    * convenient to use.
233    *
234    * @param action the action
235    * @param proxy the proxy
236    *
237    * @par Prototype:
238    * <tt>void on_my_%disconnect_proxy(const Glib::RefPtr<Action>& action, Widget* proxy)</tt>
239    */
240
241   Glib::SignalProxy2< void,const Glib::RefPtr<Action>&,Widget* > signal_disconnect_proxy();
242
243   
244   /** The pre_activate signal is emitted just before the @action in the
245    * action_group is activated
246    *
247    * This is intended for UIManager to proxy the signal and provide global
248    * notification just before any action is activated.
249    *
250    * @action the action
251    *
252    * @par Prototype:
253    * <tt>void on_my_%pre_activate(const Glib::RefPtr<Action>& action)</tt>
254    */
255
256   Glib::SignalProxy1< void,const Glib::RefPtr<Action>& > signal_pre_activate();
257
258   
259   /** The post_activate signal is emitted just after the @action in the
260    * @action_group is activated
261    *
262    * This is intended for UIManager to proxy the signal and provide global
263    * notification just after any action is activated.
264    *
265    * @param action the action
266    *
267    * @par Prototype:
268    * <tt>void on_my_%post_activate(const Glib::RefPtr<Action>& action)</tt>
269    */
270
271   Glib::SignalProxy1< void,const Glib::RefPtr<Action>& > signal_post_activate();
272  
273
274 public:
275
276 public:
277   //C++ methods used to invoke GTK+ virtual functions:
278 #ifdef GLIBMM_VFUNCS_ENABLED
279 #endif //GLIBMM_VFUNCS_ENABLED
280
281 protected:
282   //GTK+ Virtual Functions (override these to change behaviour):
283 #ifdef GLIBMM_VFUNCS_ENABLED
284 #endif //GLIBMM_VFUNCS_ENABLED
285
286   //Default Signal Handlers::
287 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
288 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
289
290
291 };
292
293 } // namespace Gtk
294
295
296 namespace Glib
297 {
298   /** A Glib::wrap() method for this object.
299    * 
300    * @param object The C instance.
301    * @param take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref.
302    * @result A C++ instance that wraps this C instance.
303    *
304    * @relates Gtk::ActionGroup
305    */
306   Glib::RefPtr<Gtk::ActionGroup> wrap(GtkActionGroup* object, bool take_copy = false);
307 }
308
309
310 #endif /* _GTKMM_ACTIONGROUP_H */
311