Remove ancient/unused flowcanvas and libglademm from repository.
[ardour.git] / libs / gtkmm2 / pango / pangomm / language.h
1 // -*- c++ -*-
2 // Generated by gtkmmproc -- DO NOT MODIFY!
3 #ifndef _PANGOMM_LANGUAGE_H
4 #define _PANGOMM_LANGUAGE_H
5
6
7 #include <glibmm.h>
8
9 /* Copyright (C) 2002 The gtkmm Development Team
10  *
11  * This library is free software; you can redistribute it and/or
12  * modify it under the terms of the GNU Library General Public
13  * License as published by the Free Software Foundation; either
14  * version 2 of the License, or (at your option) any later version.
15  *
16  * This library is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
19  * Library General Public License for more details.
20  *
21  * You should have received a copy of the GNU Library General Public
22  * License along with this library; if not, write to the Free
23  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
24  */
25
26 #include <pango/pango-attributes.h>
27
28
29 #ifndef DOXYGEN_SHOULD_SKIP_THIS
30 extern "C" { typedef struct _PangoLanguage PangoLanguage; }
31 #endif
32
33 namespace Pango
34 {
35
36 /** @addtogroup pangommEnums Enums and Flags */
37
38 /**
39  * @ingroup pangommEnums
40  */
41 enum Script
42 {
43   SCRIPT_INVALID_CODE = -1,
44   SCRIPT_COMMON,
45   SCRIPT_INHERITED,
46   SCRIPT_ARABIC,
47   SCRIPT_ARMENIAN,
48   SCRIPT_BENGALI,
49   SCRIPT_BOPOMOFO,
50   SCRIPT_CHEROKEE,
51   SCRIPT_COPTIC,
52   SCRIPT_CYRILLIC,
53   SCRIPT_DESERET,
54   SCRIPT_DEVANAGARI,
55   SCRIPT_ETHIOPIC,
56   SCRIPT_GEORGIAN,
57   SCRIPT_GOTHIC,
58   SCRIPT_GREEK,
59   SCRIPT_GUJARATI,
60   SCRIPT_GURMUKHI,
61   SCRIPT_HAN,
62   SCRIPT_HANGUL,
63   SCRIPT_HEBREW,
64   SCRIPT_HIRAGANA,
65   SCRIPT_KANNADA,
66   SCRIPT_KATAKANA,
67   SCRIPT_KHMER,
68   SCRIPT_LAO,
69   SCRIPT_LATIN,
70   SCRIPT_MALAYALAM,
71   SCRIPT_MONGOLIAN,
72   SCRIPT_MYANMAR,
73   SCRIPT_OGHAM,
74   SCRIPT_OLD_ITALIC,
75   SCRIPT_ORIYA,
76   SCRIPT_RUNIC,
77   SCRIPT_SINHALA,
78   SCRIPT_SYRIAC,
79   SCRIPT_TAMIL,
80   SCRIPT_TELUGU,
81   SCRIPT_THAANA,
82   SCRIPT_THAI,
83   SCRIPT_TIBETAN,
84   SCRIPT_CANADIAN_ABORIGINAL,
85   SCRIPT_YI,
86   SCRIPT_TAGALOG,
87   SCRIPT_HANUNOO,
88   SCRIPT_BUHID,
89   SCRIPT_TAGBANWA,
90   SCRIPT_BRAILLE,
91   SCRIPT_CYPRIOT,
92   SCRIPT_LIMBU,
93   SCRIPT_OSMANYA,
94   SCRIPT_SHAVIAN,
95   SCRIPT_LINEAR_B,
96   SCRIPT_TAI_LE,
97   SCRIPT_UGARITIC,
98   SCRIPT_NEW_TAI_LUE,
99   SCRIPT_BUGINESE,
100   SCRIPT_GLAGOLITIC,
101   SCRIPT_TIFINAGH,
102   SCRIPT_SYLOTI_NAGRI,
103   SCRIPT_OLD_PERSIAN,
104   SCRIPT_KHAROSHTHI,
105   SCRIPT_UNKNOWN,
106   SCRIPT_BALINESE,
107   SCRIPT_CUNEIFORM,
108   SCRIPT_PHOENICIAN,
109   SCRIPT_PHAGS_PA,
110   SCRIPT_NKO
111 };
112
113 } // namespace Pango
114
115
116 #ifndef DOXYGEN_SHOULD_SKIP_THIS
117 namespace Glib
118 {
119
120 template <>
121 class Value<Pango::Script> : public Glib::Value_Enum<Pango::Script>
122 {
123 public:
124   static GType value_type() G_GNUC_CONST;
125 };
126
127 } // namespace Glib
128 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
129
130
131 namespace Pango
132 {
133
134
135 /** A Pango::Language is used to represent a language.
136  */
137 class Language
138 {
139   public:
140 #ifndef DOXYGEN_SHOULD_SKIP_THIS
141   typedef Language CppObjectType;
142   typedef PangoLanguage BaseObjectType;
143
144   static GType get_type() G_GNUC_CONST;
145 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
146
147
148   explicit Language(PangoLanguage* gobject, bool make_a_copy = true);
149
150   Language(const Language& other);
151   Language& operator=(const Language& other);
152
153   ~Language();
154
155   void swap(Language& other);
156
157   ///Provides access to the underlying C instance.
158   PangoLanguage*       gobj()       { return gobject_; }
159
160   ///Provides access to the underlying C instance.
161   const PangoLanguage* gobj() const { return gobject_; }
162
163   ///Provides access to the underlying C instance. The caller is responsible for freeing it. Use when directly setting fields in structs.
164   PangoLanguage* gobj_copy() const;
165
166 protected:
167   PangoLanguage* gobject_;
168
169 private:
170
171    //This function is a bad hack for internal use by renderers and Pango (from pango/pango-utils.c)
172    //This is defined as a macro
173   
174
175 public:
176   /** Constructs an empty language tag.
177    */
178   Language();
179
180   /** Constructs a Pango::Language object from a RFC-3066 format language tag.
181    * This function first canonicalizes the string by converting it to lowercase,
182    * mapping '_' to '-', and stripping all characters other than letters and '-'.
183    */
184   Language(const Glib::ustring& language);
185
186   /** Gets a RFC-3066 format string representing the given language tag.
187    * @return A string representing the language tag. An empty string is returned if the language tag is empty.
188    */
189   Glib::ustring get_string() const;
190
191   
192   /** Checks if a language tag matches one of the elements in a list of
193    * language ranges. A language tag is considered to match a range
194    * in the list if the range is '*', the range is exactly the tag,
195    * or the range is a prefix of the tag, and the character after it
196    * in the tag is '-'.
197    * @param range_list A list of language ranges, separated by ';', ':',
198    * ',', or space characters.
199    * Each element must either be '*', or a RFC 3066 language range
200    * canonicalized as by pango_language_from_string().
201    * @return <tt>true</tt> if a match was found.
202    */
203   bool matches(const Glib::ustring & range_list) const;
204   
205   /** Determines if @a script  is one of the scripts used to
206    * write @a language . The returned value is conservative;
207    * if nothing is known about the language tag @a language ,
208    * <tt>true</tt> will be returned, since, as far as Pango knows,
209    *  @a script  might be used to write @a language .
210    * 
211    * This routine is used in Pango's itemization process when
212    * determining if a supplied language tag is relevant to
213    * a particular section of text. It probably is not useful for
214    * applications in most circumstances.
215    * @param script A Pango::Script.
216    * @return <tt>true</tt> if @a script  is one of the scripts used
217    * to write @a language  or if nothing is known about @a language 
218    * (including the case that @a language  is <tt>0</tt>),
219    * <tt>false</tt> otherwise.
220    * 
221    * Since: 1.4.
222    */
223   bool includes_script(Script script) const;
224
225
226 };
227
228 } /* namespace Pango */
229
230
231 namespace Pango
232 {
233
234 /** @relates Pango::Language
235  * @param lhs The left-hand side
236  * @param rhs The right-hand side
237  */
238 inline void swap(Language& lhs, Language& rhs)
239   { lhs.swap(rhs); }
240
241 } // namespace Pango
242
243 namespace Glib
244 {
245
246 /** A Glib::wrap() method for this object.
247  * 
248  * @param object The C instance.
249  * @param take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref.
250  * @result A C++ instance that wraps this C instance.
251  *
252  * @relates Pango::Language
253  */
254 Pango::Language wrap(PangoLanguage* object, bool take_copy = false);
255
256 #ifndef DOXYGEN_SHOULD_SKIP_THIS
257 template <>
258 class Value<Pango::Language> : public Glib::Value_Boxed<Pango::Language>
259 {};
260 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
261
262 } // namespace Glib
263
264
265 #endif /* _PANGOMM_LANGUAGE_H */
266