1 // -*- c++ -*- 2 // Generated by gmmproc 2.45.3 -- DO NOT MODIFY! 3 #ifndef _GTKMM_TEXTTAGTABLE_H 4 #define _GTKMM_TEXTTAGTABLE_H 5 6 7 #include <glibmm/ustring.h> 8 #include <sigc++/sigc++.h> 9 10 /* $Id: texttagtable.hg,v 1.4 2006/04/12 11:11:25 murrayc Exp $ */ 11 12 /* texttagtable.h 13 * 14 * Copyright (C) 1998-2002 The gtkmm Development Team 15 * 16 * This library is free software; you can redistribute it and/or 17 * modify it under the terms of the GNU Lesser General Public 18 * License as published by the Free Software Foundation; either 19 * version 2.1 of the License, or (at your option) any later version. 20 * 21 * This library is distributed in the hope that it will be useful, 22 * but WITHOUT ANY WARRANTY; without even the implied warranty of 23 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 24 * Lesser General Public License for more details. 25 * 26 * You should have received a copy of the GNU Lesser General Public 27 * License along with this library; if not, write to the Free 28 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 29 */ 30 31 #include <gtkmm/object.h> 32 #include <gtkmm/texttag.h> 33 34 35 #ifndef DOXYGEN_SHOULD_SKIP_THIS 36 typedef struct _GtkTextTagTable GtkTextTagTable; 37 typedef struct _GtkTextTagTableClass GtkTextTagTableClass; 38 #endif /* DOXYGEN_SHOULD_SKIP_THIS */ 39 40 41 #ifndef DOXYGEN_SHOULD_SKIP_THIS 42 namespace Gtk 43 { class TextTagTable_Class; } // namespace Gtk 44 #endif //DOXYGEN_SHOULD_SKIP_THIS 45 46 namespace Gtk 47 { 48 49 class TextTag; 50 51 /** Typedefed as Gtk::TextBuffer::TagTable. A Collection of @link Gtk::TextTag Gtk::TextBuffer::Tags@endlink that can be used together. 52 * 53 * A tag table defines a set of @link Gtk::TextTag Gtk::TextBuffer::Tags@endlink that can be used together. Each buffer has one tag 54 * table associated with it; only tags from that tag table can be used with the buffer. A single tag table can be shared between 55 * multiple buffers, however. 56 * 57 * @ingroup TextView 58 */ 59 60 class TextTagTable : public Glib::Object 61 { 62 63 #ifndef DOXYGEN_SHOULD_SKIP_THIS 64 65 public: 66 typedef TextTagTable CppObjectType; 67 typedef TextTagTable_Class CppClassType; 68 typedef GtkTextTagTable BaseObjectType; 69 typedef GtkTextTagTableClass BaseClassType; 70 71 private: friend class TextTagTable_Class; 72 static CppClassType texttagtable_class_; 73 74 private: 75 // noncopyable 76 TextTagTable(const TextTagTable&); 77 TextTagTable& operator=(const TextTagTable&); 78 79 protected: 80 explicit TextTagTable(const Glib::ConstructParams& construct_params); 81 explicit TextTagTable(GtkTextTagTable* castitem); 82 83 #endif /* DOXYGEN_SHOULD_SKIP_THIS */ 84 85 public: 86 virtual ~TextTagTable(); 87 88 /** Get the GType for this class, for use with the underlying GObject type system. 89 */ 90 static GType get_type() G_GNUC_CONST; 91 92 #ifndef DOXYGEN_SHOULD_SKIP_THIS 93 94 95 static GType get_base_type() G_GNUC_CONST; 96 #endif 97 98 ///Provides access to the underlying C GObject. gobj()99 GtkTextTagTable* gobj() { return reinterpret_cast<GtkTextTagTable*>(gobject_); } 100 101 ///Provides access to the underlying C GObject. gobj()102 const GtkTextTagTable* gobj() const { return reinterpret_cast<GtkTextTagTable*>(gobject_); } 103 104 ///Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs. 105 GtkTextTagTable* gobj_copy(); 106 107 private: 108 109 protected: 110 111 TextTagTable(); 112 113 public: 114 115 static Glib::RefPtr<TextTagTable> create(); 116 117 118 /** Add a tag to the table. The tag is assigned the highest priority 119 * in the table. 120 * 121 * @a tag must not be in a tag table already, and may not have 122 * the same name as an already-added tag. 123 * 124 * @param tag A Gtk::TextTag. 125 */ 126 void add(const Glib::RefPtr<TextTag>& tag); 127 128 /** Remove a tag from the table. This will remove the table's 129 * reference to the tag, so be careful - the tag will end 130 * up destroyed if you don't have a reference to it. 131 * 132 * @param tag A Gtk::TextTag. 133 */ 134 void remove(const Glib::RefPtr<TextTag>& tag); 135 136 /** Look up a named tag. 137 * 138 * @param name Name of a tag. 139 * @return The tag, or <tt>0</tt> if none by that name is in the table. 140 */ 141 Glib::RefPtr<TextTag> lookup(const Glib::ustring& name); 142 143 /** Look up a named tag. 144 * 145 * @param name Name of a tag. 146 * @return The tag, or <tt>0</tt> if none by that name is in the table. 147 */ 148 Glib::RefPtr<const TextTag> lookup(const Glib::ustring& name) const; 149 150 typedef sigc::slot<void, const Glib::RefPtr<TextTag>&> SlotForEach; 151 void foreach(const SlotForEach& slot); 152 153 154 /** Returns the size of the table (number of tags) 155 * 156 * @return Number of tags in @a table. 157 */ 158 int get_size() const; 159 160 161 /** 162 * @par Slot Prototype: 163 * <tt>void on_my_%tag_changed(const Glib::RefPtr<TextTag>& tag, bool size_changed)</tt> 164 * 165 */ 166 167 Glib::SignalProxy2< void,const Glib::RefPtr<TextTag>&,bool > signal_tag_changed(); 168 169 170 /** 171 * @par Slot Prototype: 172 * <tt>void on_my_%tag_added(const Glib::RefPtr<TextTag>& tag)</tt> 173 * 174 */ 175 176 Glib::SignalProxy1< void,const Glib::RefPtr<TextTag>& > signal_tag_added(); 177 178 179 /** 180 * @par Slot Prototype: 181 * <tt>void on_my_%tag_removed(const Glib::RefPtr<TextTag>& tag)</tt> 182 * 183 */ 184 185 Glib::SignalProxy1< void,const Glib::RefPtr<TextTag>& > signal_tag_removed(); 186 187 188 public: 189 190 public: 191 //C++ methods used to invoke GTK+ virtual functions: 192 193 protected: 194 //GTK+ Virtual Functions (override these to change behaviour): 195 196 //Default Signal Handlers:: 197 /// This is a default handler for the signal signal_tag_changed(). 198 virtual void on_tag_changed(const Glib::RefPtr<TextTag>& tag, bool size_changed); 199 /// This is a default handler for the signal signal_tag_added(). 200 virtual void on_tag_added(const Glib::RefPtr<TextTag>& tag); 201 /// This is a default handler for the signal signal_tag_removed(). 202 virtual void on_tag_removed(const Glib::RefPtr<TextTag>& tag); 203 204 205 }; 206 207 } /* namespace Gtk */ 208 209 210 namespace Glib 211 { 212 /** A Glib::wrap() method for this object. 213 * 214 * @param object The C instance. 215 * @param take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref. 216 * @result A C++ instance that wraps this C instance. 217 * 218 * @relates Gtk::TextTagTable 219 */ 220 Glib::RefPtr<Gtk::TextTagTable> wrap(GtkTextTagTable* object, bool take_copy = false); 221 } 222 223 224 #endif /* _GTKMM_TEXTTAGTABLE_H */ 225 226