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

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


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.

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

Xfc::Pango::AttrIterator::AttrIterator ( const AttrIterator src  ) 

Copy constructor.

src The source iterator.

Member Function Documentation

AttrIterator& Xfc::Pango::AttrIterator::operator= ( const AttrIterator src  ) 

Assignment operator.

src The source iterator.

void Xfc::Pango::AttrIterator::range ( int *  start,
int *  end 
) const

Get the range of the current segment.

start The location to store the start of the range.
end The location to store the end of the range.

Pointer<Attribute> Xfc::Pango::AttrIterator::get ( AttrType  type  ) 

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

type The type of attribute to find.
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.

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.

desc A FontDescription to fill in with the current values.
language If non-null, location to store the language tag for item, or null if none is found.
extra_attrs If 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()).

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

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

attrs A reference to a vector of Pointer<Attribute> to hold the list of attributes.
true if the vector is not empty.

bool Xfc::Pango::AttrIterator::next (  ) 

Advance the iterator until the next change of style.

false if the iterator is at the end of the list, otherwise true.

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