Install ardour as a binary, a script and a set of shared
[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 #include <glibmm.h>
7
8 /* $Id$ */
9
10 /* accellabel.h
11  * 
12  * Copyright (C) 1998-2002 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 Library General Public
16  * License as published by the Free Software Foundation; either
17  * version 2 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  * Library General Public License for more details.
23  *
24  * You should have received a copy of the GNU Library 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 #include <gtkmm/label.h>
30
31
32 #ifndef DOXYGEN_SHOULD_SKIP_THIS
33 typedef struct _GtkAccelLabel GtkAccelLabel;
34 typedef struct _GtkAccelLabelClass GtkAccelLabelClass;
35 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
36
37
38 namespace Gtk
39 { class AccelLabel_Class; } // namespace Gtk
40 namespace Gtk
41 {
42
43 /** A label which displays an accelerator key on the right of the text.
44  * Used for menu item labels, for instance.
45  *
46  * @ingroup Widgets
47  */
48
49 class AccelLabel : public Label
50 {
51   public:
52 #ifndef DOXYGEN_SHOULD_SKIP_THIS
53   typedef AccelLabel CppObjectType;
54   typedef AccelLabel_Class CppClassType;
55   typedef GtkAccelLabel BaseObjectType;
56   typedef GtkAccelLabelClass BaseClassType;
57 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
58
59   virtual ~AccelLabel();
60
61 #ifndef DOXYGEN_SHOULD_SKIP_THIS
62
63 private:
64   friend class AccelLabel_Class;
65   static CppClassType accellabel_class_;
66
67   // noncopyable
68   AccelLabel(const AccelLabel&);
69   AccelLabel& operator=(const AccelLabel&);
70
71 protected:
72   explicit AccelLabel(const Glib::ConstructParams& construct_params);
73   explicit AccelLabel(GtkAccelLabel* castitem);
74
75 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
76
77 public:
78 #ifndef DOXYGEN_SHOULD_SKIP_THIS
79   static GType get_type()      G_GNUC_CONST;
80   static GType get_base_type() G_GNUC_CONST;
81 #endif
82
83   ///Provides access to the underlying C GtkObject.
84   GtkAccelLabel*       gobj()       { return reinterpret_cast<GtkAccelLabel*>(gobject_); }
85
86   ///Provides access to the underlying C GtkObject.
87   const GtkAccelLabel* gobj() const { return reinterpret_cast<GtkAccelLabel*>(gobject_); }
88
89
90 public:
91   //C++ methods used to invoke GTK+ virtual functions:
92
93 protected:
94   //GTK+ Virtual Functions (override these to change behaviour):
95
96   //Default Signal Handlers::
97
98
99 private:
100
101   
102 public:
103
104   //The default ctor doesn't correspond to any _new function, but gtkmenuitem.cc does a simple g_object_new() with no properties.
105   /** Default constructor to create an AccelLabel object
106    */
107   AccelLabel();
108
109   /** Constructor to create an AccelLabel object with a default label
110    * @param label The label string.
111    * @param mnemonic If true, characters preceded by an underscore (_) will be underlined and used as a keyboard accelerator.
112    */
113   explicit AccelLabel(const Glib::ustring& label, bool mnemonic = false);
114
115   
116   /** Sets the widget to be monitored by this accelerator label.
117    * @param accel_widget The widget to be monitored.
118    */
119   void set_accel_widget(const Widget& accel_widget);
120   /// Forget the accel widget previously set by set_accel_widget().
121   void unset_accel_widget();
122
123   
124   /** Fetches the widget monitored by this accelerator label. See
125    * set_accel_widget().
126    * @return The object monitored by the accelerator label,
127    * or <tt>0</tt>.
128    */
129   Widget* get_accel_widget();
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   const Widget* get_accel_widget() const;
137
138   
139   /** 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.
140    * @return Width of this accelerator label.
141    */
142   guint get_accel_width() const;
143   
144   /** Recreates the string representing the accelerator keys.
145    * @return Always returns <tt>false</tt>.
146    */
147   bool refetch();
148
149   //_WRAP_PROPERTY("accel-closure", Glib::Object) //GClosure
150   /** The widget to be monitored for accelerator changes.
151    *
152    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
153    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
154    * the value of the property changes.
155    */
156   Glib::PropertyProxy<Gtk::Widget*> property_accel_widget() ;
157
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_ReadOnly<Gtk::Widget*> property_accel_widget() const;
165
166
167 };
168
169 } /* namespace Gtk */
170
171
172 namespace Glib
173 {
174   /** @relates Gtk::AccelLabel
175    * @param object The C instance
176    * @param take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref.
177    * @result A C++ instance that wraps this C instance.
178    */
179   Gtk::AccelLabel* wrap(GtkAccelLabel* object, bool take_copy = false);
180 }
181 #endif /* _GTKMM_ACCELLABEL_H */
182