Ardour  9.0-pre0-582-g084a23a80d
action.h
Go to the documentation of this file.
1 // -*- c++ -*-
2 // Generated by gmmproc 2.45.3 -- DO NOT MODIFY!
3 #ifndef _GTKMM_ACTION_H
4 #define _GTKMM_ACTION_H
5 
6 #include <gtkmmconfig.h>
7 
8 
9 #include <glibmm/ustring.h>
10 #include <sigc++/sigc++.h>
11 
12 /* Copyright (C) 2003 The gtkmm Development Team
13  *
14  * This library is free software; you can redistribute it and/or
15  * modify it under the terms of the GNU Lesser General Public
16  * License as published by the Free Software Foundation; either
17  * version 2.1 of the License, or (at your option) any later version.
18  *
19  * This library is distributed in the hope that it will be useful,
20  * but WITHOUT ANY WARRANTY; without even the implied warranty of
21  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
22  * Lesser General Public License for more details.
23  *
24  * You should have received a copy of the GNU Lesser General Public
25  * License along with this library; if not, write to the Free
26  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
27  */
28 
29 
30 #include <gtkmm/widget.h>
31 #include <gtkmm/accelgroup.h>
32 #include <gtkmm/stockid.h>
33 #include <giomm/icon.h>
34 
35 
36 #ifndef DOXYGEN_SHOULD_SKIP_THIS
37 typedef struct _GtkAction GtkAction;
38 typedef struct _GtkActionClass GtkActionClass;
39 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
40 
41 
42 #ifndef DOXYGEN_SHOULD_SKIP_THIS
43 namespace Gtk
44 { class Action_Class; } // namespace Gtk
45 #endif //DOXYGEN_SHOULD_SKIP_THIS
46 
47 namespace Gtk
48 {
49 
50 class ActionGroup;
51 class Menu;
52 class MenuItem;
53 class ToolItem;
54 class Image;
55 
87 class Action : public Glib::Object
88 {
89 
90 #ifndef DOXYGEN_SHOULD_SKIP_THIS
91 
92 public:
93  typedef Action CppObjectType;
94  typedef Action_Class CppClassType;
95  typedef GtkAction BaseObjectType;
96  typedef GtkActionClass BaseClassType;
97 
98 private: friend class Action_Class;
99  static CppClassType action_class_;
100 
101 private:
102  // noncopyable
103  Action(const Action&);
104  Action& operator=(const Action&);
105 
106 protected:
107  explicit Action(const Glib::ConstructParams& construct_params);
108  explicit Action(GtkAction* castitem);
109 
110 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
111 
112 public:
113  virtual ~Action();
114 
117  static GType get_type() G_GNUC_CONST;
118 
119 #ifndef DOXYGEN_SHOULD_SKIP_THIS
120 
121 
122  static GType get_base_type() G_GNUC_CONST;
123 #endif
124 
126  GtkAction* gobj() { return reinterpret_cast<GtkAction*>(gobject_); }
127 
129  const GtkAction* gobj() const { return reinterpret_cast<GtkAction*>(gobject_); }
130 
133 
134 private:
135 
136 
137 protected:
140 
151  explicit Action(const Glib::ustring& name, const StockID& stock_id = StockID(), const Glib::ustring& label = Glib::ustring(), const Glib::ustring& tooltip = Glib::ustring());
152 
163  explicit Action(const Glib::ustring& name, const Glib::ustring& icon_name, const Glib::ustring& label = Glib::ustring(), const Glib::ustring& tooltip = Glib::ustring());
164 
165 public:
166  //Note that gtk_action_new() does not allow name to be NULL, which suggests that we should not have a default constructor,
167  //but it's OK to set the name later:
168 
169  static Glib::RefPtr<Action> create();
170 
171 
180  static Glib::RefPtr<Action> create(const Glib::ustring& name, const Glib::ustring& label = Glib::ustring(), const Glib::ustring& tooltip = Glib::ustring());
181 
194  static Glib::RefPtr<Action> create(const Glib::ustring& name, const Gtk::StockID& stock_id, const Glib::ustring& label = Glib::ustring(), const Glib::ustring& tooltip = Glib::ustring());
195 
208  static Glib::RefPtr<Action> create_with_icon_name(const Glib::ustring& name, const Glib::ustring& icon_name, const Glib::ustring& label, const Glib::ustring& tooltip);
209 
210 
216  Glib::ustring get_name() const;
217 
218 
224  bool is_sensitive() const;
225 
232  bool get_sensitive() const;
233 
234 
242  void set_sensitive(bool sensitive = true);
243 
244 
250  bool is_visible() const;
251 
258  bool get_visible() const;
259 
267  void set_visible(bool visible = true);
268 
269 
276  void activate();
277 
285 
291 
297 
306 
307  //TODO: Deprecate these when we can derive the appropriate widgets from Activatable, when we can break ABI.
308 
321  void connect_proxy(Widget& proxy);
322 
330  void disconnect_proxy(Widget& proxy);
331 
332 
339  Glib::SListHandle<Widget*> get_proxies();
340 
347  Glib::SListHandle<const Widget*> get_proxies() const;
348 
349 
360 
364 
365 
372  Glib::ustring get_accel_path() const;
373 
375  typedef sigc::slot<void> SlotActivate;
376 
377 
385  Glib::SignalProxy0< void > signal_activate();
386 
387 
388  //Used by AccelGroup:
389 
400  void set_accel_path(const Glib::ustring& accel_path);
401 
407  void set_accel_group(const Glib::RefPtr<AccelGroup>& accel_group);
408 
409 
414  void set_label(const Glib::ustring& label);
415 
420  Glib::ustring get_label() const;
421 
426  void set_short_label(const Glib::ustring& short_label);
427 
432  Glib::ustring get_short_label() const;
433 
438  void set_tooltip(const Glib::ustring& tooltip);
439 
444  Glib::ustring get_tooltip() const;
445 
450  void set_stock_id(const StockID& stock_id);
451 
457 
462  void set_gicon(const Glib::RefPtr<Gio::Icon>& icon);
463 
468  Glib::RefPtr<Gio::Icon> get_gicon();
469 
474  Glib::RefPtr<const Gio::Icon> get_gicon() const;
475 
480  void set_icon_name(const Glib::ustring& icon_name);
481 
486  Glib::ustring get_icon_name() const;
487 
492  void set_visible_horizontal(bool visible_horizontal = true);
493 
499 
504  void set_visible_vertical(bool visible_vertical = true);
505 
510  bool get_visible_vertical() const;
511 
518  void set_is_important(bool is_important = true);
519 
524  bool get_is_important() const;
525 
526 
535  void set_always_show_image(bool always_show = true);
536 
543  bool get_always_show_image() const;
544 
545 
554 
558 
559  //gtk_action_get_accel_closure() is too C-specific:
560 
561 
567  Glib::PropertyProxy_ReadOnly< Glib::ustring > property_name() const;
568 
569 
575  Glib::PropertyProxy< Glib::ustring > property_label() ;
576 
582  Glib::PropertyProxy_ReadOnly< Glib::ustring > property_label() const;
583 
589  Glib::PropertyProxy< Glib::ustring > property_short_label() ;
590 
596  Glib::PropertyProxy_ReadOnly< Glib::ustring > property_short_label() const;
597 
603  Glib::PropertyProxy< Glib::ustring > property_tooltip() ;
604 
610  Glib::PropertyProxy_ReadOnly< Glib::ustring > property_tooltip() const;
611 
617  Glib::PropertyProxy< StockID > property_stock_id() ;
618 
624  Glib::PropertyProxy_ReadOnly< StockID > property_stock_id() const;
625 
631  Glib::PropertyProxy< Glib::RefPtr<Gio::Icon> > property_gicon() ;
632 
638  Glib::PropertyProxy_ReadOnly< Glib::RefPtr<Gio::Icon> > property_gicon() const;
639 
645  Glib::PropertyProxy< Glib::ustring > property_icon_name() ;
646 
652  Glib::PropertyProxy_ReadOnly< Glib::ustring > property_icon_name() const;
653 
659  Glib::PropertyProxy< bool > property_visible_horizontal() ;
660 
666  Glib::PropertyProxy_ReadOnly< bool > property_visible_horizontal() const;
667 
673  Glib::PropertyProxy< bool > property_visible_vertical() ;
674 
680  Glib::PropertyProxy_ReadOnly< bool > property_visible_vertical() const;
681 
687  Glib::PropertyProxy< bool > property_visible_overflown() ;
688 
694  Glib::PropertyProxy_ReadOnly< bool > property_visible_overflown() const;
695 
701  Glib::PropertyProxy< bool > property_is_important() ;
702 
708  Glib::PropertyProxy_ReadOnly< bool > property_is_important() const;
709 
715  Glib::PropertyProxy< bool > property_hide_if_empty() ;
716 
722  Glib::PropertyProxy_ReadOnly< bool > property_hide_if_empty() const;
723 
729  Glib::PropertyProxy< bool > property_sensitive() ;
730 
736  Glib::PropertyProxy_ReadOnly< bool > property_sensitive() const;
737 
743  Glib::PropertyProxy< bool > property_visible() ;
744 
750  Glib::PropertyProxy_ReadOnly< bool > property_visible() const;
751 
757  Glib::PropertyProxy< Glib::RefPtr<ActionGroup> > property_action_group() ;
758 
764  Glib::PropertyProxy_ReadOnly< Glib::RefPtr<ActionGroup> > property_action_group() const;
765 
771  Glib::PropertyProxy< bool > property_always_show_image() ;
772 
778  Glib::PropertyProxy_ReadOnly< bool > property_always_show_image() const;
779 
780 
781 protected:
782  //For use by child actions:
783  //TODO: Deprecate these when we can derive the appropriate widgets from Activatable, when we can break ABI.
784 
797 
810 
811 protected:
812  //Widget-creation routines:
814 
816 
817  virtual void connect_proxy_vfunc(Widget* proxy);
818 
819  virtual void disconnect_proxy_vfunc(Widget* proxy);
820 
821 
822 public:
823 
824 public:
825  //C++ methods used to invoke GTK+ virtual functions:
826 
827 protected:
828  //GTK+ Virtual Functions (override these to change behaviour):
829 
830  //Default Signal Handlers::
832  virtual void on_activate();
833 
834 
835 };
836 
837 } // namespace Gtk
838 
839 
840 namespace Glib
841 {
850  Glib::RefPtr<Gtk::Action> wrap(GtkAction* object, bool take_copy = false);
851 }
852 
853 
854 #endif /* _GTKMM_ACTION_H */
855 
void activate()
Glib::ustring get_name() const
Glib::PropertyProxy_ReadOnly< Glib::RefPtr< ActionGroup > > property_action_group() const
Glib::PropertyProxy< bool > property_sensitive()
Glib::PropertyProxy_ReadOnly< bool > property_is_important() const
Glib::PropertyProxy_ReadOnly< Glib::ustring > property_label() const
void block_activate()
Glib::PropertyProxy< bool > property_visible_horizontal()
void set_visible(bool visible=true)
Glib::PropertyProxy_ReadOnly< bool > property_visible_horizontal() const
Glib::PropertyProxy_ReadOnly< StockID > property_stock_id() const
void connect_proxy(Widget &proxy)
Glib::ustring get_accel_path() const
GtkAction * gobj()
Provides access to the underlying C GObject.
Definition: action.h:126
bool is_visible() const
static Glib::RefPtr< Action > create(const Glib::ustring &name, const Gtk::StockID &stock_id, const Glib::ustring &label=Glib::ustring(), const Glib::ustring &tooltip=Glib::ustring())
MenuItem * create_menu_item()
Glib::PropertyProxy_ReadOnly< Glib::ustring > property_icon_name() const
Glib::PropertyProxy_ReadOnly< Glib::ustring > property_name() const
Glib::RefPtr< const Gio::Icon > get_gicon() const
Glib::ustring get_label() const
bool get_visible_horizontal() const
Glib::PropertyProxy_ReadOnly< Glib::RefPtr< Gio::Icon > > property_gicon() const
Glib::PropertyProxy< Glib::ustring > property_icon_name()
void set_tooltip(const Glib::ustring &tooltip)
Glib::PropertyProxy< Glib::RefPtr< ActionGroup > > property_action_group()
Image * create_icon(IconSize icon_size)
Glib::PropertyProxy< Glib::ustring > property_label()
Glib::PropertyProxy_ReadOnly< bool > property_sensitive() const
virtual Widget * create_tool_item_vfunc()
Glib::PropertyProxy_ReadOnly< bool > property_visible_vertical() const
sigc::slot< void > SlotActivate
For instance, void on_activate();.
Definition: action.h:375
Glib::PropertyProxy< bool > property_visible_vertical()
Glib::PropertyProxy< bool > property_always_show_image()
virtual Widget * create_menu_item_vfunc()
const GtkAction * gobj() const
Provides access to the underlying C GObject.
Definition: action.h:129
virtual void disconnect_proxy_vfunc(Widget *proxy)
void set_accel_path(const Glib::ustring &accel_path)
Glib::PropertyProxy< bool > property_visible_overflown()
bool is_sensitive() const
void block_activate_from(Widget &proxy)
Glib::SignalProxy0< void > signal_activate()
void set_accel_group(const Glib::RefPtr< AccelGroup > &accel_group)
bool get_visible_vertical() const
void set_short_label(const Glib::ustring &short_label)
Glib::PropertyProxy_ReadOnly< Glib::ustring > property_short_label() const
GtkAction * gobj_copy()
Provides access to the underlying C instance. The caller is responsible for unrefing it....
Action(const Glib::ustring &name, const Glib::ustring &icon_name, const Glib::ustring &label=Glib::ustring(), const Glib::ustring &tooltip=Glib::ustring())
Action(const Glib::ustring &name, const StockID &stock_id=StockID(), const Glib::ustring &label=Glib::ustring(), const Glib::ustring &tooltip=Glib::ustring())
void set_visible_vertical(bool visible_vertical=true)
void set_gicon(const Glib::RefPtr< Gio::Icon > &icon)
bool get_sensitive() const
Glib::SListHandle< const Widget * > get_proxies() const
bool get_is_important() const
void set_icon_name(const Glib::ustring &icon_name)
static Glib::RefPtr< Action > create_with_icon_name(const Glib::ustring &name, const Glib::ustring &icon_name, const Glib::ustring &label, const Glib::ustring &tooltip)
Glib::ustring get_short_label() const
Glib::PropertyProxy< Glib::ustring > property_tooltip()
Glib::PropertyProxy< Glib::RefPtr< Gio::Icon > > property_gicon()
void connect_accelerator()
ToolItem * create_tool_item()
void set_label(const Glib::ustring &label)
Glib::PropertyProxy< bool > property_is_important()
Glib::ustring get_icon_name() const
void set_always_show_image(bool always_show=true)
Glib::SListHandle< Widget * > get_proxies()
StockID get_stock_id() const
virtual void connect_proxy_vfunc(Widget *proxy)
virtual ~Action()
Glib::RefPtr< Gtk::Action > wrap(GtkAction *object, bool take_copy=false)
Glib::PropertyProxy< StockID > property_stock_id()
void set_stock_id(const StockID &stock_id)
void set_visible_horizontal(bool visible_horizontal=true)
bool get_always_show_image() const
Glib::PropertyProxy< bool > property_visible()
Menu * create_menu()
static GType get_type() G_GNUC_CONST
void set_sensitive(bool sensitive=true)
Glib::PropertyProxy_ReadOnly< bool > property_visible() const
Glib::ustring get_tooltip() const
void disconnect_proxy(Widget &proxy)
Glib::PropertyProxy< bool > property_hide_if_empty()
Glib::PropertyProxy< Glib::ustring > property_short_label()
static Glib::RefPtr< Action > create()
Glib::PropertyProxy_ReadOnly< bool > property_hide_if_empty() const
void set_is_important(bool is_important=true)
bool get_visible() const
void unblock_activate()
virtual void on_activate()
This is a default handler for the signal signal_activate().
void disconnect_accelerator()
static Glib::RefPtr< Action > create(const Glib::ustring &name, const Glib::ustring &label=Glib::ustring(), const Glib::ustring &tooltip=Glib::ustring())
Glib::PropertyProxy_ReadOnly< Glib::ustring > property_tooltip() const
void unblock_activate_from(Widget &proxy)
Glib::PropertyProxy_ReadOnly< bool > property_visible_overflown() const
Glib::PropertyProxy_ReadOnly< bool > property_always_show_image() const
Glib::RefPtr< Gio::Icon > get_gicon()
GtkImageIconNameData name
Definition: gtkimage.h:6
Definition: ardour_ui.h:188