add new sigc++2 directory
[ardour.git] / libs / gtkmm2 / pango / pangomm / tabarray.h
1 // -*- c++ -*-
2 // Generated by gtkmmproc -- DO NOT MODIFY!
3 #ifndef _PANGOMM_TABARRAY_H
4 #define _PANGOMM_TABARRAY_H
5
6
7 #include <glibmm.h>
8
9 /* $Id$ */
10
11 /* tabarray.h
12  *
13  * Copyright (C) 1998-1999 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 <pangomm/attrlist.h>
31 #include <pango/pango-tabs.h>
32 #include <pango/pango-break.h> //For PangoLogAttrs.
33
34 #include <utility>
35 #include <glibmmconfig.h>
36 GLIBMM_USING_STD(pair)
37
38
39 #ifndef DOXYGEN_SHOULD_SKIP_THIS
40 extern "C" { typedef struct _PangoTabArray PangoTabArray; }
41 #endif
42
43 namespace Pango
44 {
45
46
47 /** @addtogroup pangommEnums Enums and Flags */
48
49 /**
50  * @ingroup pangommEnums
51  */
52 enum TabAlign
53 {
54   TAB_LEFT
55 };
56
57 } // namespace Pango
58
59
60 #ifndef DOXYGEN_SHOULD_SKIP_THIS
61 namespace Glib
62 {
63
64 template <>
65 class Value<Pango::TabAlign> : public Glib::Value_Enum<Pango::TabAlign>
66 {
67 public:
68   static GType value_type() G_GNUC_CONST;
69 };
70
71 } // namespace Glib
72 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
73
74
75 namespace Pango
76 {
77
78
79 /** A Pango::TabArray contains an array of tab stops.
80  * Each tab stop has an alignment and a position.
81  */
82 class TabArray
83 {
84   public:
85 #ifndef DOXYGEN_SHOULD_SKIP_THIS
86   typedef TabArray CppObjectType;
87   typedef PangoTabArray BaseObjectType;
88
89   static GType get_type() G_GNUC_CONST;
90 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
91
92   TabArray();
93
94   explicit TabArray(PangoTabArray* gobject, bool make_a_copy = true);
95
96   TabArray(const TabArray& other);
97   TabArray& operator=(const TabArray& other);
98
99   ~TabArray();
100
101   void swap(TabArray& other);
102
103   ///Provides access to the underlying C instance.
104   PangoTabArray*       gobj()       { return gobject_; }
105
106   ///Provides access to the underlying C instance.
107   const PangoTabArray* gobj() const { return gobject_; }
108
109   ///Provides access to the underlying C instance. The caller is responsible for freeing it. Use when directly setting fields in structs.
110   PangoTabArray* gobj_copy() const;
111
112 protected:
113   PangoTabArray* gobject_;
114
115 private:
116
117   
118 public:
119   explicit TabArray(int initial_size, bool positions_in_pixels = true);
120
121   
122   /** Gets the number of tab stops in @a tab_array .
123    * @return The number of tab stops in the array.
124    */
125   int get_size() const;
126   
127   /** Resizes a tab array. You must subsequently initialize any tabs that
128    * were added as a result of growing the array.
129    * @param new_size New size of the array.
130    */
131   void resize(int new_size);
132   
133   /** Sets the alignment and location of a tab stop.
134    *  @a alignment  must always be Pango::TAB_LEFT in the current
135    * implementation.
136    * @param tab_index The index of a tab stop.
137    * @param alignment Tab alignment.
138    * @param location Tab location in Pango units.
139    */
140   void set_tab(int tab_index, TabAlign alignment, int location);
141
142   /** Gets the alignment and position of a tab stop.
143    * @return An std::pair<TabAlign, int>. The first element represents the tab stop alignment, the second one is the tab position.
144    */
145   std::pair<TabAlign,int> get_tab(int tab_index) const;
146
147   /** Gets an array of std::pairs containing the tab stop alignments and tab positions.
148    * @return An array of std::pair<TabAlign, int>. The first element in each pair represents the tab stop alignment, the second one is the tab position.
149    */
150   Glib::ArrayHandle< std::pair<TabAlign,int> > get_tabs() const;
151
152   
153   /** Return value: whether positions are in pixels.
154    * @return Whether positions are in pixels.
155    */
156   bool get_positions_in_pixels() const;
157
158
159 };
160
161 } //namespace Pango
162
163
164 namespace Pango
165 {
166
167 /** @relates Pango::TabArray
168  * @param lhs The left-hand side
169  * @param rhs The right-hand side
170  */
171 inline void swap(TabArray& lhs, TabArray& rhs)
172   { lhs.swap(rhs); }
173
174 } // namespace Pango
175
176 namespace Glib
177 {
178
179 /** A Glib::wrap() method for this object.
180  * 
181  * @param object The C instance.
182  * @param take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref.
183  * @result A C++ instance that wraps this C instance.
184  *
185  * @relates Pango::TabArray
186  */
187 Pango::TabArray wrap(PangoTabArray* object, bool take_copy = false);
188
189 #ifndef DOXYGEN_SHOULD_SKIP_THIS
190 template <>
191 class Value<Pango::TabArray> : public Glib::Value_Boxed<Pango::TabArray>
192 {};
193 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
194
195 } // namespace Glib
196
197
198 #endif /* _PANGOMM_TABARRAY_H */
199