gtkmm: Gtk::TextTagTable Class Reference

gtkmm 4.14.0

Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Protected Member Functions | Related Symbols | List of all members
Gtk::TextTagTable Class Reference
TextView Classes

Typedefed as Gtk::TextBuffer::TagTable. More...

`#include <gtkmm/texttagtable.h>`

Inheritance diagram for Gtk::TextTagTable:
[legend]

## Public Types
typedef sigc::slot< void(const Glib::RefPtr< TextTag > &) | SlotForEach)

## Public Member Functions
| TextTagTable (TextTagTable &&src) noexcept
TextTagTable & | operator= (TextTagTable &&src) noexcept
| ~TextTagTable () noexcept override
GtkTextTagTable * | gobj ()
| Provides access to the underlying C GObject.
const GtkTextTagTable * | gobj () const
| Provides access to the underlying C GObject.
GtkTextTagTable * | gobj_copy ()
| Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.
bool | add (const Glib::RefPtr< TextTag > &tag)
| Add a tag to the table.
void | remove (const Glib::RefPtr< TextTag > &tag)
| Remove a tag from the table.
Glib::RefPtr< TextTag > | lookup (const Glib::ustring & name)
| Look up a named tag.
Glib::RefPtr< const TextTag > | lookup (const Glib::ustring & name) const
| Look up a named tag.
void | foreach (const SlotForEach &slot)
int | get_size () const
| Returns the size of the table (number of tags)
Public Member Functions inherited from Gtk::Buildable
| Buildable (Buildable &&src) noexcept
Buildable & | operator= (Buildable &&src) noexcept
| ~Buildable () noexcept override
GtkBuildable * | gobj ()
| Provides access to the underlying C GObject.
const GtkBuildable * | gobj () const
| Provides access to the underlying C GObject.
Glib::ustring | get_buildable_id () const
| Gets the ID of the buildable object.

## Static Public Member Functions
static GType | get_type ()
| Get the GType for this class, for use with the underlying GObject type system.
static Glib::RefPtr< TextTagTable > | create ()
Static Public Member Functions inherited from Gtk::Buildable
static void | add_interface (GType gtype_implementer)
static GType | get_type ()
| Get the GType for this class, for use with the underlying GObject type system.

## Public Attributes
Glib::SignalProxy< void(const Glib::RefPtr< TextTag > &, bool) | signal_tag_changed )()
Glib::SignalProxy< void(const Glib::RefPtr< TextTag > &) | signal_tag_added )()
Glib::SignalProxy< void(const Glib::RefPtr< TextTag > &) | signal_tag_removed )()

## Protected Member Functions
| TextTagTable ()
Protected Member Functions inherited from Gtk::Buildable
| Buildable ()
| You should derive from this class to use it.

## Related Symbols
(Note that these are not member symbols.)
Glib::RefPtr< Gtk::TextTagTable > | wrap (GtkTextTagTable *object, bool take_copy=false)
| A Glib::wrap() method for this object.
Related Symbols inherited from Gtk::Buildable
Glib::RefPtr< Gtk::Buildable > | wrap (GtkBuildable *object, bool take_copy=false)
| A Glib::wrap() method for this object.

## Detailed Description

Typedefed as Gtk::TextBuffer::TagTable.

A Collection of Gtk::TextBuffer::Tags that can be used together.

A tag table defines a set of Gtk::TextBuffer::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

## ◆ SlotForEach

typedef sigc::slot<void(const Glib::RefPtr<TextTag>&) Gtk::TextTagTable::SlotForEach)

## Constructor & Destructor Documentation

## ◆ TextTagTable() [1/2]

Gtk::TextTagTable::TextTagTable | ( | TextTagTable && | src | ) |
| noexcept

## ◆ ~TextTagTable()

Gtk::TextTagTable::~TextTagTable | ( |  | ) |
| overridenoexcept

## ◆ TextTagTable() [2/2]

Gtk::TextTagTable::TextTagTable | ( |  | ) |
| protected

## Member Function Documentation

## ◆ add()

bool Gtk::TextTagTable::add | ( | const Glib::RefPtr< TextTag > & | tag | ) |

Add a tag to the table.

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.

Parameters

  tag | A `Gtk::TextTag`.

Returns
  `true` on success.

## ◆ create()

static Glib::RefPtr< TextTagTable > Gtk::TextTagTable::create | ( |  | ) |
| static

## ◆ foreach()

void Gtk::TextTagTable::foreach | ( | const SlotForEach & | slot | ) |

## ◆ get_size()

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

Returns the size of the table (number of tags)

Returns
  Number of tags in table.

## ◆ get_type()

static GType Gtk::TextTagTable::get_type | ( |  | ) |
| static

Get the GType for this class, for use with the underlying GObject type system.

## ◆ gobj() [1/2]

GtkTextTagTable * Gtk::TextTagTable::gobj | ( |  | ) |
| inline

Provides access to the underlying C GObject.

## ◆ gobj() [2/2]

const GtkTextTagTable * Gtk::TextTagTable::gobj | ( |  | ) | const
| inline

Provides access to the underlying C GObject.

## ◆ gobj_copy()

GtkTextTagTable * Gtk::TextTagTable::gobj_copy | ( |  | ) |

Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.

## ◆ lookup() [1/2]

Glib::RefPtr< TextTag > Gtk::TextTagTable::lookup | ( | const Glib::ustring & | name | ) |

Look up a named tag.

Parameters

  name | Name of a tag.

Returns
  The tag.

## ◆ lookup() [2/2]

Glib::RefPtr< const TextTag > Gtk::TextTagTable::lookup | ( | const Glib::ustring & | name | ) | const

Look up a named tag.

Parameters

  name | Name of a tag.

Returns
  The tag.

## ◆ operator=()

TextTagTable & Gtk::TextTagTable::operator= | ( | TextTagTable && | src | ) |
| noexcept

## ◆ remove()

void Gtk::TextTagTable::remove | ( | const Glib::RefPtr< TextTag > & | tag | ) |

Remove a tag from the table.

If a `Gtk::TextBuffer` has table as its tag table, the tag is removed from the buffer. The table’s reference to the tag is removed, so the tag will end up destroyed if you don’t have a reference to it.

Parameters

  tag | A `Gtk::TextTag`.

## Friends And Related Symbol Documentation

## ◆ wrap()

Glib::RefPtr< Gtk::TextTagTable > wrap | ( | GtkTextTagTable * | object,
|  | bool | take_copy = false )
| related

A Glib::wrap() method for this object.

Parameters

  object | The C instance.
  take_copy | False if the result should take ownership of the C instance. True if it should take a new copy or ref.

Returns
  A C++ instance that wraps this C instance.

## Member Data Documentation

## ◆ signal_tag_added

Glib::SignalProxy< void(const Glib::RefPtr< TextTag > &) Gtk::TextTagTable::signal_tag_added) ()

Slot Prototype:
  `void on_my_tag_added(const Glib::RefPtr<TextTag>& tag)`

Flags: Run Last

Emitted every time a new tag is added in the `Gtk::TextTagTable`.

Parameters

  tag | The added tag.

## ◆ signal_tag_changed

Glib::SignalProxy< void(const Glib::RefPtr< TextTag > &, bool) Gtk::TextTagTable::signal_tag_changed) ()

Slot Prototype:
  `void on_my_tag_changed(const Glib::RefPtr<TextTag>& tag, bool size_changed)`

Flags: Run Last

Emitted every time a tag in the `Gtk::TextTagTable` changes.

Parameters

  tag | The changed tag.
  size_changed | Whether the change affects the `Gtk::TextView` layout.

## ◆ signal_tag_removed

Glib::SignalProxy< void(const Glib::RefPtr< TextTag > &) Gtk::TextTagTable::signal_tag_removed) ()

Slot Prototype:
  `void on_my_tag_removed(const Glib::RefPtr<TextTag>& tag)`

Flags: Run Last

Emitted every time a tag is removed from the `Gtk::TextTagTable`.

The tag is still valid by the time the signal is emitted, but it is not associated with a tag table any more.

Parameters

  tag | The removed tag.