1 // Generated by gmmproc 2.56.0 -- DO NOT MODIFY! 2 #ifndef _ATKMM_EDITABLETEXT_H 3 #define _ATKMM_EDITABLETEXT_H 4 5 6 #include <glibmm/ustring.h> 7 #include <sigc++/sigc++.h> 8 9 /* $Id: editabletext.hg,v 1.2 2004/01/02 09:56:43 murrayc Exp $ */ 10 11 /* Copyright (C) 2002 The gtkmm Development Team 12 * 13 * This library is free software; you can redistribute it and/or 14 * modify it under the terms of the GNU Lesser General Public 15 * License as published by the Free Software Foundation; either 16 * version 2.1 of the License, or (at your option) any later version. 17 * 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 * Lesser General Public License for more details. 22 * 23 * You should have received a copy of the GNU Lesser 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. 26 */ 27 28 29 #include <atkmm/text.h> 30 31 #ifndef DOXYGEN_SHOULD_SKIP_THIS 32 extern "C" 33 { 34 typedef struct _AtkEditableTextIface AtkEditableTextIface; 35 typedef struct _AtkEditableText AtkEditableText; 36 } 37 #endif /* DOXYGEN_SHOULD_SKIP_THIS */ 38 39 40 #ifndef DOXYGEN_SHOULD_SKIP_THIS 41 using AtkEditableText = struct _AtkEditableText; 42 using AtkEditableTextClass = struct _AtkEditableTextClass; 43 #endif /* DOXYGEN_SHOULD_SKIP_THIS */ 44 45 46 #ifndef DOXYGEN_SHOULD_SKIP_THIS 47 namespace Atk 48 { class EditableText_Class; } // namespace Atk 49 #endif // DOXYGEN_SHOULD_SKIP_THIS 50 51 namespace Atk 52 { 53 54 //TODO: I see no evidence that AtkEditableText is actually a subclass of AtkText, as the C docs say. murrayc. 55 /* The ATK interface implemented by components containing user-editable text content. 56 * This should be implemented by UI components which contain text which the user can edit, via the Atk::Object 57 * corresponding to that component (see Atk::Object). 58 * EditableText is a subclass of AtkText, and as such, an object which implements EditableText is by definition 59 * an Atk::Text implementor as well. 60 */ 61 62 class EditableText : public Glib::Interface 63 { 64 65 #ifndef DOXYGEN_SHOULD_SKIP_THIS 66 67 public: 68 using CppObjectType = EditableText; 69 using CppClassType = EditableText_Class; 70 using BaseObjectType = AtkEditableText; 71 using BaseClassType = AtkEditableTextIface; 72 73 // noncopyable 74 EditableText(const EditableText&) = delete; 75 EditableText& operator=(const EditableText&) = delete; 76 77 private: 78 friend class EditableText_Class; 79 static CppClassType editabletext_class_; 80 81 #endif /* DOXYGEN_SHOULD_SKIP_THIS */ 82 protected: 83 /** 84 * You should derive from this class to use it. 85 */ 86 EditableText(); 87 88 #ifndef DOXYGEN_SHOULD_SKIP_THIS 89 /** Called by constructors of derived classes. Provide the result of 90 * the Class init() function to ensure that it is properly 91 * initialized. 92 * 93 * @param interface_class The Class object for the derived type. 94 */ 95 explicit EditableText(const Glib::Interface_Class& interface_class); 96 97 public: 98 // This is public so that C++ wrapper instances can be 99 // created for C instances of unwrapped types. 100 // For instance, if an unexpected C type implements the C interface. 101 explicit EditableText(AtkEditableText* castitem); 102 103 protected: 104 #endif /* DOXYGEN_SHOULD_SKIP_THIS */ 105 106 public: 107 108 EditableText(EditableText&& src) noexcept; 109 EditableText& operator=(EditableText&& src) noexcept; 110 111 ~EditableText() noexcept override; 112 113 static void add_interface(GType gtype_implementer); 114 115 /** Get the GType for this class, for use with the underlying GObject type system. 116 */ 117 static GType get_type() G_GNUC_CONST; 118 119 #ifndef DOXYGEN_SHOULD_SKIP_THIS 120 static GType get_base_type() G_GNUC_CONST; 121 #endif 122 123 ///Provides access to the underlying C GObject. gobj()124 AtkEditableText* gobj() { return reinterpret_cast<AtkEditableText*>(gobject_); } 125 126 ///Provides access to the underlying C GObject. gobj()127 const AtkEditableText* gobj() const { return reinterpret_cast<AtkEditableText*>(gobject_); } 128 129 private: 130 131 132 public: 133 134 /** Sets the attributes for a specified range. See the ATK_ATTRIBUTE 135 * macros (such as Atk::ATTRIBUTE_LEFT_MARGIN) for examples of attributes 136 * that can be set. Note that other attributes that do not have corresponding 137 * ATK_ATTRIBUTE macros may also be set for certain text widgets. 138 * 139 * @param attrib_set An Atk::AttributeSet. 140 * @param start_offset Start of range in which to set attributes. 141 * @param end_offset End of range in which to set attributes. 142 * @return <tt>true</tt> if attributes successfully set for the specified 143 * range, otherwise <tt>false</tt>. 144 */ 145 bool set_run_attributes(const AttributeSet& attrib_set, int start_offset, int end_offset); 146 147 /** Set text contents of @a text. 148 * 149 * @param string String to set for text contents of @a text. 150 */ 151 void set_text_contents(const Glib::ustring& string); 152 153 /** Insert text at a given position. 154 * 155 * @param string The text to insert. 156 * @param length The length of text to insert, in bytes. 157 * @param position The caller initializes this to 158 * the position at which to insert the text. After the call it 159 * points at the position after the newly inserted text. 160 */ 161 void insert_text(const Glib::ustring& string, int length, int& position); 162 163 /** Copy text from @a start_pos up to, but not including @a end_pos 164 * to the clipboard. 165 * 166 * @param start_pos Start position. 167 * @param end_pos End position. 168 */ 169 void copy_text(int start_pos, int end_pos); 170 171 /** Copy text from @a start_pos up to, but not including @a end_pos 172 * to the clipboard and then delete from the widget. 173 * 174 * @param start_pos Start position. 175 * @param end_pos End position. 176 */ 177 void cut_text(int start_pos, int end_pos); 178 179 /** Delete text @a start_pos up to, but not including @a end_pos. 180 * 181 * @param start_pos Start position. 182 * @param end_pos End position. 183 */ 184 void delete_text(int start_pos, int end_pos); 185 186 /** Paste text from clipboard to specified @a position. 187 * 188 * @param position Position to paste. 189 */ 190 void paste_text(int position); 191 192 protected: 193 virtual bool set_run_attributes_vfunc(AtkAttributeSet* attrib_set, int start_offset, int end_offset); 194 195 196 virtual void set_text_contents_vfunc(const Glib::ustring& string); 197 198 199 virtual void insert_text_vfunc(const Glib::ustring& string, int length, int& position); 200 201 virtual void copy_text_vfunc(int start_pos, int end_pos); 202 203 virtual void cut_text_vfunc(int start_pos, int end_pos); 204 205 virtual void delete_text_vfunc(int start_pos, int end_pos); 206 207 virtual void paste_text_vfunc(int position); 208 209 210 public: 211 212 public: 213 //C++ methods used to invoke GTK+ virtual functions: 214 215 protected: 216 //GTK+ Virtual Functions (override these to change behaviour): 217 218 //Default Signal Handlers:: 219 220 221 }; 222 223 } // namespace Atk 224 225 226 namespace Glib 227 { 228 /** A Glib::wrap() method for this object. 229 * 230 * @param object The C instance. 231 * @param take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref. 232 * @result A C++ instance that wraps this C instance. 233 * 234 * @relates Atk::EditableText 235 */ 236 Glib::RefPtr<Atk::EditableText> wrap(AtkEditableText* object, bool take_copy = false); 237 238 } // namespace Glib 239 240 241 #endif /* _ATKMM_EDITABLETEXT_H */ 242 243