Install ardour as a binary, a script and a set of shared
[ardour.git] / libs / gtkmm2 / gtk / gtkmm / textmark.h
1 // -*- c++ -*-
2 // Generated by gtkmmproc -- DO NOT MODIFY!
3 #ifndef _GTKMM_TEXTMARK_H
4 #define _GTKMM_TEXTMARK_H
5
6 #include <glibmm.h>
7
8 /* $Id$ */
9
10 /* textmark.h
11  * 
12  * Copyright (C) 1998-2002 The gtkmm Development Team
13  *
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.
18  *
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.
23  *
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.
27  */
28
29
30 #include <gtkmm/object.h>
31
32
33 #ifndef DOXYGEN_SHOULD_SKIP_THIS
34 typedef struct _GtkTextMark GtkTextMark;
35 typedef struct _GtkTextMarkClass GtkTextMarkClass;
36 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
37
38
39 namespace Gtk
40 { class TextMark_Class; } // namespace Gtk
41 namespace Gtk
42 {
43
44 class TextBuffer;
45 class TextIter;
46
47 /** Typedefed as Gtk::TextBuffer::Mark. A position in the buffer, preserved across buffer modifications.
48  *
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
54  * text.
55  *
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.
60  *
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.
63  *
64  * You can convert the mark to an @link Gtk::TextIter iterator@endlink using Gtk::TextBuffer::get_iter_at_mark().
65  *
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.
67  *
68  * Marks optionally have names; these can be convenient to avoid passing the Gtk::TextBuffer::Mark object around.
69  *
70  * Marks are typically created using the Gtk::TextBuffer::create_mark() function.
71  *
72  * @ingroup TextView
73  */
74
75 class TextMark : public Glib::Object
76 {
77   
78 #ifndef DOXYGEN_SHOULD_SKIP_THIS
79
80 public:
81   typedef TextMark CppObjectType;
82   typedef TextMark_Class CppClassType;
83   typedef GtkTextMark BaseObjectType;
84   typedef GtkTextMarkClass BaseClassType;
85
86 private:  friend class TextMark_Class;
87   static CppClassType textmark_class_;
88
89 private:
90   // noncopyable
91   TextMark(const TextMark&);
92   TextMark& operator=(const TextMark&);
93
94 protected:
95   explicit TextMark(const Glib::ConstructParams& construct_params);
96   explicit TextMark(GtkTextMark* castitem);
97
98 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
99
100 public:
101   virtual ~TextMark();
102
103 #ifndef DOXYGEN_SHOULD_SKIP_THIS
104   static GType get_type()      G_GNUC_CONST;
105   static GType get_base_type() G_GNUC_CONST;
106 #endif
107
108   ///Provides access to the underlying C GObject.
109   GtkTextMark*       gobj()       { return reinterpret_cast<GtkTextMark*>(gobject_); }
110
111   ///Provides access to the underlying C GObject.
112   const GtkTextMark* gobj() const { return reinterpret_cast<GtkTextMark*>(gobject_); }
113
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();
116
117 private:
118
119 protected:
120
121 public:
122   
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.
129    */
130   void set_visible(bool setting = true);
131   
132   /** Returns <tt>true</tt> if the mark is visible (i.e.\ a cursor is displayed
133    * for it)
134    * @return <tt>true</tt> if visible.
135    */
136   bool get_visible() const;
137   
138   /** Returns the mark name; returns <tt>0</tt> for anonymous marks.
139    * @return Mark name.
140    */
141   Glib::ustring get_name() const;
142   
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
145    * once deleted.
146    * @return Whether the mark is deleted.
147    */
148   bool get_deleted() const;
149   
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.
153    */
154   Glib::RefPtr<TextBuffer> get_buffer();
155   
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.
159    */
160   Glib::RefPtr<const TextBuffer> get_buffer() const;
161   
162   /** Determines whether the mark has left gravity.
163    * @return <tt>true</tt> if the mark has left gravity, <tt>false</tt> otherwise.
164    */
165   bool get_left_gravity() const;
166   TextIter get_iter();
167
168
169 public:
170
171 public:
172   //C++ methods used to invoke GTK+ virtual functions:
173
174 protected:
175   //GTK+ Virtual Functions (override these to change behaviour):
176
177   //Default Signal Handlers::
178
179
180 };
181
182 } /* namespace Gtk */
183
184
185 namespace Glib
186 {
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.
191    */
192   Glib::RefPtr<Gtk::TextMark> wrap(GtkTextMark* object, bool take_copy = false);
193 }
194
195
196 #endif /* _GTKMM_TEXTMARK_H */
197