Merged revisions 6293,6296-6306,6308 via svnmerge from
[ardour.git] / libs / gtkmm2 / gtk / gtkmm / scrolledwindow.h
1 // -*- c++ -*-
2 // Generated by gtkmmproc -- DO NOT MODIFY!
3 #ifndef _GTKMM_SCROLLEDWINDOW_H
4 #define _GTKMM_SCROLLEDWINDOW_H
5
6
7 #include <glibmm.h>
8
9 /* $Id$ */
10
11 /* scrolledwindow.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/bin.h>
31
32
33 #ifndef DOXYGEN_SHOULD_SKIP_THIS
34 typedef struct _GtkScrolledWindow GtkScrolledWindow;
35 typedef struct _GtkScrolledWindowClass GtkScrolledWindowClass;
36 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
37
38
39 namespace Gtk
40 { class ScrolledWindow_Class; } // namespace Gtk
41 namespace Gtk
42 {
43
44 class Adjustment;
45 class HScrollbar;
46 class VScrollbar;
47
48 /** Adds scrollbars to its child widget.
49  *
50  * This container accepts a single child widget. It adds scrollbars to the child widget and optionally draws a beveled frame around the child widget.
51  * The scrolled window can work in two ways:
52  * 1) Some widgets have native scrolling support; these widgets handle certain Gtk::Adjustment signals. Widgets with native scroll support include Gtk::TreeView, Gtk::TextView, and Gtk::Layout.
53  * 2) For widgets that lack native scrolling support, such as Gtk::Table, Gtk::Box, and so on, the widget will be placed inside a Gtk::Viewport.
54  *
55  * The position of the scrollbars is controlled by the scroll adjustments. See Gtk::Adjustment for the fields in an adjustment - for Gtk::Scrollbar, used by Gtk::ScrolledWindow,
56  * the "value" field represents the position of the scrollbar, which must be between the "lower" field and "upper - page_size."
57  * The "page_size" field represents the size of the visible scrollable area.
58  * The "step_increment" and "page_increment" fields are used when the user asks to step down (using the small stepper arrows) or page down (using for example the PageDown key).
59  *
60  * If a Gtk::ScrolledWindow doesn't behave quite as you would like, or doesn't have exactly the right layout, it's very possible to set up your own scrolling with Gtk::Scrollbar and, for example, a Gtk::Table.
61  *
62  * @ingroup Widgets
63  * @ingroup Containers
64  */
65
66 class ScrolledWindow : public Bin
67 {
68   public:
69 #ifndef DOXYGEN_SHOULD_SKIP_THIS
70   typedef ScrolledWindow CppObjectType;
71   typedef ScrolledWindow_Class CppClassType;
72   typedef GtkScrolledWindow BaseObjectType;
73   typedef GtkScrolledWindowClass BaseClassType;
74 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
75
76   virtual ~ScrolledWindow();
77
78 #ifndef DOXYGEN_SHOULD_SKIP_THIS
79
80 private:
81   friend class ScrolledWindow_Class;
82   static CppClassType scrolledwindow_class_;
83
84   // noncopyable
85   ScrolledWindow(const ScrolledWindow&);
86   ScrolledWindow& operator=(const ScrolledWindow&);
87
88 protected:
89   explicit ScrolledWindow(const Glib::ConstructParams& construct_params);
90   explicit ScrolledWindow(GtkScrolledWindow* castitem);
91
92 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
93
94 public:
95 #ifndef DOXYGEN_SHOULD_SKIP_THIS
96   static GType get_type()      G_GNUC_CONST;
97   static GType get_base_type() G_GNUC_CONST;
98 #endif
99
100   ///Provides access to the underlying C GtkObject.
101   GtkScrolledWindow*       gobj()       { return reinterpret_cast<GtkScrolledWindow*>(gobject_); }
102
103   ///Provides access to the underlying C GtkObject.
104   const GtkScrolledWindow* gobj() const { return reinterpret_cast<GtkScrolledWindow*>(gobject_); }
105
106
107 public:
108   //C++ methods used to invoke GTK+ virtual functions:
109 #ifdef GLIBMM_VFUNCS_ENABLED
110 #endif //GLIBMM_VFUNCS_ENABLED
111
112 protected:
113   //GTK+ Virtual Functions (override these to change behaviour):
114 #ifdef GLIBMM_VFUNCS_ENABLED
115 #endif //GLIBMM_VFUNCS_ENABLED
116
117   //Default Signal Handlers::
118 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
119 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
120
121
122 private:
123
124
125 public:
126   ScrolledWindow();
127   explicit ScrolledWindow(Adjustment& hadjustment, Adjustment& vadjustment);
128   
129
130   void set_hadjustment(Gtk::Adjustment* hadjustment = 0);
131   
132   void set_vadjustment(Gtk::Adjustment* vadjustment = 0);
133   
134   void set_hadjustment(Gtk::Adjustment& hadjustment);
135   
136   void set_vadjustment(Gtk::Adjustment& vadjustment);
137
138   
139   Gtk::Adjustment* get_hadjustment();
140   
141   const Gtk::Adjustment* get_hadjustment() const;
142   
143   Gtk::Adjustment* get_vadjustment();
144   
145   const Gtk::Adjustment* get_vadjustment() const;
146
147   
148   void set_policy(PolicyType hscrollbar_policy, PolicyType vscrollbar_policy);
149   
150   /** Retrieves the current policy values for the horizontal and vertical
151    * scrollbars. See set_policy().
152    * @param hscrollbar_policy Location to store the policy for the horizontal scrollbar, or <tt>0</tt>.
153    * @param vscrollbar_policy Location to store the policy for the horizontal scrollbar, or <tt>0</tt>.
154    */
155   void get_policy(PolicyType& hscrollbar_policy, PolicyType& vscrollbar_policy) const;
156
157   
158   /** Sets the placement of the contents with respect to the scrollbars
159    * for the scrolled window.
160    * The default is Gtk::CORNER_TOP_LEFT, meaning the child is
161    * in the top left, with the scrollbars underneath and to the right.
162    * Other values in Gtk::CornerType are Gtk::CORNER_TOP_RIGHT,
163    * Gtk::CORNER_BOTTOM_LEFT, and Gtk::CORNER_BOTTOM_RIGHT.
164    * 
165    * See also get_placement() and
166    * unset_placement().
167    * @param window_placement Position of the child window.
168    */
169   void set_placement(CornerType window_placement);
170   
171   /** Unsets the placement of the contents with respect to the scrollbars
172    * for the scrolled window. If no window placement is set for a scrolled
173    * window, it obeys the "gtk-scrolled-window-placement" XSETTING.
174    * 
175    * See also set_placement() and
176    * get_placement().
177    * 
178    * @newin2p10
179    */
180   void unset_placement();
181   
182   /** Gets the placement of the contents with respect to the scrollbars
183    * for the scrolled window. See set_placement().
184    * @return The current placement value.
185    * 
186    * See also set_placement() and
187    * unset_placement().
188    */
189   CornerType get_placement() const;
190
191   
192   /** Changes the type of shadow drawn around the contents of
193    *  @a scrolled_window .
194    * @param type Kind of shadow to draw around scrolled window contents.
195    */
196   void set_shadow_type(ShadowType type);
197   
198   /** Gets the shadow type of the scrolled window. See 
199    * set_shadow_type().
200    * @return The current shadow type.
201    */
202   ShadowType get_shadow_type() const;
203
204   ///Puts the child inside a Gtk::Viewport if it doesn't have native scrolling capability.
205   virtual void add(Gtk::Widget& widget);
206   
207
208   /** Returns: the vertical scrollbar of the scrolled window, or
209    * @return The vertical scrollbar of the scrolled window, or
210    * <tt>0</tt> if it does not have one.
211    * 
212    * @newin2p8.
213    */
214   VScrollbar* get_vscrollbar();
215   
216   /** Returns: the vertical scrollbar of the scrolled window, or
217    * @return The vertical scrollbar of the scrolled window, or
218    * <tt>0</tt> if it does not have one.
219    * 
220    * @newin2p8.
221    */
222   const VScrollbar* get_vscrollbar() const;
223
224   
225   /** Returns: the horizontal scrollbar of the scrolled window, or
226    * @return The horizontal scrollbar of the scrolled window, or 
227    * <tt>0</tt> if it does not have one.
228    * 
229    * @newin2p8.
230    */
231   HScrollbar* get_hscrollbar();
232   
233   /** Returns: the horizontal scrollbar of the scrolled window, or
234    * @return The horizontal scrollbar of the scrolled window, or 
235    * <tt>0</tt> if it does not have one.
236    * 
237    * @newin2p8.
238    */
239   const HScrollbar* get_hscrollbar() const;
240
241    bool get_vscrollbar_visible() const;
242     bool get_hscrollbar_visible() const;
243  
244   //Keybinding signals:
245   
246   
247   #ifdef GLIBMM_PROPERTIES_ENABLED
248 /** The GtkAdjustment for the horizontal position.
249    *
250    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
251    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
252    * the value of the property changes.
253    */
254   Glib::PropertyProxy<Gtk::Adjustment*> property_hadjustment() ;
255 #endif //#GLIBMM_PROPERTIES_ENABLED
256
257 #ifdef GLIBMM_PROPERTIES_ENABLED
258 /** The GtkAdjustment for the horizontal position.
259    *
260    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
261    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
262    * the value of the property changes.
263    */
264   Glib::PropertyProxy_ReadOnly<Gtk::Adjustment*> property_hadjustment() const;
265 #endif //#GLIBMM_PROPERTIES_ENABLED
266
267   #ifdef GLIBMM_PROPERTIES_ENABLED
268 /** The GtkAdjustment for the vertical position.
269    *
270    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
271    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
272    * the value of the property changes.
273    */
274   Glib::PropertyProxy<Gtk::Adjustment*> property_vadjustment() ;
275 #endif //#GLIBMM_PROPERTIES_ENABLED
276
277 #ifdef GLIBMM_PROPERTIES_ENABLED
278 /** The GtkAdjustment for the vertical position.
279    *
280    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
281    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
282    * the value of the property changes.
283    */
284   Glib::PropertyProxy_ReadOnly<Gtk::Adjustment*> property_vadjustment() const;
285 #endif //#GLIBMM_PROPERTIES_ENABLED
286
287   #ifdef GLIBMM_PROPERTIES_ENABLED
288 /** When the horizontal scrollbar is displayed.
289    *
290    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
291    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
292    * the value of the property changes.
293    */
294   Glib::PropertyProxy<PolicyType> property_hscrollbar_policy() ;
295 #endif //#GLIBMM_PROPERTIES_ENABLED
296
297 #ifdef GLIBMM_PROPERTIES_ENABLED
298 /** When the horizontal scrollbar is displayed.
299    *
300    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
301    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
302    * the value of the property changes.
303    */
304   Glib::PropertyProxy_ReadOnly<PolicyType> property_hscrollbar_policy() const;
305 #endif //#GLIBMM_PROPERTIES_ENABLED
306
307   #ifdef GLIBMM_PROPERTIES_ENABLED
308 /** When the vertical scrollbar is displayed.
309    *
310    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
311    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
312    * the value of the property changes.
313    */
314   Glib::PropertyProxy<PolicyType> property_vscrollbar_policy() ;
315 #endif //#GLIBMM_PROPERTIES_ENABLED
316
317 #ifdef GLIBMM_PROPERTIES_ENABLED
318 /** When the vertical scrollbar is displayed.
319    *
320    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
321    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
322    * the value of the property changes.
323    */
324   Glib::PropertyProxy_ReadOnly<PolicyType> property_vscrollbar_policy() const;
325 #endif //#GLIBMM_PROPERTIES_ENABLED
326
327   #ifdef GLIBMM_PROPERTIES_ENABLED
328 /** Where the contents are located with respect to the scrollbars. This property only takes effect if window-placement-set is TRUE.
329    *
330    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
331    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
332    * the value of the property changes.
333    */
334   Glib::PropertyProxy<CornerType> property_window_placement() ;
335 #endif //#GLIBMM_PROPERTIES_ENABLED
336
337 #ifdef GLIBMM_PROPERTIES_ENABLED
338 /** Where the contents are located with respect to the scrollbars. This property only takes effect if window-placement-set is TRUE.
339    *
340    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
341    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
342    * the value of the property changes.
343    */
344   Glib::PropertyProxy_ReadOnly<CornerType> property_window_placement() const;
345 #endif //#GLIBMM_PROPERTIES_ENABLED
346
347   #ifdef GLIBMM_PROPERTIES_ENABLED
348 /** Style of bevel around the contents.
349    *
350    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
351    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
352    * the value of the property changes.
353    */
354   Glib::PropertyProxy<ShadowType> property_shadow_type() ;
355 #endif //#GLIBMM_PROPERTIES_ENABLED
356
357 #ifdef GLIBMM_PROPERTIES_ENABLED
358 /** Style of bevel around the contents.
359    *
360    * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
361    * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
362    * the value of the property changes.
363    */
364   Glib::PropertyProxy_ReadOnly<ShadowType> property_shadow_type() const;
365 #endif //#GLIBMM_PROPERTIES_ENABLED
366
367
368 };
369
370 } /* namespace Gtk */
371
372
373 namespace Glib
374 {
375   /** A Glib::wrap() method for this object.
376    * 
377    * @param object The C instance.
378    * @param take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref.
379    * @result A C++ instance that wraps this C instance.
380    *
381    * @relates Gtk::ScrolledWindow
382    */
383   Gtk::ScrolledWindow* wrap(GtkScrolledWindow* object, bool take_copy = false);
384 } //namespace Glib
385
386
387 #endif /* _GTKMM_SCROLLEDWINDOW_H */
388