add new sigc++2 directory
[ardour.git] / libs / gtkmm2 / gtk / gtkmm / accellabel.h
1 // -*- c++ -*-
2 // Generated by gtkmmproc -- DO NOT MODIFY!
3 #ifndef _GTKMM_ACCELLABEL_H
4 #define _GTKMM_ACCELLABEL_H
5
6
7 #include <glibmm.h>
8
9 /* $Id$ */
10
11 /* accellabel.h
12  * 
13  * Copyright (C) 1998-2002 The gtkmm Development Team
14  *
15  * This library is free software; you can redistribute it and/or
16  * modify it under the terms of the GNU Library General Public
17  * License as published by the Free Software Foundation; either
18  * version 2 of the License, or (at your option) any later version.
19  *
20  * This library is distributed in the hope that it will be useful,
21  * but WITHOUT ANY WARRANTY; without even the implied warranty of
22  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
23  * Library General Public License for more details.
24  *
25  * You should have received a copy of the GNU Library General Public
26  * License along with this library; if not, write to the Free
27  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
28  */
29
30 #include <gtkmm/label.h>
31
32
33 #ifndef DOXYGEN_SHOULD_SKIP_THIS
34 typedef struct _GtkAccelLabel GtkAccelLabel;
35 typedef struct _GtkAccelLabelClass GtkAccelLabelClass;
36 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
37
38
39 namespace Gtk
40 { class AccelLabel_Class; } // namespace Gtk
41 namespace Gtk
42 {
43
44 /** A label which displays an accelerator key on the right of the text.
45  * Used for menu item labels, for instance.
46  *
47  * @ingroup Widgets
48  */
49
50 class AccelLabel : public Label
51 {
52   public:
53 #ifndef DOXYGEN_SHOULD_SKIP_THIS
54   typedef AccelLabel CppObjectType;
55   typedef AccelLabel_Class CppClassType;
56   typedef GtkAccelLabel BaseObjectType;
57   typedef GtkAccelLabelClass BaseClassType;
58 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
59
60   virtual ~AccelLabel();
61
62 #ifndef DOXYGEN_SHOULD_SKIP_THIS
63
64 private:
65   friend class AccelLabel_Class;
66   static CppClassType accellabel_class_;
67
68   // noncopyable
69   AccelLabel(const AccelLabel&);
70   AccelLabel& operator=(const AccelLabel&);
71
72 protected:
73   explicit AccelLabel(const Glib::ConstructParams& construct_params);
74   explicit AccelLabel(GtkAccelLabel* castitem);
75
76 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
77
78 public:
79 #ifndef DOXYGEN_SHOULD_SKIP_THIS
80   static GType get_type()      G_GNUC_CONST;
81   static GType get_base_type() G_GNUC_CONST;
82 #endif
83
84   ///Provides access to the underlying C GtkObject.
85   GtkAccelLabel*       gobj()       { return reinterpret_cast<GtkAccelLabel*>(gobject_); }
86
87   ///Provides access to the underlying C GtkObject.
88   const GtkAccelLabel* gobj() const { return reinterpret_cast<GtkAccelLabel*>(gobject_); }
89
90
91 public:
92   //C++ methods used to invoke GTK+ virtual functions:
93 #ifdef GLIBMM_VFUNCS_ENABLED
94 #endif //GLIBMM_VFUNCS_ENABLED
95
96 protected:
97   //GTK+ Virtual Functions (override these to change behaviour):
98 #ifdef GLIBMM_VFUNCS_ENABLED
99 #endif //GLIBMM_VFUNCS_ENABLED
100
101   //Default Signal Handlers::
102 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
103 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
104
105
106 private:
107
108   
109 public:
110
111   //The default ctor doesn't correspond to any _new function, but gtkmenuitem.cc does a simple g_object_new() with no properties.
112   /** Default constructor to create an AccelLabel object
113    */
114   AccelLabel();
115
116   /** Constructor to create an AccelLabel object with a default label
117    * @param label The label string.
118    * @param mnemonic If true, characters preceded by an underscore (_) will be underlined and used as a keyboard accelerator.
119    */
120   explicit AccelLabel(const Glib::ustring& label, bool mnemonic = false);
121
122   
123   /** Sets the widget to be monitored by this accelerator label.
124    * @param accel_widget The widget to be monitored.
125    */
126   void set_accel_widget(const Widget& accel_widget);
127   /// Forget the accel widget previously set by set_accel_widget().
128   void unset_accel_widget();
129
130   
131   /** Fetches the widget monitored by this accelerator label. See
132    * set_accel_widget().
133    * @return The object monitored by the accelerator label,
134    * or <tt>0</tt>.
135    */
136   Widget* get_accel_widget();
137   
138   /** Fetches the widget monitored by this accelerator label. See
139    * set_accel_widget().
140    * @return The object monitored by the accelerator label,
141    * or <tt>0</tt>.
142    */
143   const Widget* get_accel_widget() const;
144
145   
146   /** Gets the width needed to display this accelerator label. This is used by menus to align all of the Gtk::MenuItem widgets, and shouldn't be needed by applications.
147    * @return Width of this accelerator label.
148    */
149   guint get_accel_width() const;
150   
151   /** Recreates the string representing the accelerator keys.
152    * @return Always returns <tt>false</tt>.
153    */
154   bool refetch();
155
156   //_WRAP_PROPERTY("accel-closure", Glib::Object) //GClosure
157   #ifdef GLIBMM_PROPERTIES_ENABLED
158 /** The widget to be monitored for accelerator changes.
159    *
160    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
161    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
162    * the value of the property changes.
163    */
164   Glib::PropertyProxy<Gtk::Widget*> property_accel_widget() ;
165 #endif //#GLIBMM_PROPERTIES_ENABLED
166
167 #ifdef GLIBMM_PROPERTIES_ENABLED
168 /** The widget to be monitored for accelerator changes.
169    *
170    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
171    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
172    * the value of the property changes.
173    */
174   Glib::PropertyProxy_ReadOnly<Gtk::Widget*> property_accel_widget() const;
175 #endif //#GLIBMM_PROPERTIES_ENABLED
176
177
178 };
179
180 } /* namespace Gtk */
181
182
183 namespace Glib
184 {
185   /** A Glib::wrap() method for this object.
186    * 
187    * @param object The C instance.
188    * @param take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref.
189    * @result A C++ instance that wraps this C instance.
190    *
191    * @relates Gtk::AccelLabel
192    */
193   Gtk::AccelLabel* wrap(GtkAccelLabel* object, bool take_copy = false);
194 } //namespace Glib
195
196
197 #endif /* _GTKMM_ACCELLABEL_H */
198