2 // Generated by gtkmmproc -- DO NOT MODIFY!
3 #ifndef _GTKMM_EDITABLE_H
4 #define _GTKMM_EDITABLE_H
10 /* Copyright (C) 1998-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.
27 #include <glibmm/interface.h>
28 #include <gtk/gtkeditable.h>
31 #ifndef DOXYGEN_SHOULD_SKIP_THIS
32 typedef struct _GtkEditable GtkEditable;
33 typedef struct _GtkEditableClass GtkEditableClass;
34 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
38 { class Editable_Class; } // namespace Gtk
42 /** Base class for text-editing widgets.
44 * The Gtk::Editable class is a base class for widgets for editing text,
45 * such as Gtk::Entry. It cannot be instantiated by itself. The editable
46 * class contains functions for generically manipulating an editable widget,
47 * a large number of action signals used for key bindings, and several
48 * signals that an application can connect to to modify the behavior of a
53 class Editable : public Glib::Interface
56 #ifndef DOXYGEN_SHOULD_SKIP_THIS
59 typedef Editable CppObjectType;
60 typedef Editable_Class CppClassType;
61 typedef GtkEditable BaseObjectType;
62 typedef GtkEditableClass BaseClassType;
65 friend class Editable_Class;
66 static CppClassType editable_class_;
69 Editable(const Editable&);
70 Editable& operator=(const Editable&);
73 Editable(); // you must derive from this class
74 explicit Editable(GtkEditable* castitem);
76 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
81 static void add_interface(GType gtype_implementer);
83 #ifndef DOXYGEN_SHOULD_SKIP_THIS
84 static GType get_type() G_GNUC_CONST;
85 static GType get_base_type() G_GNUC_CONST;
88 ///Provides access to the underlying C GObject.
89 GtkEditable* gobj() { return reinterpret_cast<GtkEditable*>(gobject_); }
91 ///Provides access to the underlying C GObject.
92 const GtkEditable* gobj() const { return reinterpret_cast<GtkEditable*>(gobject_); }
101 void copy_clipboard();
103 void paste_clipboard();
105 void delete_selection();
107 void set_editable(bool is_editable = true);
109 /** Retrieves whether @a editable is editable. See
111 * @return <tt>true</tt> if @a editable is editable.
113 bool get_editable() const;
116 void insert_text(const Glib::ustring& text, int length, int& position);
118 void delete_text(int start_pos, int end_pos);
121 Glib::ustring get_chars(int start_pos, int end_pos) const;
124 void select_region(int start_pos, int end_pos);
126 bool get_selection_bounds(int& start_pos, int& end_pos) const;
129 void set_position(int position);
131 int get_position() const;
134 Glib::SignalProxy2< void,const Glib::ustring&,int* > signal_insert_text();
137 Glib::SignalProxy2< void,int,int > signal_delete_text();
140 Glib::SignalProxy0< void > signal_changed();
146 virtual void delete_text_vfunc(int start_pos, int end_pos);
149 virtual Glib::ustring get_chars_vfunc(int start_pos, int end_pos) const;
151 virtual void select_region_vfunc(int start_pos, int end_pos);
152 virtual bool get_selection_bounds_vfunc(int& start_pos, int& end_pos) const;
153 virtual void set_position_vfunc(int position);
154 virtual int get_position_vfunc() const;
160 //C++ methods used to invoke GTK+ virtual functions:
163 //GTK+ Virtual Functions (override these to change behaviour):
164 virtual void insert_text_vfunc(const Glib::ustring& text, int& position);
167 //Default Signal Handlers::
168 virtual void on_insert_text(const Glib::ustring& text, int* position);
169 virtual void on_delete_text(int start_pos, int end_pos);
170 virtual void on_changed();
180 /** @relates Gtk::Editable
181 * @param object The C instance
182 * @param take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref.
183 * @result A C++ instance that wraps this C instance.
185 Glib::RefPtr<Gtk::Editable> wrap(GtkEditable* object, bool take_copy = false);
189 #endif /* _GTKMM_EDITABLE_H */