Install ardour as a binary, a script and a set of shared
[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 #include <glibmm.h>
7
8 /* $Id$ */
9
10 /* Copyright (C) 2003 The gtkmm Development Team
11  *
12  * This library is free software; you can redistribute it and/or
13  * modify it under the terms of the GNU Library General Public
14  * License as published by the Free Software Foundation; either
15  * version 2 of the License, or (at your option) any later version.
16  *
17  * This library is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
20  * Library General Public License for more details.
21  *
22  * You should have received a copy of the GNU Library General Public
23  * License along with this library; if not, write to the Free
24  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
25  */
26
27 #include <gtkmm/widget.h>
28 #include <gtkmm/action.h>
29 #include <gtkmm/accelkey.h>
30  
31
32 #ifndef DOXYGEN_SHOULD_SKIP_THIS
33 typedef struct _GtkActionGroup GtkActionGroup;
34 typedef struct _GtkActionGroupClass GtkActionGroupClass;
35 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
36
37
38 namespace Gtk
39 { class ActionGroup_Class; } // namespace Gtk
40 namespace Gtk
41 {
42   
43
44 class ActionGroup : public Glib::Object
45 {
46   
47 #ifndef DOXYGEN_SHOULD_SKIP_THIS
48
49 public:
50   typedef ActionGroup CppObjectType;
51   typedef ActionGroup_Class CppClassType;
52   typedef GtkActionGroup BaseObjectType;
53   typedef GtkActionGroupClass BaseClassType;
54
55 private:  friend class ActionGroup_Class;
56   static CppClassType actiongroup_class_;
57
58 private:
59   // noncopyable
60   ActionGroup(const ActionGroup&);
61   ActionGroup& operator=(const ActionGroup&);
62
63 protected:
64   explicit ActionGroup(const Glib::ConstructParams& construct_params);
65   explicit ActionGroup(GtkActionGroup* castitem);
66
67 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
68
69 public:
70   virtual ~ActionGroup();
71
72 #ifndef DOXYGEN_SHOULD_SKIP_THIS
73   static GType get_type()      G_GNUC_CONST;
74   static GType get_base_type() G_GNUC_CONST;
75 #endif
76
77   ///Provides access to the underlying C GObject.
78   GtkActionGroup*       gobj()       { return reinterpret_cast<GtkActionGroup*>(gobject_); }
79
80   ///Provides access to the underlying C GObject.
81   const GtkActionGroup* gobj() const { return reinterpret_cast<GtkActionGroup*>(gobject_); }
82
83   ///Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.
84   GtkActionGroup* gobj_copy();
85
86 private:
87
88
89 protected:
90   explicit ActionGroup(const Glib::ustring& name = Glib::ustring());
91
92 public:
93   
94   static Glib::RefPtr<ActionGroup> create(const Glib::ustring& name =  Glib::ustring());
95
96   
97   /** Gets the name of the action group.
98    * @return The name of the action group.
99    * 
100    * Since: 2.4.
101    */
102   Glib::ustring get_name() const;
103
104   
105   /** Returns <tt>true</tt> if the group is sensitive.  The constituent actions
106    * can only be logically sensitive (see is_sensitive()) if
107    * they are sensitive (see get_sensitive()) and their group
108    * is sensitive.
109    * @return <tt>true</tt> if the group is sensitive.
110    * 
111    * Since: 2.4.
112    */
113   bool get_sensitive() const;
114   
115   /** Changes the sensitivity of @a action_group 
116    * 
117    * Since: 2.4
118    * @param sensitive New sensitivity.
119    */
120   void set_sensitive(bool sensitive = true);
121   
122   /** Returns <tt>true</tt> if the group is visible.  The constituent actions
123    * can only be logically visible (see is_visible()) if
124    * they are visible (see get_visible()) and their group
125    * is visible.
126    * @return <tt>true</tt> if the group is visible.
127    * 
128    * Since: 2.4.
129    */
130   bool get_visible() const;
131   
132   /** Changes the visible of @a action_group .
133    * 
134    * Since: 2.4
135    * @param visible New visiblity.
136    */
137   void set_visible(bool visible = true);
138                                       
139   
140   /** Looks up an action in the action group by name.
141    * @param action_name The name of the action.
142    * @return The action, or <tt>0</tt> if no action by that name exists
143    * 
144    * Since: 2.4.
145    */
146   Glib::RefPtr<Action> get_action(const Glib::ustring& action_name);
147   
148   /** Looks up an action in the action group by name.
149    * @param action_name The name of the action.
150    * @return The action, or <tt>0</tt> if no action by that name exists
151    * 
152    * Since: 2.4.
153    */
154   Glib::RefPtr<const Action> get_action(const Glib::ustring& action_name) const;
155
156   
157   /** Lists the actions in the action group.
158    * @return An allocated list of the action objects in the action group
159    * 
160    * Since: 2.4.
161    */
162   Glib::ListHandle< Glib::RefPtr<Action> > get_actions();
163   
164   /** Lists the actions in the action group.
165    * @return An allocated list of the action objects in the action group
166    * 
167    * Since: 2.4.
168    */
169   Glib::ListHandle< Glib::RefPtr<const Action> > get_actions() const;
170     
171   void add(const Glib::RefPtr<Action>& action);
172   
173   //We want it to always try to use the stock accelerator,
174   //so we use gtk_action_group_add_action_with_accel(), instead of gtk_action_group_add_action(),
175   //passing null for the accelerator.
176
177   void add(const Glib::RefPtr<Action>& action, const AccelKey& accel_key);
178   
179   //We need to duplicate the gtk_action_group_add_action_with_accel() implementation, because we want to
180   //use AccelKey, not just the accelerator string format that is _one_ of the ways to create an AccelKey.
181    
182   //TODO: Could this whole class have an STL-style interface?
183   void add(const Glib::RefPtr<Action>& action, const Action::SlotActivate& slot);
184   void add(const Glib::RefPtr<Action>& action, const AccelKey& accel_key, const Action::SlotActivate& slot);
185   
186   /** Removes an action object from the action group.
187    * 
188    * Since: 2.4
189    * @param action An action.
190    */
191   void remove(const Glib::RefPtr<Action>& action);
192   
193    //TODO: We probably need to use this in our add_actions() implementation:
194   
195   /** Translates a string using the specified translate_func(). This
196    * is mainly intended for language bindings.
197    * @param string A string.
198    * @return The translation of @a string 
199    * 
200    * Since: 2.6.
201    */
202   Glib::ustring translate_string(const Glib::ustring& str) const;
203   
204
205   //These are just C convenience methods:
206   
207   //These are also just C convenience methods that are useless unless you are using the other convenience methods:
208   
209
210   Glib::SignalProxy2< void,const Glib::RefPtr<Action>&,Widget* > signal_connect_proxy();
211
212   
213   Glib::SignalProxy2< void,const Glib::RefPtr<Action>&,Widget* > signal_disconnect_proxy();
214              
215   
216   Glib::SignalProxy1< void,const Glib::RefPtr<Action>& > signal_pre_activate();
217  
218   
219   Glib::SignalProxy1< void,const Glib::RefPtr<Action>& > signal_post_activate();
220  
221
222 public:
223
224 public:
225   //C++ methods used to invoke GTK+ virtual functions:
226
227 protected:
228   //GTK+ Virtual Functions (override these to change behaviour):
229
230   //Default Signal Handlers::
231
232
233 };
234
235 } // namespace Gtk
236
237
238 namespace Glib
239 {
240   /** @relates Gtk::ActionGroup
241    * @param object The C instance
242    * @param take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref.
243    * @result A C++ instance that wraps this C instance.
244    */
245   Glib::RefPtr<Gtk::ActionGroup> wrap(GtkActionGroup* object, bool take_copy = false);
246 }
247
248
249 #endif /* _GTKMM_ACTIONGROUP_H */
250