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

# Xfc::Gtk::TextAttributes Class Reference

A GtkTextAttributes C++ wrapper class. More...

`#include <xfc/gtk/texttag.hh>`

Inheritance diagram for Xfc::Gtk::TextAttributes:

List of all members.

## Public Member Functions

Constructors

- TextAttributes ()
    Constructs a TextAttributes object with a reference count of 1 that the caller owns.
- TextAttributes (GtkTextAttributes *values)
    Constructs a TextAttributes object from an existing GtkTextAttributes.
- TextAttributes (GtkTextAttributes *values, bool copy)
    Constructs a TextAttributes from an existing GtkTextAttributes.
- TextAttributes (const TextAttributes &src)
    Copy constructor.
- ~TextAttributes ()
    Destructor.
- TextAttributes & operator= (const TextAttributes &src)
    Assignment operator.

Accessors

- GtkTextAttributes * gtk_text_attributes () const
    Get a pointer to the GtkTextAttributes structure.
- operator GtkTextAttributes * () const
    Conversion operator; safely converts a TextAttributes to a GtkTextAttributes pointer.
- TextAppearance & appearance () const
    Obtains the appearance attributes of some text.
- Justification justification () const
    Returns the current text justification: left, right, or center.
- TextDirection direction () const
    Returns the current text direction.
- Pointer< Pango::FontDescription > font () const
    Gets the font description for the some text.
- double font_scale () const
    Gets the font size as a scale factor relative to the default font size.
- int left_margin () const
    Gets the width of the left margin in pixels.
- int indent () const
    Gets the amount to indent the paragraph, in pixels.
- int right_margin () const
    Gets the width of the right margin in pixels.
- int pixels_above_lines () const
    Gets the number of pixels of blank space above paragraphs.
- int pixels_below_lines () const
    Gets the number of pixels of blank space below paragraphs.
- int pixels_inside_wrap () const
    Gets the number of pixels of blank space between wrapped lines in a paragraph.
- Pointer< Pango::TabArray > tabs () const
    Gets the custom tabs for the text.
- WrapMode wrap_mode () const
    Returns the current wrap mode: never, at word boundaries, or at character boundaries.
- PangoLanguage * language () const
    Gets the language the text is in, as an ISO code.
- bool invisible () const
    Gets whether the text is hidden. Not implemented in GTK 2.0.
- bool bg_full_height () const
    Gets whether the background color fills the entire line height or only the height of the tagged characters.
- bool editable () const
    Gets whether the text can be modified by the user.
- bool realized () const
    Gets whether the TextAttribute's colors have been allocated.

Methods

- void set_justification (Justification justification)
    Sets the justification of the text.
- void set_direction (TextDirection direction)
    Sets the text direction.
- void set_margins (int left_margin, int right_margin)
    Set the text margins.
- void set_left_margin (int margin)
    Set the left text margin.
- void set_right_margin (int margin)
    Set the right text margin.
- void set_indent (int indent)
    Set the paragraph indent in pixels.
- void set_pixels (int pixels_above_lines, int pixels_below_lines, int pixels_inside_wrap)
    Sets the amount blank space in and around a paragraph.
- void set_pixels_above_lines (int pixels)
    Sets the amount blank space above a paragraph.
- void set_pixels_below_lines (int pixels)
    Sets the amount blank space below a paragraph.
- void set_pixels_inside_wrap (int pixels)
    Sets the amount blank space between wrapped lines in a paragraph.
- void set_tab_array (Pango::TabArray &tabs)
    Sets the custom tabs for the text.
- void set_wrap_mode (WrapMode wrap_mode)
    Sets the current wrap mode: never, at word boundaries, or at character boundaries.
- void set_language (PangoLanguage *language)
    Sets the language the text is in, as an ISO code.
- void set_invisible (bool setting)
    Sets whether the text is hidden.
- void set_bg_full_height (bool setting)
    Sets whether the background color fills the entire line height or only the height of the tagged characters.
- void set_editable (bool setting)
    Sets whether the text is editable.

## Detailed Description

A GtkTextAttributes C++ wrapper class.

TextAttributes describes a set of properties on some text. Using TextAttributes directly should rarely be necessary. It's primarily useful with Gtk::TextIter::get_attributes().

Note: dynamically allocated objects must either be unreferenced or assigned to a smart pointer. Stack objects are automatically unreferenced when they go out of scope.

## Constructor & Destructor Documentation

Xfc::Gtk::TextAttributes::TextAttributes | ( | GtkTextAttributes * | values | ) | `[explicit]`

Constructs a TextAttributes object from an existing GtkTextAttributes.

Parameters:

  | values | A pointer to a GtkTextAttributes.

The values can be a newly created GtkTextAttributes or an existing GtkTextAttributes. The TextAttributes object created is a temporary object. It doesn't take over the ownership of GtkTextAttributes and GtkTextAttributes is not freed by the destructor. The TextAttributes object is created with a reference count of 1 that the caller owns.

Xfc::Gtk::TextAttributes::TextAttributes | ( | GtkTextAttributes * | values,
|  | bool | copy
| ) |

Constructs a TextAttributes from an existing GtkTextAttributes.

Parameters:

  | values | A pointer to a GtkTextAttributes.
  | copy | Whether the TextAttributes object should make a copy of GtkTextAttributes or not.

The values can be a newly created GtkTextAttributes or an existing GtkTextAttributes. If copy is true TextAttributes will make a copy of GtkTextAttributes. If copy is false TextAttributes wont make a copy but instead takes over the ownership of GtkTextAttributes. Either way, the destructor will free GtkTextAttributes when the TextAttributes object is destroyed. This constructor is used by G::Boxed::wrap() to wrap GtkTextAttributes objects in a C++ wrapper. The TextAttributes object is created with a reference count of 1 that the caller owns.

Xfc::Gtk::TextAttributes::TextAttributes | ( | const TextAttributes & | src | ) | `[explicit]`

Copy constructor.

Parameters:

  | src | The source attributes.

## Member Function Documentation

PangoLanguage* Xfc::Gtk::TextAttributes::language | ( |  | ) | const

| Gets the language the text is in, as an ISO code. Pango can use this as a hint when rendering the text. If you don't understand this parameter, you probably don't need it.

TextAttributes& Xfc::Gtk::TextAttributes::operator= | ( | const TextAttributes & | src | ) |

Assignment operator.

Parameters:

  | src | The source attributes.

void Xfc::Gtk::TextAttributes::set_bg_full_height | ( | bool | setting | ) |

Sets whether the background color fills the entire line height or only the height of the tagged characters.

Parameters:

  | setting | true if the background color fills the entire line height.

void Xfc::Gtk::TextAttributes::set_direction | ( | TextDirection | direction | ) |

Sets the text direction.

Parameters:

  | direction | One of the values from the TextDirection enumeration.

void Xfc::Gtk::TextAttributes::set_invisible | ( | bool | setting | ) |

Sets whether the text is hidden.

Parameters:

  | setting | true if the text is hidden.

void Xfc::Gtk::TextAttributes::set_justification | ( | Justification | justification | ) |

Sets the justification of the text.

Parameters:

  | justification | One of the values from the Justification enumeration.

void Xfc::Gtk::TextAttributes::set_language | ( | PangoLanguage * | language | ) |

Sets the language the text is in, as an ISO code.

Parameters:

  | language | The Pango language code.

Pango can use this as a hint when rendering the text. If you don't understand this parameter, you probably don't need it.

void Xfc::Gtk::TextAttributes::set_left_margin | ( | int | margin | ) |

Set the left text margin.

Parameters:

  | margin | The width of the left margin in pixels.

void Xfc::Gtk::TextAttributes::set_margins | ( | int | left_margin,
|  | int | right_margin
| ) |

Set the text margins.

Parameters:

  | left_margin | The width of the left margin in pixels.
  | right_margin | The width of the right margin in pixels.

void Xfc::Gtk::TextAttributes::set_pixels | ( | int | pixels_above_lines,
|  | int | pixels_below_lines,
|  | int | pixels_inside_wrap
| ) |

Sets the amount blank space in and around a paragraph.

Parameters:

  | pixels_above_lines | The number of pixels of blank space above a paragraph.
  | pixels_below_lines | The number of pixels of blank space below a paragraph.
  | pixels_inside_wrap | The number of pixels of blank space between wrapped lines in a paragraph.

void Xfc::Gtk::TextAttributes::set_pixels_above_lines | ( | int | pixels | ) |

Sets the amount blank space above a paragraph.

Parameters:

  | pixels | The number of pixels of blank space.

void Xfc::Gtk::TextAttributes::set_pixels_below_lines | ( | int | pixels | ) |

Sets the amount blank space below a paragraph.

Parameters:

  | pixels | The number of pixels of blank space.

void Xfc::Gtk::TextAttributes::set_pixels_inside_wrap | ( | int | pixels | ) |

Sets the amount blank space between wrapped lines in a paragraph.

Parameters:

  | pixels | The number of pixels of blank space.

void Xfc::Gtk::TextAttributes::set_right_margin | ( | int | margin | ) |

Set the right text margin.

Parameters:

  | margin | The width of the right margin in pixels.

void Xfc::Gtk::TextAttributes::set_tab_array | ( | Pango::TabArray & | tabs | ) |

Sets the custom tabs for the text.

Parameters:

  | tabs | The array of tab stops for the text.

void Xfc::Gtk::TextAttributes::set_wrap_mode | ( | WrapMode | wrap_mode | ) |

Sets the current wrap mode: never, at word boundaries, or at character boundaries.

Parameters:

  | wrap_mode | One of the values from the WrapMode enumeration.

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

- texttag.hh

Xfce Foundation Classes

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