2 // Generated by gtkmmproc -- DO NOT MODIFY!
3 #ifndef _GTKMM_TEXTMARK_H
4 #define _GTKMM_TEXTMARK_H
12 * Copyright (C) 1998-2002 The gtkmm Development Team
14 * This library is free software; you can redistribute it and/or
15 * modify it under the terms of the GNU Library General Public
16 * License as published by the Free Software Foundation; either
17 * version 2 of the License, or (at your option) any later version.
19 * This library is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
22 * Library General Public License for more details.
24 * You should have received a copy of the GNU Library General Public
25 * License along with this library; if not, write to the Free
26 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
30 #include <gtkmm/object.h>
33 #ifndef DOXYGEN_SHOULD_SKIP_THIS
34 typedef struct _GtkTextMark GtkTextMark;
35 typedef struct _GtkTextMarkClass GtkTextMarkClass;
36 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
40 { class TextMark_Class; } // namespace Gtk
47 /** Typedefed as Gtk::TextBuffer::Mark. A position in the buffer, preserved across buffer modifications.
49 * A Mark is like a bookmark in a text buffer; it preserves a position in the text. Unlike iterators, marks remain valid across buffer mutations, because
50 * their behavior is defined when text is inserted or deleted. When text containing a mark is deleted, the mark remains in
51 * the position originally occupied by the deleted text. When text is inserted at a mark, a mark with left gravity will be
52 * moved to the beginning of the newly-inserted text, and a mark with right gravity will be moved to the end.
53 * The standard text cursor in left-to-right languages is a mark with right gravity, because it stays to the right of inserted
56 * Like tags, marks can be either named or anonymous. There are two marks built-in to Gtk::TextBuffer; these are named "insert" and
57 * "selection_bound" and refer to the insertion point and the boundary of the selection which is not the insertion point,
58 * respectively. If no text is selected, these two marks will be in the same position. You can manipulate what is selected and
59 * where the cursor appears by moving these marks around.
61 * "left" and "right" here refer to logical direction (left is the toward the start of the buffer); in some languages such as
62 * Hebrew the logically-leftmost text is not actually on the left when displayed.
64 * You can convert the mark to an @link Gtk::TextIter iterator@endlink using Gtk::TextBuffer::get_iter_at_mark().
66 * Marks can be deleted from the buffer at any time with Gtk::TextBuffer::delete_mark(). Once deleted from the buffer, a mark is essentially useless.
68 * Marks optionally have names; these can be convenient to avoid passing the Gtk::TextBuffer::Mark object around.
70 * Marks are typically created using the Gtk::TextBuffer::create_mark() function.
75 class TextMark : public Glib::Object
78 #ifndef DOXYGEN_SHOULD_SKIP_THIS
81 typedef TextMark CppObjectType;
82 typedef TextMark_Class CppClassType;
83 typedef GtkTextMark BaseObjectType;
84 typedef GtkTextMarkClass BaseClassType;
86 private: friend class TextMark_Class;
87 static CppClassType textmark_class_;
91 TextMark(const TextMark&);
92 TextMark& operator=(const TextMark&);
95 explicit TextMark(const Glib::ConstructParams& construct_params);
96 explicit TextMark(GtkTextMark* castitem);
98 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
103 #ifndef DOXYGEN_SHOULD_SKIP_THIS
104 static GType get_type() G_GNUC_CONST;
105 static GType get_base_type() G_GNUC_CONST;
108 ///Provides access to the underlying C GObject.
109 GtkTextMark* gobj() { return reinterpret_cast<GtkTextMark*>(gobject_); }
111 ///Provides access to the underlying C GObject.
112 const GtkTextMark* gobj() const { return reinterpret_cast<GtkTextMark*>(gobject_); }
114 ///Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.
115 GtkTextMark* gobj_copy();
123 /** Sets the visibility of @a mark ; the insertion point is normally
124 * visible, i.e.\ you can see it as a vertical bar. Also, the text
125 * widget uses a visible mark to indicate where a drop will occur when
126 * dragging-and-dropping text. Most other marks are not visible.
127 * Marks are not visible by default.
128 * @param setting Visibility of mark.
130 void set_visible(bool setting = true);
132 /** Returns <tt>true</tt> if the mark is visible (i.e.\ a cursor is displayed
134 * @return <tt>true</tt> if visible.
136 bool get_visible() const;
138 /** Returns the mark name; returns <tt>0</tt> for anonymous marks.
141 Glib::ustring get_name() const;
143 /** Returns <tt>true</tt> if the mark has been removed from its buffer
144 * with Gtk::TextBuffer::delete_mark(). Marks can't be used
146 * @return Whether the mark is deleted.
148 bool get_deleted() const;
150 /** Gets the buffer this mark is located inside,
151 * or <tt>0</tt> if the mark is deleted.
152 * @return The mark's Gtk::TextBuffer.
154 Glib::RefPtr<TextBuffer> get_buffer();
156 /** Gets the buffer this mark is located inside,
157 * or <tt>0</tt> if the mark is deleted.
158 * @return The mark's Gtk::TextBuffer.
160 Glib::RefPtr<const TextBuffer> get_buffer() const;
162 /** Determines whether the mark has left gravity.
163 * @return <tt>true</tt> if the mark has left gravity, <tt>false</tt> otherwise.
165 bool get_left_gravity() const;
172 //C++ methods used to invoke GTK+ virtual functions:
175 //GTK+ Virtual Functions (override these to change behaviour):
177 //Default Signal Handlers::
182 } /* namespace Gtk */
187 /** @relates Gtk::TextMark
188 * @param object The C instance
189 * @param take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref.
190 * @result A C++ instance that wraps this C instance.
192 Glib::RefPtr<Gtk::TextMark> wrap(GtkTextMark* object, bool take_copy = false);
196 #endif /* _GTKMM_TEXTMARK_H */