2 // Generated by gtkmmproc -- DO NOT MODIFY!
3 #ifndef _PANGOMM_ATTRLIST_H
4 #define _PANGOMM_ATTRLIST_H
13 * Copyright (C) 1998-1999 The gtkmm Development Team
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.
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.
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.
30 #include <pangomm/attributes.h>
31 #include <pangomm/attriter.h>
34 #ifndef DOXYGEN_SHOULD_SKIP_THIS
35 extern "C" { typedef struct _PangoAttrList PangoAttrList; }
41 /** A Pango::AttrList represents a list of attributes that apply to a section of text.
42 * The attributes are, in general, allowed to overlap in an arbitrary fashion, however,
43 * if the attributes are manipulated only through Pango::AttrList::change(), the overlap between properties will meet stricter criteria.
45 * Since the Pango::AttrList structure is stored as a linear list, it is not suitable for storing attributes for large amounts of text.
46 * In general, you should not use a single Pango::AttrList for more than one paragraph of text.
48 * When obtaining an AttrList, you should check that it is valid. For instance, if(attrlist).
53 #ifndef DOXYGEN_SHOULD_SKIP_THIS
54 typedef AttrList CppObjectType;
55 typedef PangoAttrList BaseObjectType;
57 static GType get_type() G_GNUC_CONST;
58 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
62 explicit AttrList(PangoAttrList* gobject, bool make_a_copy = true);
64 AttrList(const AttrList& other);
65 AttrList& operator=(const AttrList& other);
69 void swap(AttrList& other);
71 ///Provides access to the underlying C instance.
72 PangoAttrList* gobj() { return gobject_; }
74 ///Provides access to the underlying C instance.
75 const PangoAttrList* gobj() const { return gobject_; }
77 ///Provides access to the underlying C instance. The caller is responsible for freeing it. Use when directly setting fields in structs.
78 PangoAttrList* gobj_copy() const;
81 PangoAttrList* gobject_;
87 /** Constructs an attribute list by parsing a marked-up text (see markup format).
88 * If @a accel_marker is nonzero, the given character will mark the character
89 * following it as an accelerator. For example, the accel marker might be an
90 * ampersand or underscore. All characters marked as an accelerator will receive
91 * a Pango::UNDERLINE_LOW attribute.
92 * Two @a accel_marker characters following each other
93 * produce a single literal @a accel_marker character.
95 * @param markup_text Markup to parse (see markup format).
96 * @param accel_marker Character that precedes an accelerator, or <tt>0</tt> for none.
98 explicit AttrList(const Glib::ustring& markup_text, gunichar accel_marker=0);
100 /** Constructs an attribute list by parsing a marked-up text (see markup format).
101 * @a text is set to the plaintext string.
102 * If @a accel_marker is nonzero, the given character will mark the character
103 * following it as an accelerator. For example, the accel marker might be an
104 * ampersand or underscore. All characters marked as an accelerator will receive
105 * a Pango::UNDERLINE_LOW attribute. The first character so marked will be
106 * returned in @a accel_char. Two @a accel_marker characters following each other
107 * produce a single literal @a accel_marker character.
109 * @param markup_text Markup to parse (see markup format).
110 * @param accel_marker Character that precedes an accelerator, or <tt>0</tt> for none.
111 * @param text Return location for text with tags stripped.
112 * @param accel_char Return location for accelerator char.
114 AttrList(const Glib::ustring& markup_text, gunichar accel_marker, Glib::ustring& text, gunichar& accel_char);
116 ///Tests whether the AttrList is valid.
119 void insert(Attribute& attr);
120 // hand code because we need to pass a copy of the attribute
121 void insert_before(Attribute& attr);
122 // hand code because we need to pass a copy of the attribute
123 void change(Attribute& attr);
124 // hand code because we need to pass a copy of the attribute
126 /** This function opens up a hole in @a list , fills it in with attributes from
127 * the left, and then merges @a other on top of the hole.
129 * This operation is equivalent to stretching every attribute
130 * that applies at position @a pos in @a list by an amount @a len ,
131 * and then calling pango_attr_list_change() with a copy
132 * of each attribute in @a other in sequence (offset in position by @a pos ).
134 * This operation proves useful for, for instance, inserting
135 * a pre-edit string in the middle of an edit buffer.
136 * @param other Another Pango::AttrList.
137 * @param pos The position in @a list at which to insert @a other .
138 * @param len The length of the spliced segment. (Note that this
139 * must be specified since the attributes in @a other
140 * may only be present at some subsection of this range).
142 void splice(AttrList& other, int pos, int len);
144 /** Create a iterator initialized to the beginning of the list.
145 * @a list must not be modified until this iterator is freed.
146 * @return The newly allocated Pango::AttrIterator, which should
147 * be freed with pango_attr_iterator_destroy().
151 //TODO: Though it doesn't seem important:
152 //PangoAttrList* pango_attr_list_filter (PangoAttrList* list, PangoAttrFilterFunc func, gpointer data)
163 /** @relates Pango::AttrList
164 * @param lhs The left-hand side
165 * @param rhs The right-hand side
167 inline void swap(AttrList& lhs, AttrList& rhs)
175 /** A Glib::wrap() method for this object.
177 * @param object The C instance.
178 * @param take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref.
179 * @result A C++ instance that wraps this C instance.
181 * @relates Pango::AttrList
183 Pango::AttrList wrap(PangoAttrList* object, bool take_copy = false);
185 #ifndef DOXYGEN_SHOULD_SKIP_THIS
187 class Value<Pango::AttrList> : public Glib::Value_Boxed<Pango::AttrList>
189 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
194 #endif /* _PANGOMM_ATTRLIST_H */