Reference Manual

Main Page | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Namespace Members | Compound Members | File Members

# Inti::Gtk::TextTagTable Class Reference

A GtkTextTagTable C++ wrapper class. More...

`#include <inti/gtk/texttag.h>`

Inheritance diagram for Inti::Gtk::TextTagTable:

List of all members.

## Public Types

- typedef Slot1< void, TextTag & > ForeachSlot
    Signature of the callback slot to be called on each tag in the table.

## Public Member Functions

Constructors

- TextTagTable ()
    Construct a new TextTagTable. The table contains no tags by default.
- virtual ~TextTagTable ()
    Destructor.

Accessors

- GtkTextTagTable * gtk_text_tag_table () const
    Get a pointer to the GtkTextTagTable structure.
- GtkTextTagTableClass * gtk_text_tag_table_class () const
    Get a pointer to the GtkTextTagTableClass structure.
- operator GtkTextTagTable * () const
    Conversion operator; safely converts a TextTagTable to a GtkTextTagTable pointer.
- int get_size () const
    Returns the size of the table (number of tags).
- TextTag * lookup (const char *name)
    Look up a named tag.

Methods

- void add (TextTag &tag)
    Add a tag to the table.
- void remove (TextTag &tag)
    Remove a tag from the table.
- void foreach (const ForeachSlot *each)
    Calls each on each tag in table.

Signal Proxies

- const TagChangedSignalProxy sig_tag_changed ()
    Connect to the tag_changed_signal; emitted whenever a tag property is changed.
- const TagAddedSignalProxy sig_tag_added ()
    Connect to the tag_added_signal; emitted whenever a tag is added to the table.
- const TagRemovedSignalProxy sig_tag_removed ()
    Connect to the tag_removed_signal; emitted whenever a tag is removed from the table.

## Protected Member Functions

Constructors

- TextTagTable (GtkTextTagTable *table, bool reference=true)
    Construct a new TextTagTable from an existing GtkTextTagTable.

Signal Handlers

- virtual void on_tag_changed (TextTag &tag, bool size_changed)
    Called whenever a tag property is changed.
- virtual void on_tag_added (TextTag &tag)
    Called whenever a tag is added to the table.
- virtual void on_tag_removed (TextTag &tag)
    Called whenever a tag is removed from the table.

## Detailed Description

A GtkTextTagTable C++ wrapper class.

TextTags are stored in a TexTagTable. A tag table defines a set of tags that can be used together. Each buffer has one tag table associated with it; only tags from that tag table can be used with the buffer. A single tag table can be shared between multiple buffers, however.

## Member Typedef Documentation

typedef Slot1<void, TextTag&> Inti::Gtk::TextTagTable::ForeachSlot

| Signature of the callback slot to be called on each tag in the table. Example: Method signature for ForeachSlot.
                 void method(TextTag& tag);

                 // tag: A text tag.

## Constructor & Destructor Documentation

Inti::Gtk::TextTagTable::TextTagTable | ( | GtkTextTagTable * | table,
|  | bool | reference = true
| ) | `[explicit, protected]`

  | Construct a new TextTagTable from an existing GtkTextTagTable. Parameters:
  table | A pointer to a GtkTextTagTable.
  reference | Set false if the initial reference count is floating, set true if it's not.
The table can be a newly created GtkTextTagTable or an existing GtkTextTagTable (see G::Object::Object).

## Member Function Documentation

void Inti::Gtk::TextTagTable::add | ( | TextTag & | tag | ) |

  | Add a tag to the table. Parameters:
  tag | A TextTag.
The tag is assigned the highest priority in the table. tag must not be in a tag table already, and may not have the same name as an already-added tag.

void Inti::Gtk::TextTagTable::foreach | ( | const ForeachSlot * | each | ) |

  | Calls each on each tag in table. Parameters:
  each | The callback slot to call on each tag.

int Inti::Gtk::TextTagTable::get_size | ( |  | ) | const

| Returns the size of the table (number of tags). Returns: The number of tags in the table.

TextTag* Inti::Gtk::TextTagTable::lookup | ( | const char * | name | ) |

  | Look up a named tag. Parameters:
  name | The name of a tag.
Returns: The tag, or null if none by that name is in the table.

virtual void Inti::Gtk::TextTagTable::on_tag_added | ( | TextTag & | tag | ) | `[protected, virtual]`

  | Called whenever a tag is added to the table. Parameters:
  tag | The tag being added to the table.

virtual void Inti::Gtk::TextTagTable::on_tag_changed | ( | TextTag & | tag,
|  | bool | size_changed
| ) | `[protected, virtual]`

  | Called whenever a tag property is changed. Parameters:
  tag | The tag whose property was changed.
  size_changed | true if the changed property resulted in a change to the text display size.

virtual void Inti::Gtk::TextTagTable::on_tag_removed | ( | TextTag & | tag | ) | `[protected, virtual]`

  | Called whenever a tag is removed from the table. Parameters:
  tag | The tag being removed to the table.

void Inti::Gtk::TextTagTable::remove | ( | TextTag & | tag | ) |

  | Remove a tag from the table. Parameters:
  tag | A TextTag.
This will remove the table's reference to the tag, so be careful - the tag will end up destroyed if you don't have a reference to it.

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

- texttag.h

Main Page - Footer