2 // Generated by gtkmmproc -- DO NOT MODIFY!
3 #ifndef _GTKMM_EDITABLE_H
4 #define _GTKMM_EDITABLE_H
11 /* Copyright (C) 1998-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.
28 #include <glibmm/interface.h>
29 #include <gtk/gtkeditable.h>
32 #ifndef DOXYGEN_SHOULD_SKIP_THIS
33 typedef struct _GtkEditable GtkEditable;
34 typedef struct _GtkEditableClass GtkEditableClass;
35 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
39 { class Editable_Class; } // namespace Gtk
43 /** Base class for text-editing widgets.
45 * The Gtk::Editable class is a base class for widgets for editing text,
46 * such as Gtk::Entry. It cannot be instantiated by itself. The editable
47 * class contains functions for generically manipulating an editable widget,
48 * a large number of action signals used for key bindings, and several
49 * signals that an application can connect to to modify the behavior of a
54 class Editable : public Glib::Interface
57 #ifndef DOXYGEN_SHOULD_SKIP_THIS
60 typedef Editable CppObjectType;
61 typedef Editable_Class CppClassType;
62 typedef GtkEditable BaseObjectType;
63 typedef GtkEditableClass BaseClassType;
66 friend class Editable_Class;
67 static CppClassType editable_class_;
70 Editable(const Editable&);
71 Editable& operator=(const Editable&);
74 Editable(); // you must derive from this class
75 explicit Editable(GtkEditable* castitem);
77 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
82 static void add_interface(GType gtype_implementer);
84 #ifndef DOXYGEN_SHOULD_SKIP_THIS
85 static GType get_type() G_GNUC_CONST;
86 static GType get_base_type() G_GNUC_CONST;
89 ///Provides access to the underlying C GObject.
90 GtkEditable* gobj() { return reinterpret_cast<GtkEditable*>(gobject_); }
92 ///Provides access to the underlying C GObject.
93 const GtkEditable* gobj() const { return reinterpret_cast<GtkEditable*>(gobject_); }
100 void cut_clipboard();
102 void copy_clipboard();
104 void paste_clipboard();
106 void delete_selection();
108 void set_editable(bool is_editable = true);
110 /** Retrieves whether @a editable is editable. See
112 * @return <tt>true</tt> if @a editable is editable.
114 bool get_editable() const;
117 void insert_text(const Glib::ustring& text, int length, int& position);
119 void delete_text(int start_pos, int end_pos);
122 Glib::ustring get_chars(int start_pos, int end_pos) const;
125 void select_region(int start_pos, int end_pos);
127 bool get_selection_bounds(int& start_pos, int& end_pos) const;
130 void set_position(int position);
132 int get_position() const;
135 Glib::SignalProxy2< void,const Glib::ustring&,int* > signal_insert_text();
140 * <tt>void %delete_text(int start_pos, int end_pos)</tt>
143 Glib::SignalProxy2< void,int,int > signal_delete_text();
148 * <tt>void %changed()</tt>
151 Glib::SignalProxy0< void > signal_changed();
157 #ifdef GLIBMM_VFUNCS_ENABLED
158 virtual void delete_text_vfunc(int start_pos, int end_pos);
159 #endif //GLIBMM_VFUNCS_ENABLED
162 #ifdef GLIBMM_VFUNCS_ENABLED
163 virtual Glib::ustring get_chars_vfunc(int start_pos, int end_pos) const;
164 #endif //GLIBMM_VFUNCS_ENABLED
167 #ifdef GLIBMM_VFUNCS_ENABLED
168 virtual void select_region_vfunc(int start_pos, int end_pos);
169 #endif //GLIBMM_VFUNCS_ENABLED
171 #ifdef GLIBMM_VFUNCS_ENABLED
172 virtual bool get_selection_bounds_vfunc(int& start_pos, int& end_pos) const;
173 #endif //GLIBMM_VFUNCS_ENABLED
175 #ifdef GLIBMM_VFUNCS_ENABLED
176 virtual void set_position_vfunc(int position);
177 #endif //GLIBMM_VFUNCS_ENABLED
179 #ifdef GLIBMM_VFUNCS_ENABLED
180 virtual int get_position_vfunc() const;
181 #endif //GLIBMM_VFUNCS_ENABLED
187 //C++ methods used to invoke GTK+ virtual functions:
188 #ifdef GLIBMM_VFUNCS_ENABLED
189 #endif //GLIBMM_VFUNCS_ENABLED
192 //GTK+ Virtual Functions (override these to change behaviour):
193 #ifdef GLIBMM_VFUNCS_ENABLED
194 virtual void insert_text_vfunc(const Glib::ustring& text, int& position);
196 #endif //GLIBMM_VFUNCS_ENABLED
198 //Default Signal Handlers::
199 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
200 virtual void on_insert_text(const Glib::ustring& text, int* position);
201 virtual void on_delete_text(int start_pos, int end_pos);
202 virtual void on_changed();
203 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
213 /** @relates Gtk::Editable
214 * @param object The C instance
215 * @param take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref.
216 * @result A C++ instance that wraps this C instance.
218 Glib::RefPtr<Gtk::Editable> wrap(GtkEditable* object, bool take_copy = false);
223 #endif /* _GTKMM_EDITABLE_H */