2 // Generated by gtkmmproc -- DO NOT MODIFY!
3 #ifndef _ATKMM_EDITABLETEXT_H
4 #define _ATKMM_EDITABLETEXT_H
11 /* Copyright (C) 2002 The gtkmm Development Team
13 * This library is free software; you can redistribute it and/or
14 * modify it under the terms of the GNU Library General Public
15 * License as published by the Free Software Foundation; either
16 * version 2 of the License, or (at your option) any later version.
18 * This library is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21 * Library General Public License for more details.
23 * You should have received a copy of the GNU Library General Public
24 * License along with this library; if not, write to the Free
25 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
29 #include <atkmm/text.h>
31 #ifndef DOXYGEN_SHOULD_SKIP_THIS
34 typedef struct _AtkEditableTextIface AtkEditableTextIface;
35 typedef struct _AtkEditableText AtkEditableText;
37 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
40 #ifndef DOXYGEN_SHOULD_SKIP_THIS
41 typedef struct _AtkEditableText AtkEditableText;
42 typedef struct _AtkEditableTextClass AtkEditableTextClass;
43 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
47 { class EditableText_Class; } // namespace Atk
51 //TODO: I see no evidence that AtkEditableText is actually a subclass of AtkText, as the C docs say. murrayc.
52 /* The ATK interface implemented by components containing user-editable text content.
53 * This should be implemented by UI components which contain text which the user can edit, via the Atk::Object
54 * corresponding to that component (see Atk::Object).
55 * EditableText is a subclass of AtkText, and as such, an object which implements EditableText is by definition
56 * an Atk::Text implementor as well.
59 class EditableText : public Glib::Interface
62 #ifndef DOXYGEN_SHOULD_SKIP_THIS
65 typedef EditableText CppObjectType;
66 typedef EditableText_Class CppClassType;
67 typedef AtkEditableText BaseObjectType;
68 typedef AtkEditableTextIface BaseClassType;
71 friend class EditableText_Class;
72 static CppClassType editabletext_class_;
75 EditableText(const EditableText&);
76 EditableText& operator=(const EditableText&);
79 EditableText(); // you must derive from this class
82 // This is public so that C++ wrapper instances can be
83 // created for C instances of unwrapped types.
84 // For instance, if an unexpected C type implements the C interface.
85 explicit EditableText(AtkEditableText* castitem);
88 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
91 virtual ~EditableText();
93 static void add_interface(GType gtype_implementer);
95 #ifndef DOXYGEN_SHOULD_SKIP_THIS
96 static GType get_type() G_GNUC_CONST;
97 static GType get_base_type() G_GNUC_CONST;
100 ///Provides access to the underlying C GObject.
101 AtkEditableText* gobj() { return reinterpret_cast<AtkEditableText*>(gobject_); }
103 ///Provides access to the underlying C GObject.
104 const AtkEditableText* gobj() const { return reinterpret_cast<AtkEditableText*>(gobject_); }
111 /** Sets the attributes for a specified range. See the ATK_ATTRIBUTE
112 * macros (such as Atk::ATTRIBUTE_LEFT_MARGIN) for examples of attributes
113 * that can be set. Note that other attributes that do not have corresponding
114 * ATK_ATTRIBUTE macros may also be set for certain text widgets.
115 * @param attrib_set An Atk::AttributeSet.
116 * @param start_offset Start of range in which to set attributes.
117 * @param end_offset End of range in which to set attributes.
118 * @return <tt>true</tt> if attributes successfully set for the specified
119 * range, otherwise <tt>false</tt>.
121 bool set_run_attributes(const AttributeSet& attrib_set, int start_offset, int end_offset);
123 /** Set text contents of @a text .
124 * @param string String to set for text contents of @a text .
126 void set_text_contents(const Glib::ustring& string);
128 /** Insert text at a given position.
129 * @param string The text to insert.
130 * @param length The length of text to insert, in bytes.
131 * @param position The caller initializes this to
132 * the position at which to insert the text. After the call it
133 * points at the position after the newly inserted text.
135 void insert_text(const Glib::ustring& string, int length, int& position);
137 /** Copy text from @a start_pos up to, but not including @a end_pos
139 * @param start_pos Start position.
140 * @param end_pos End position.
142 void copy_text(int start_pos, int end_pos);
144 /** Copy text from @a start_pos up to, but not including @a end_pos
145 * to the clipboard and then delete from the widget.
146 * @param start_pos Start position.
147 * @param end_pos End position.
149 void cut_text(int start_pos, int end_pos);
151 /** Delete text @a start_pos up to, but not including @a end_pos .
152 * @param start_pos Start position.
153 * @param end_pos End position.
155 void delete_text(int start_pos, int end_pos);
157 /** Paste text from clipboard to specified @a position .
158 * @param position Position to paste.
160 void paste_text(int position);
163 #ifdef GLIBMM_VFUNCS_ENABLED
164 virtual bool set_run_attributes_vfunc(AtkAttributeSet* attrib_set, int start_offset, int end_offset);
165 #endif //GLIBMM_VFUNCS_ENABLED
167 #ifdef GLIBMM_VFUNCS_ENABLED
168 virtual void set_text_contents_vfunc(const Glib::ustring& string);
169 #endif //GLIBMM_VFUNCS_ENABLED
171 #ifdef GLIBMM_VFUNCS_ENABLED
172 virtual void insert_text_vfunc(const Glib::ustring& string, int length, int& position);
173 #endif //GLIBMM_VFUNCS_ENABLED
175 #ifdef GLIBMM_VFUNCS_ENABLED
176 virtual void copy_text_vfunc(int start_pos, int end_pos);
177 #endif //GLIBMM_VFUNCS_ENABLED
179 #ifdef GLIBMM_VFUNCS_ENABLED
180 virtual void cut_text_vfunc(int start_pos, int end_pos);
181 #endif //GLIBMM_VFUNCS_ENABLED
183 #ifdef GLIBMM_VFUNCS_ENABLED
184 virtual void delete_text_vfunc(int start_pos, int end_pos);
185 #endif //GLIBMM_VFUNCS_ENABLED
187 #ifdef GLIBMM_VFUNCS_ENABLED
188 virtual void paste_text_vfunc(int position);
189 #endif //GLIBMM_VFUNCS_ENABLED
195 //C++ methods used to invoke GTK+ virtual functions:
196 #ifdef GLIBMM_VFUNCS_ENABLED
197 #endif //GLIBMM_VFUNCS_ENABLED
200 //GTK+ Virtual Functions (override these to change behaviour):
201 #ifdef GLIBMM_VFUNCS_ENABLED
202 #endif //GLIBMM_VFUNCS_ENABLED
204 //Default Signal Handlers::
205 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
206 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
216 /** A Glib::wrap() method for this object.
218 * @param object The C instance.
219 * @param take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref.
220 * @result A C++ instance that wraps this C instance.
222 * @relates Atk::EditableText
224 Glib::RefPtr<Atk::EditableText> wrap(AtkEditableText* object, bool take_copy = false);
229 #endif /* _ATKMM_EDITABLETEXT_H */