Install ardour as a binary, a script and a set of shared
[ardour.git] / libs / gtkmm2 / gtk / gtkmm / range.h
1 // -*- c++ -*-
2 // Generated by gtkmmproc -- DO NOT MODIFY!
3 #ifndef _GTKMM_RANGE_H
4 #define _GTKMM_RANGE_H
5
6 #include <glibmm.h>
7
8 /* $Id$ */
9
10 /* Copyright (C) 1998-2002 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
29
30 #ifndef DOXYGEN_SHOULD_SKIP_THIS
31 typedef struct _GtkRange GtkRange;
32 typedef struct _GtkRangeClass GtkRangeClass;
33 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
34
35
36 namespace Gtk
37 { class Range_Class; } // namespace Gtk
38 namespace Gtk
39 {
40
41 class Adjustment;
42
43 /** Base class for widgets which visualize an adjustment.
44  *
45  * @ingroup Widgets
46  */
47
48 class Range : public Widget
49 {
50   public:
51 #ifndef DOXYGEN_SHOULD_SKIP_THIS
52   typedef Range CppObjectType;
53   typedef Range_Class CppClassType;
54   typedef GtkRange BaseObjectType;
55   typedef GtkRangeClass BaseClassType;
56 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
57
58   virtual ~Range();
59
60 #ifndef DOXYGEN_SHOULD_SKIP_THIS
61
62 private:
63   friend class Range_Class;
64   static CppClassType range_class_;
65
66   // noncopyable
67   Range(const Range&);
68   Range& operator=(const Range&);
69
70 protected:
71   explicit Range(const Glib::ConstructParams& construct_params);
72   explicit Range(GtkRange* castitem);
73
74 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
75
76 public:
77 #ifndef DOXYGEN_SHOULD_SKIP_THIS
78   static GType get_type()      G_GNUC_CONST;
79   static GType get_base_type() G_GNUC_CONST;
80 #endif
81
82   ///Provides access to the underlying C GtkObject.
83   GtkRange*       gobj()       { return reinterpret_cast<GtkRange*>(gobject_); }
84
85   ///Provides access to the underlying C GtkObject.
86   const GtkRange* gobj() const { return reinterpret_cast<GtkRange*>(gobject_); }
87
88
89 public:
90   //C++ methods used to invoke GTK+ virtual functions:
91
92 protected:
93   //GTK+ Virtual Functions (override these to change behaviour):
94
95   //Default Signal Handlers::
96   virtual void on_value_changed();
97   virtual void on_adjust_bounds(double new_value);
98   virtual void on_move_slider(ScrollType scroll);
99
100
101 private:
102
103 protected:
104   Range();
105 public:
106   
107
108   /** Sets the update policy for the range. Gtk::UPDATE_CONTINUOUS means that
109    * anytime the range slider is moved, the range value will change and the
110    * value_changed signal will be emitted. Gtk::UPDATE_DELAYED means that
111    * the value will be updated after a brief timeout where no slider motion
112    * occurs, so updates are spaced by a short time rather than
113    * continuous. Gtk::UPDATE_DISCONTINUOUS means that the value will only
114    * be updated when the user releases the button and ends the slider
115    * drag operation.
116    * @param policy Update policy.
117    */
118   void set_update_policy(UpdateType policy);
119   
120   /** Gets the update policy of @a range . See set_update_policy().
121    * @return The current update policy.
122    */
123   UpdateType get_update_policy() const;
124   
125   /** Sets the adjustment to be used as the "model" object for this range
126    * widget. The adjustment indicates the current range value, the
127    * minimum and maximum range values, the step/page increments used
128    * for keybindings and scrolling, and the page size. The page size
129    * is normally 0 for Gtk::Scale and nonzero for Gtk::Scrollbar, and
130    * indicates the size of the visible area of the widget being scrolled.
131    * The page size affects the size of the scrollbar slider.
132    * @param adjustment A Gtk::Adjustment.
133    */
134   void set_adjustment(Gtk::Adjustment& adjustment);
135   void unset_adjustment();
136
137   
138   /** Get the Gtk::Adjustment which is the "model" object for Gtk::Range.
139    * See set_adjustment() for details.
140    * The return value does not have a reference added, so should not
141    * be unreferenced.
142    * @return A Gtk::Adjustment.
143    */
144   Gtk::Adjustment* get_adjustment();
145   
146   /** Get the Gtk::Adjustment which is the "model" object for Gtk::Range.
147    * See set_adjustment() for details.
148    * The return value does not have a reference added, so should not
149    * be unreferenced.
150    * @return A Gtk::Adjustment.
151    */
152   const Gtk::Adjustment* get_adjustment() const;
153   
154   /** Ranges normally move from lower to higher values as the
155    * slider moves from top to bottom or left to right. Inverted
156    * ranges have higher values at the top or on the right rather than
157    * on the bottom or left.
158    * @param setting <tt>true</tt> to invert the range.
159    */
160   void set_inverted(bool setting = true);
161   
162   /** Gets the value set by set_inverted().
163    * @return <tt>true</tt> if the range is inverted.
164    */
165   bool get_inverted() const;
166   
167   /** Sets the step and page sizes for the range.
168    * The step size is used when the user clicks the Gtk::Scrollbar
169    * arrows or moves Gtk::Scale via arrow keys. The page size
170    * is used for example when moving via Page Up or Page Down keys.
171    * @param step Step size.
172    * @param page Page size.
173    */
174   void set_increments(double step, double  page);
175   
176   /** Sets the allowable values in the Gtk::Range, and clamps the range
177    * value to be between @a min  and @a max . (If the range has a non-zero
178    * page size, it is clamped between @a min  and @a max  - page-size.)
179    * @param min Minimum range value.
180    * @param max Maximum range value.
181    */
182   void set_range(double min, double max);
183   
184   /** Sets the current value of the range; if the value is outside the
185    * minimum or maximum range values, it will be clamped to fit inside
186    * them. The range emits the "value_changed" signal if the value
187    * changes.
188    * @param value New value of the range.
189    */
190   void set_value(double value);
191   
192   /** Gets the current value of the range.
193    * @return Current value of the range.
194    */
195   double get_value() const;
196
197   
198   Glib::SignalProxy0< void > signal_value_changed();
199
200   
201   Glib::SignalProxy1< void,double > signal_adjust_bounds();
202
203   
204   Glib::SignalProxy1< void,ScrollType > signal_move_slider();
205
206   
207   //We use no_default_handler for this, because we can not add a new vfunc to 2.5 without breaking ABI.
208   //TODO: Remove no_default_handler when we do an ABI-break-with-parallel-install.
209   
210
211   Glib::SignalProxy2< bool,ScrollType,double > signal_change_value();
212
213
214   /** How the range should be updated on the screen.
215    *
216    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
217    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
218    * the value of the property changes.
219    */
220   Glib::PropertyProxy<UpdateType> property_update_policy() ;
221
222 /** How the range should be updated on the screen.
223    *
224    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
225    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
226    * the value of the property changes.
227    */
228   Glib::PropertyProxy_ReadOnly<UpdateType> property_update_policy() const;
229
230   /** The GtkAdjustment that contains the current value of this range object.
231    *
232    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
233    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
234    * the value of the property changes.
235    */
236   Glib::PropertyProxy<Adjustment*> property_adjustment() ;
237
238 /** The GtkAdjustment that contains the current value of this range object.
239    *
240    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
241    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
242    * the value of the property changes.
243    */
244   Glib::PropertyProxy_ReadOnly<Adjustment*> property_adjustment() const;
245
246   /** Invert direction slider moves to increase range value.
247    *
248    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
249    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
250    * the value of the property changes.
251    */
252   Glib::PropertyProxy<bool> property_inverted() ;
253
254 /** Invert direction slider moves to increase range value.
255    *
256    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
257    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
258    * the value of the property changes.
259    */
260   Glib::PropertyProxy_ReadOnly<bool> property_inverted() const;
261
262   
263 protected:
264     virtual void get_range_border_vfunc(GtkBorder* border) const;
265
266
267 };
268
269 } // namespace Gtk
270
271
272 namespace Glib
273 {
274   /** @relates Gtk::Range
275    * @param object The C instance
276    * @param take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref.
277    * @result A C++ instance that wraps this C instance.
278    */
279   Gtk::Range* wrap(GtkRange* object, bool take_copy = false);
280 }
281 #endif /* _GTKMM_RANGE_H */
282