Xfce Foundation Classes
Main Page  | IndexNamespace List  |  Alphabetical List  |  Class List  |  File List


Public Member Functions
Xfc::Pango::AttrIterator Class Reference

A PangoAttrIterator C++ wrapper class. More...

#include <xfc/pango/attributes.hh>

Inheritance diagram for Xfc::Pango::AttrIterator:
Xfc::Object Xfc::Trackable

List of all members.

Public Member Functions

Constructors

Detailed Description

A PangoAttrIterator C++ wrapper class.

AttrIterator is used to represent an iterator through an AttrList. A new iterator is created with Pango::AttrList::get_iterator(). Once the iterator is created, it can be advanced through the style changes in the text using next(). At each style change, the range of the current style segment and the attributes currently in effect can be queried.


Constructor & Destructor Documentation

Xfc::Pango::AttrIterator::AttrIterator ( PangoAttrIterator *  iterator) [explicit]

Constructs a new attribute iterator from an existing PangoAttrIterator.

Parameters:
iteratorA PangoAttrIterator.

AttrIterator takes over the ownership of the PangoAttrIterator and calls pango_attr_iterator_destroy() when it's no longer required.

Copy constructor.

Parameters:
srcThe source iterator.

Member Function Documentation

Find the current attribute of a particular type at the iterator location.

Parameters:
typeThe type of attribute to find.
Returns:
The current attribute of the given type, or null if no attribute of that type applies to the current location.

When multiple attributes of the same type overlap, the attribute whose range starts closest to the current location is used.

bool Xfc::Pango::AttrIterator::get_attrs ( std::vector< Pointer< Attribute > > &  attrs) const

Gets a list all attributes at the current position of the iterator.

Parameters:
attrsA reference to a vector of Pointer<Attribute> to hold the list of attributes.
Returns:
true if the vector is not empty.
void Xfc::Pango::AttrIterator::get_font ( FontDescription desc,
PangoLanguage **  language,
std::vector< Pointer< Attribute > > *  extra_attrs 
) const

Get the font and other attributes at the current iterator position.

Parameters:
descA FontDescription to fill in with the current values.
languageIf non-null, location to store the language tag for item, or null if none is found.
extra_attrsIf non-null, a vector in which to store a list of non-font attributes at the current position; only the highest priority value of each attribute will be added to this list.

The family name in desc will be set by Pango using pango_font_description_set_family_static() using values from an attribute in the AttrList associated with the iterator, so if you plan to keep it around, you must call: desc.set_family(desc.get_family()).

Advance the iterator until the next change of style.

Returns:
false if the iterator is at the end of the list, otherwise true.
AttrIterator& Xfc::Pango::AttrIterator::operator= ( const AttrIterator src)

Assignment operator.

Parameters:
srcThe source iterator.
void Xfc::Pango::AttrIterator::range ( int *  start,
int *  end 
) const

Get the range of the current segment.

Parameters:
startThe location to store the start of the range.
endThe location to store the end of the range.

The documentation for this class was generated from the following file:
Xfce Foundation Classes
Copyright © 2004-2005 The XFC Development Team XFC