Install ardour as a binary, a script and a set of shared
[ardour.git] / libs / gtkmm2 / gtk / gtkmm / ruler.h
1 // -*- c++ -*-
2 // Generated by gtkmmproc -- DO NOT MODIFY!
3 #ifndef _GTKMM_RULER_H
4 #define _GTKMM_RULER_H
5
6 #include <glibmm.h>
7
8 /* $Id$ */
9
10 /* ruler.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/widget.h>
30
31
32 #ifndef DOXYGEN_SHOULD_SKIP_THIS
33 typedef struct _GtkRuler GtkRuler;
34 typedef struct _GtkRulerClass GtkRulerClass;
35 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
36
37
38 namespace Gtk
39 { class Ruler_Class; } // namespace Gtk
40 #ifndef DOXYGEN_SHOULD_SKIP_THIS
41 typedef struct _GtkVRuler GtkVRuler;
42 typedef struct _GtkVRulerClass GtkVRulerClass;
43 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
44
45
46 namespace Gtk
47 { class VRuler_Class; } // namespace Gtk
48 #ifndef DOXYGEN_SHOULD_SKIP_THIS
49 typedef struct _GtkHRuler GtkHRuler;
50 typedef struct _GtkHRulerClass GtkHRulerClass;
51 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
52
53
54 namespace Gtk
55 { class HRuler_Class; } // namespace Gtk
56 namespace Gtk
57 {
58
59 /** Base class for horizontal or vertical rulers.
60  *
61  * NOTE this widget is considered too specialized/little-used for GTK+, and will in the future be moved to some other package. If your application needs this widget, feel free to use it, as the widget does work and is useful in some applications; it's just not of general interest. However, we are not accepting new features for the widget, and it will eventually move out of the GTK+ distribution.
62  * Rulers are used to show the mouse pointer's location in a window. The ruler can either be horizontal or vertical. Within the ruler a small triangle indicates the location of the mouse relative to the horixontal or vertical ruler.
63
64  * This is an abstract base for Gtk::HRuler and
65  * Gtk::VRuler.  Users should only instantiate those types.
66  *
67  * @ingroup Widgets
68  */
69
70 class Ruler : public Widget
71 {
72   public:
73 #ifndef DOXYGEN_SHOULD_SKIP_THIS
74   typedef Ruler CppObjectType;
75   typedef Ruler_Class CppClassType;
76   typedef GtkRuler BaseObjectType;
77   typedef GtkRulerClass BaseClassType;
78 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
79
80   virtual ~Ruler();
81
82 #ifndef DOXYGEN_SHOULD_SKIP_THIS
83
84 private:
85   friend class Ruler_Class;
86   static CppClassType ruler_class_;
87
88   // noncopyable
89   Ruler(const Ruler&);
90   Ruler& operator=(const Ruler&);
91
92 protected:
93   explicit Ruler(const Glib::ConstructParams& construct_params);
94   explicit Ruler(GtkRuler* castitem);
95
96 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
97
98 public:
99 #ifndef DOXYGEN_SHOULD_SKIP_THIS
100   static GType get_type()      G_GNUC_CONST;
101   static GType get_base_type() G_GNUC_CONST;
102 #endif
103
104   ///Provides access to the underlying C GtkObject.
105   GtkRuler*       gobj()       { return reinterpret_cast<GtkRuler*>(gobject_); }
106
107   ///Provides access to the underlying C GtkObject.
108   const GtkRuler* gobj() const { return reinterpret_cast<GtkRuler*>(gobject_); }
109
110
111 public:
112   //C++ methods used to invoke GTK+ virtual functions:
113
114 protected:
115   //GTK+ Virtual Functions (override these to change behaviour):
116
117   //Default Signal Handlers::
118
119
120 private:
121
122 protected:
123   Ruler();
124
125 public:
126   
127
128   MetricType get_metric() const; 
129
130   /** Sets the desired metric of the ruler.  The possible choices are:
131    * <ul><li>Gtk::PIXELS
132    * <li>Gtk::INCHES
133    * <li>Gtk::CENTIMETERS
134    * </ul>The default metric is Gtk::PIXELS.
135    */
136   
137   void set_metric(MetricType metric = PIXELS);
138   
139   /** Gets the units used for a Gtk::Ruler. See set_metric().
140    * @return The units currently used for @a ruler .
141    */
142   MetricType get_metric();
143
144   double get_range_lower() const;
145   double get_range_upper() const;
146
147   /** sets the range of the ruler.
148    * <i>upper</i> and <i>lower</i> arguments denote the extents of the Ruler.
149    * <i>max_size</i> is the largest number displayed by the ruler.
150    * <i>position</i> gives the initial value of the ruler.
151    * Rulers do not have sane defaults so this function should always be called.
152    */
153   
154   void set_range(double lower, double upper, double position, double max_size);
155   
156   /** Retrieves values indicating the range and current position of a Gtk::Ruler.
157    * See set_range().
158    * @param lower Location to store lower limit of the ruler, or <tt>0</tt>.
159    * @param upper Location to store upper limit of the ruler, or <tt>0</tt>.
160    * @param position Location to store the current position of the mark on the ruler, or <tt>0</tt>.
161    * @param max_size Location to store the maximum size of the ruler used when calculating
162    * the space to leave for the text, or <tt>0</tt>.
163    */
164   void get_range(double& lower, double& upper, double& position, double& max_size);
165
166   /// draw tick marks on the ruler
167   
168   void draw_ticks();
169
170   /// draw a position indicator on the ruler
171   
172   void draw_pos();
173
174     virtual void draw_ticks_vfunc();
175     virtual void draw_pos_vfunc();
176
177   /** Lower limit of ruler.
178    *
179    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
180    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
181    * the value of the property changes.
182    */
183   Glib::PropertyProxy<double> property_lower() ;
184
185 /** Lower limit of ruler.
186    *
187    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
188    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
189    * the value of the property changes.
190    */
191   Glib::PropertyProxy_ReadOnly<double> property_lower() const;
192
193   /** Upper limit of ruler.
194    *
195    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
196    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
197    * the value of the property changes.
198    */
199   Glib::PropertyProxy<double> property_upper() ;
200
201 /** Upper limit of ruler.
202    *
203    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
204    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
205    * the value of the property changes.
206    */
207   Glib::PropertyProxy_ReadOnly<double> property_upper() const;
208
209   /** Position of mark on the ruler.
210    *
211    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
212    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
213    * the value of the property changes.
214    */
215   Glib::PropertyProxy<double> property_position() ;
216
217 /** Position of mark on the ruler.
218    *
219    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
220    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
221    * the value of the property changes.
222    */
223   Glib::PropertyProxy_ReadOnly<double> property_position() const;
224
225   /** Maximum size of the ruler.
226    *
227    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
228    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
229    * the value of the property changes.
230    */
231   Glib::PropertyProxy<double> property_max_size() ;
232
233 /** Maximum size of the ruler.
234    *
235    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
236    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
237    * the value of the property changes.
238    */
239   Glib::PropertyProxy_ReadOnly<double> property_max_size() const;
240
241
242 };
243
244
245 /** Vertical Ruler
246  *
247  * @ingroup Widgets
248  */
249
250 class VRuler : public Ruler
251 {
252   public:
253 #ifndef DOXYGEN_SHOULD_SKIP_THIS
254   typedef VRuler CppObjectType;
255   typedef VRuler_Class CppClassType;
256   typedef GtkVRuler BaseObjectType;
257   typedef GtkVRulerClass BaseClassType;
258 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
259
260   virtual ~VRuler();
261
262 #ifndef DOXYGEN_SHOULD_SKIP_THIS
263
264 private:
265   friend class VRuler_Class;
266   static CppClassType vruler_class_;
267
268   // noncopyable
269   VRuler(const VRuler&);
270   VRuler& operator=(const VRuler&);
271
272 protected:
273   explicit VRuler(const Glib::ConstructParams& construct_params);
274   explicit VRuler(GtkVRuler* castitem);
275
276 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
277
278 public:
279 #ifndef DOXYGEN_SHOULD_SKIP_THIS
280   static GType get_type()      G_GNUC_CONST;
281   static GType get_base_type() G_GNUC_CONST;
282 #endif
283
284   ///Provides access to the underlying C GtkObject.
285   GtkVRuler*       gobj()       { return reinterpret_cast<GtkVRuler*>(gobject_); }
286
287   ///Provides access to the underlying C GtkObject.
288   const GtkVRuler* gobj() const { return reinterpret_cast<GtkVRuler*>(gobject_); }
289
290
291 public:
292   //C++ methods used to invoke GTK+ virtual functions:
293
294 protected:
295   //GTK+ Virtual Functions (override these to change behaviour):
296
297   //Default Signal Handlers::
298
299
300 private:
301
302 public:
303   VRuler();
304   
305
306 };
307
308
309 /** Horizontal Ruler
310  *
311  * @ingroup Widgets
312  */
313
314 class HRuler : public Ruler
315 {
316   public:
317 #ifndef DOXYGEN_SHOULD_SKIP_THIS
318   typedef HRuler CppObjectType;
319   typedef HRuler_Class CppClassType;
320   typedef GtkHRuler BaseObjectType;
321   typedef GtkHRulerClass BaseClassType;
322 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
323
324   virtual ~HRuler();
325
326 #ifndef DOXYGEN_SHOULD_SKIP_THIS
327
328 private:
329   friend class HRuler_Class;
330   static CppClassType hruler_class_;
331
332   // noncopyable
333   HRuler(const HRuler&);
334   HRuler& operator=(const HRuler&);
335
336 protected:
337   explicit HRuler(const Glib::ConstructParams& construct_params);
338   explicit HRuler(GtkHRuler* castitem);
339
340 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
341
342 public:
343 #ifndef DOXYGEN_SHOULD_SKIP_THIS
344   static GType get_type()      G_GNUC_CONST;
345   static GType get_base_type() G_GNUC_CONST;
346 #endif
347
348   ///Provides access to the underlying C GtkObject.
349   GtkHRuler*       gobj()       { return reinterpret_cast<GtkHRuler*>(gobject_); }
350
351   ///Provides access to the underlying C GtkObject.
352   const GtkHRuler* gobj() const { return reinterpret_cast<GtkHRuler*>(gobject_); }
353
354
355 public:
356   //C++ methods used to invoke GTK+ virtual functions:
357
358 protected:
359   //GTK+ Virtual Functions (override these to change behaviour):
360
361   //Default Signal Handlers::
362
363
364 private:
365
366 public:
367   HRuler();
368   
369
370 };
371
372 } /* namespace Gtk */
373
374
375 namespace Glib
376 {
377   /** @relates Gtk::Ruler
378    * @param object The C instance
379    * @param take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref.
380    * @result A C++ instance that wraps this C instance.
381    */
382   Gtk::Ruler* wrap(GtkRuler* object, bool take_copy = false);
383 }
384 namespace Glib
385 {
386   /** @relates Gtk::VRuler
387    * @param object The C instance
388    * @param take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref.
389    * @result A C++ instance that wraps this C instance.
390    */
391   Gtk::VRuler* wrap(GtkVRuler* object, bool take_copy = false);
392 }
393 namespace Glib
394 {
395   /** @relates Gtk::HRuler
396    * @param object The C instance
397    * @param take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref.
398    * @result A C++ instance that wraps this C instance.
399    */
400   Gtk::HRuler* wrap(GtkHRuler* object, bool take_copy = false);
401 }
402 #endif /* _GTKMM_RULER_H */
403