Xfce Foundation Classes
Main Page | Index | Namespace List | Alphabetical List | Class List | File List

# Xfc::Pango::Attribute Class Reference

A PangoAttriubte C++ wrapper class. More...

`#include <xfc/pango/attributes.hh>`

Inheritance diagram for Xfc::Pango::Attribute:

List of all members.

## Public Member Functions

Constructors

- Attribute (PangoAttribute *attr, bool copy)
    Construct a new attribute from an existing PangoAttribute.
- Attribute (const Attribute &src)
    Copy constructor.
- virtual ~Attribute ()
    Destructor.
- Attribute & operator= (const Attribute &src)
    Assignment operator.

Accessors

- PangoAttribute * pango_attribute () const
    Get a pointer to the PangoAttribute structure.
- const PangoAttrClass * pango_attr_class () const
    Get a pointer to the PangoAttrClass structure.
- operator PangoAttribute * () const
    Conversion operator; safely converts an Attribute to a PangoAttribute pointer.
- AttrType type () const
    Returns the attribute type.
- bool is_language () const
    Returns true if the attribute type is ATTR_LANGUAGE.
- bool is_family () const
    Returns true if the attribute type is ATTR_FAMILY.
- bool is_foreground () const
    Returns true if the attribute type is ATTR_FOREGROUND.
- bool is_background () const
    Returns true if the attribute type is ATTR_BACKGROUND.
- bool is_size () const
    Returns true if the attribute type is ATTR_SIZE.
- bool is_style () const
    Returns true if the attribute type is ATTR_STYLE.
- bool is_weight () const
    Returns true if the attribute type is ATTR_WEIGHT.
- bool is_variant () const
    Returns true if the attribute type is ATTR_VARIANT.
- bool is_stretch () const
    Returns true if the attribute type is ATTR_STRETCH.
- bool is_underline () const
    Returns true if the attribute type is ATTR_UNDERLINE.
- bool is_strikethrough () const
    Returns true if the attribute type is ATTR_STRIKETHROUGH.
- bool is_rise () const
    Returns true if the attribute type is ATTR_RISE.
- bool is_font_description () const
    Returns true if the attribute type is ATTR_FONT_DESC.
- bool is_shape () const
    Returns true if the attribute type is ATTR_SHAPE.
- bool is_scale () const
    Returns true if the attribute type is ATTR_SCALE.
- unsigned int start_index () const
    Returns the starting byte index of the range this attribute applies to.
- unsigned int end_index () const
    Returns the end byte index of the range this attribute applies to (the character at this index is not included in the range).
- bool equal (const Attribute &other) const
    Compares this attribute with other for equality.
- bool operator== (const Attribute &other) const
    Equality operator; compares this attribute with other for equality.
- bool operator!= (const Attribute &other) const
    Inequality operator; compares this attribute with other for inequality.

Methods

- void set_start_index (unsigned int start)
    Set the starting byte index for the range this attribute applies to.
- void set_end_index (unsigned int end)
    Set the end byte index for the range this attribute applies to.
- void set_index (unsigned int start, unsigned int end)
    Set the start and end byte index for the range this attribute applies to.

## Detailed Description

A PangoAttriubte C++ wrapper class.

Attribute and its derived classes are used to represent and manipulate sets of attributes applied to a portion of text. Attributed text is used in a number of places in Pango. It is used as the input to the itemization process and also when creating a Pango::Layout.

## Constructor & Destructor Documentation

Xfc::Pango::Attribute::Attribute | ( | PangoAttribute * | attr,
|  | bool | copy
| ) | `[explicit]`

Construct a new attribute from an existing PangoAttribute.

Parameters:

  | attr | A PangoAttribute.
  | copy | Set true if a copy of attr should be used.

If copy is true attr is copied. If false attr is assumed to be a valid attribute that must be freed. Either way Attribute will own the PangoAttribute and free it when it's no longer required.

Xfc::Pango::Attribute::Attribute | ( | const Attribute & | src | ) |

Copy constructor.

Parameters:

  | src | The source attribute.

## Member Function Documentation

bool Xfc::Pango::Attribute::equal | ( | const Attribute & | other | ) | const

Compares this attribute with other for equality.

Parameters:

  | other | The attribute to compare with.

Returns:
  true if the two attributes have the same value.

This compares only the actual value of the two attributes and not the ranges that the attributes apply to.

bool Xfc::Pango::Attribute::operator!= | ( | const Attribute & | other | ) | const

Inequality operator; compares this attribute with other for inequality.

Parameters:

  | other | The attribute to compare with.

Returns:
  true if the two attributes have different values.

This compares only the actual value of the two attributes and not the ranges that the attributes apply to.

Attribute& Xfc::Pango::Attribute::operator= | ( | const Attribute & | src | ) |

Assignment operator.

Parameters:

  | src | The source attribute.

bool Xfc::Pango::Attribute::operator== | ( | const Attribute & | other | ) | const

Equality operator; compares this attribute with other for equality.

Parameters:

  | other | The attribute to compare with.

Returns:
  true if the two attributes have the same value.

This compares only the actual value of the two attributes and not the ranges that the attributes apply to.

void Xfc::Pango::Attribute::set_end_index | ( | unsigned int | end | ) |

Set the end byte index for the range this attribute applies to.

Parameters:

  | end | The end index.

void Xfc::Pango::Attribute::set_index | ( | unsigned int | start,
|  | unsigned int | end
| ) |

Set the start and end byte index for the range this attribute applies to.

Parameters:

  | start | The start index.
  | end | The end index.

void Xfc::Pango::Attribute::set_start_index | ( | unsigned int | start | ) |

Set the starting byte index for the range this attribute applies to.

Parameters:

  | start | The start index.

AttrType Xfc::Pango::Attribute::type | ( |  | ) | const

| Returns the attribute type. Note: GDK registers AttrStiple and AttrBitmap as new attribute types so ATTR_INVALID will be returned for these attributes.

The documentation for this class was generated from the following file:

- attributes.hh

Xfce Foundation Classes

Copyright © 2004-2005 The XFC Development Team | XFC 4.3