2 // Generated by gtkmmproc -- DO NOT MODIFY!
3 #ifndef _PANGOMM_LANGUAGE_H
4 #define _PANGOMM_LANGUAGE_H
9 /* Copyright (C) 2002 The gtkmm Development Team
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.
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.
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.
26 #include <pango/pango-attributes.h>
29 #ifndef DOXYGEN_SHOULD_SKIP_THIS
30 extern "C" { typedef struct _PangoLanguage PangoLanguage; }
36 /** @addtogroup pangommEnums Enums and Flags */
39 * @ingroup pangommEnums
43 SCRIPT_INVALID_CODE = -1,
84 SCRIPT_CANADIAN_ABORIGINAL,
116 #ifndef DOXYGEN_SHOULD_SKIP_THIS
121 class Value<Pango::Script> : public Glib::Value_Enum<Pango::Script>
124 static GType value_type() G_GNUC_CONST;
128 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
135 /** A Pango::Language is used to represent a language.
140 #ifndef DOXYGEN_SHOULD_SKIP_THIS
141 typedef Language CppObjectType;
142 typedef PangoLanguage BaseObjectType;
144 static GType get_type() G_GNUC_CONST;
145 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
148 explicit Language(PangoLanguage* gobject, bool make_a_copy = true);
150 Language(const Language& other);
151 Language& operator=(const Language& other);
155 void swap(Language& other);
157 ///Provides access to the underlying C instance.
158 PangoLanguage* gobj() { return gobject_; }
160 ///Provides access to the underlying C instance.
161 const PangoLanguage* gobj() const { return gobject_; }
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;
167 PangoLanguage* gobject_;
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
176 /** Constructs an empty language tag.
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 '-'.
184 Language(const Glib::ustring& language);
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.
189 Glib::ustring get_string() const;
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
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.
203 bool matches(const Glib::ustring & range_list) const;
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 .
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.
223 bool includes_script(Script script) const;
228 } /* namespace Pango */
234 /** @relates Pango::Language
235 * @param lhs The left-hand side
236 * @param rhs The right-hand side
238 inline void swap(Language& lhs, Language& rhs)
246 /** A Glib::wrap() method for this object.
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.
252 * @relates Pango::Language
254 Pango::Language wrap(PangoLanguage* object, bool take_copy = false);
256 #ifndef DOXYGEN_SHOULD_SKIP_THIS
258 class Value<Pango::Language> : public Glib::Value_Boxed<Pango::Language>
260 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
265 #endif /* _PANGOMM_LANGUAGE_H */