2 // Generated by gtkmmproc -- DO NOT MODIFY!
3 #ifndef _ATKMM_EDITABLETEXT_H
4 #define _ATKMM_EDITABLETEXT_H
10 /* Copyright (C) 2002 The gtkmm Development Team
12 * This library is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU Library General Public
14 * License as published by the Free Software Foundation; either
15 * version 2 of the License, or (at your option) any later version.
17 * This library is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 * Library General Public License for more details.
22 * You should have received a copy of the GNU Library General Public
23 * License along with this library; if not, write to the Free
24 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
28 #include <atkmm/text.h>
30 #ifndef DOXYGEN_SHOULD_SKIP_THIS
33 typedef struct _AtkEditableTextIface AtkEditableTextIface;
34 typedef struct _AtkEditableText AtkEditableText;
36 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
39 #ifndef DOXYGEN_SHOULD_SKIP_THIS
40 typedef struct _AtkEditableText AtkEditableText;
41 typedef struct _AtkEditableTextClass AtkEditableTextClass;
42 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
46 { class EditableText_Class; } // namespace Atk
50 //TODO: I see no evidence that AtkEditableText is actually a subclass of AtkText, as the C docs say. murrayc.
51 /* The ATK interface implemented by components containing user-editable text content.
52 * This should be implemented by UI components which contain text which the user can edit, via the Atk::Object
53 * corresponding to that component (see Atk::Object).
54 * EditableText is a subclass of AtkText, and as such, an object which implements EditableText is by definition
55 * an Atk::Text implementor as well.
58 class EditableText : public Glib::Interface
61 #ifndef DOXYGEN_SHOULD_SKIP_THIS
64 typedef EditableText CppObjectType;
65 typedef EditableText_Class CppClassType;
66 typedef AtkEditableText BaseObjectType;
67 typedef AtkEditableTextIface BaseClassType;
70 friend class EditableText_Class;
71 static CppClassType editabletext_class_;
74 EditableText(const EditableText&);
75 EditableText& operator=(const EditableText&);
78 EditableText(); // you must derive from this class
79 explicit EditableText(AtkEditableText* castitem);
81 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
84 virtual ~EditableText();
86 static void add_interface(GType gtype_implementer);
88 #ifndef DOXYGEN_SHOULD_SKIP_THIS
89 static GType get_type() G_GNUC_CONST;
90 static GType get_base_type() G_GNUC_CONST;
93 ///Provides access to the underlying C GObject.
94 AtkEditableText* gobj() { return reinterpret_cast<AtkEditableText*>(gobject_); }
96 ///Provides access to the underlying C GObject.
97 const AtkEditableText* gobj() const { return reinterpret_cast<AtkEditableText*>(gobject_); }
104 /** Sets the attributes for a specified range. See the ATK_ATTRIBUTE
105 * macros (such as Atk::ATTRIBUTE_LEFT_MARGIN) for examples of attributes
106 * that can be set. Note that other attributes that do not have corresponding
107 * ATK_ATTRIBUTE macros may also be set for certain text widgets.
108 * @param attrib_set An Atk::AttributeSet.
109 * @param start_offset Start of range in which to set attributes.
110 * @param end_offset End of range in which to set attributes.
111 * @return <tt>true</tt> if attributes successfully set for the specified
112 * range, otherwise <tt>false</tt>.
114 bool set_run_attributes(const AttributeSet& attrib_set, int start_offset, int end_offset);
116 /** Set text contents of @a text .
117 * @param string String to set for text contents of @a text .
119 void set_text_contents(const Glib::ustring& string);
121 /** Insert text at a given position.
122 * @param string The text to insert.
123 * @param length The length of text to insert, in bytes.
124 * @param position The caller initializes this to
125 * the position at which to insert the text. After the call it
126 * points at the position after the newly inserted text.
128 void insert_text(const Glib::ustring& string, int length, int& position);
130 /** Copy text from @a start_pos up to, but not including @a end_pos
132 * @param start_pos Start position.
133 * @param end_pos End position.
135 void copy_text(int start_pos, int end_pos);
137 /** Copy text from @a start_pos up to, but not including @a end_pos
138 * to the clipboard and then delete from the widget.
139 * @param start_pos Start position.
140 * @param end_pos End position.
142 void cut_text(int start_pos, int end_pos);
144 /** Delete text @a start_pos up to, but not including @a end_pos .
145 * @param start_pos Start position.
146 * @param end_pos End position.
148 void delete_text(int start_pos, int end_pos);
150 /** Paste text from clipboard to specified @a position .
151 * @param position Position to paste.
153 void paste_text(int position);
156 virtual bool set_run_attributes_vfunc(AtkAttributeSet* attrib_set, int start_offset, int end_offset);
157 virtual void set_text_contents_vfunc(const Glib::ustring& string);
158 virtual void insert_text_vfunc(const Glib::ustring& string, int length, int& position);
159 virtual void copy_text_vfunc(int start_pos, int end_pos);
160 virtual void cut_text_vfunc(int start_pos, int end_pos);
161 virtual void delete_text_vfunc(int start_pos, int end_pos);
162 virtual void paste_text_vfunc(int position);
168 //C++ methods used to invoke GTK+ virtual functions:
171 //GTK+ Virtual Functions (override these to change behaviour):
173 //Default Signal Handlers::
183 /** @relates Atk::EditableText
184 * @param object The C instance
185 * @param take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref.
186 * @result A C++ instance that wraps this C instance.
188 Glib::RefPtr<Atk::EditableText> wrap(AtkEditableText* object, bool take_copy = false);
192 #endif /* _ATKMM_EDITABLETEXT_H */