add new sigc++2 directory
[ardour.git] / libs / gtkmm2 / atk / atkmm / editabletext.h
1 // -*- c++ -*-
2 // Generated by gtkmmproc -- DO NOT MODIFY!
3 #ifndef _ATKMM_EDITABLETEXT_H
4 #define _ATKMM_EDITABLETEXT_H
5
6
7 #include <glibmm.h>
8
9 /* $Id$ */
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 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.
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  * Library General Public License for more details.
22  *
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.
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 typedef struct _AtkEditableText AtkEditableText;
42 typedef struct _AtkEditableTextClass AtkEditableTextClass;
43 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
44
45
46 namespace Atk
47 { class EditableText_Class; } // namespace Atk
48 namespace Atk
49 {
50
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. 
57  */
58
59 class EditableText : public Glib::Interface
60 {
61   
62 #ifndef DOXYGEN_SHOULD_SKIP_THIS
63
64 public:
65   typedef EditableText CppObjectType;
66   typedef EditableText_Class CppClassType;
67   typedef AtkEditableText BaseObjectType;
68   typedef AtkEditableTextIface BaseClassType;
69
70 private:
71   friend class EditableText_Class;
72   static CppClassType editabletext_class_;
73
74   // noncopyable
75   EditableText(const EditableText&);
76   EditableText& operator=(const EditableText&);
77
78 protected:
79   EditableText(); // you must derive from this class
80
81 public:
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);
86
87 protected:
88 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
89
90 public:
91   virtual ~EditableText();
92
93   static void add_interface(GType gtype_implementer);
94
95 #ifndef DOXYGEN_SHOULD_SKIP_THIS
96   static GType get_type()      G_GNUC_CONST;
97   static GType get_base_type() G_GNUC_CONST;
98 #endif
99
100   ///Provides access to the underlying C GObject.
101   AtkEditableText*       gobj()       { return reinterpret_cast<AtkEditableText*>(gobject_); }
102
103   ///Provides access to the underlying C GObject.  
104   const AtkEditableText* gobj() const { return reinterpret_cast<AtkEditableText*>(gobject_); }
105
106 private:
107
108
109 public:
110   
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>.
120    */
121   bool set_run_attributes(const AttributeSet& attrib_set, int start_offset, int end_offset);
122   
123   /** Set text contents of @a text .
124    * @param string String to set for text contents of @a text .
125    */
126   void set_text_contents(const Glib::ustring& string);
127   
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.
134    */
135   void insert_text(const Glib::ustring& string, int length, int& position);
136   
137   /** Copy text from @a start_pos  up to, but not including @a end_pos  
138    * to the clipboard.
139    * @param start_pos Start position.
140    * @param end_pos End position.
141    */
142   void copy_text(int start_pos, int end_pos);
143   
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.
148    */
149   void cut_text(int start_pos, int end_pos);
150   
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.
154    */
155   void delete_text(int start_pos, int end_pos);
156   
157   /** Paste text from clipboard to specified @a position .
158    * @param position Position to paste.
159    */
160   void paste_text(int position);
161
162 protected:
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
166
167   #ifdef GLIBMM_VFUNCS_ENABLED
168   virtual void set_text_contents_vfunc(const Glib::ustring& string);
169 #endif //GLIBMM_VFUNCS_ENABLED
170
171   #ifdef GLIBMM_VFUNCS_ENABLED
172   virtual void insert_text_vfunc(const Glib::ustring& string, int length, int& position);
173 #endif //GLIBMM_VFUNCS_ENABLED
174
175   #ifdef GLIBMM_VFUNCS_ENABLED
176   virtual void copy_text_vfunc(int start_pos, int end_pos);
177 #endif //GLIBMM_VFUNCS_ENABLED
178
179   #ifdef GLIBMM_VFUNCS_ENABLED
180   virtual void cut_text_vfunc(int start_pos, int end_pos);
181 #endif //GLIBMM_VFUNCS_ENABLED
182
183   #ifdef GLIBMM_VFUNCS_ENABLED
184   virtual void delete_text_vfunc(int start_pos, int end_pos);
185 #endif //GLIBMM_VFUNCS_ENABLED
186
187   #ifdef GLIBMM_VFUNCS_ENABLED
188   virtual void paste_text_vfunc(int position);
189 #endif //GLIBMM_VFUNCS_ENABLED
190
191
192 public:
193
194 public:
195   //C++ methods used to invoke GTK+ virtual functions:
196 #ifdef GLIBMM_VFUNCS_ENABLED
197 #endif //GLIBMM_VFUNCS_ENABLED
198
199 protected:
200   //GTK+ Virtual Functions (override these to change behaviour):
201 #ifdef GLIBMM_VFUNCS_ENABLED
202 #endif //GLIBMM_VFUNCS_ENABLED
203
204   //Default Signal Handlers::
205 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
206 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
207
208
209 };
210
211 } // namespace Atk
212
213
214 namespace Glib
215 {
216   /** A Glib::wrap() method for this object.
217    * 
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.
221    *
222    * @relates Atk::EditableText
223    */
224   Glib::RefPtr<Atk::EditableText> wrap(AtkEditableText* object, bool take_copy = false);
225
226 } // namespace Glib
227
228
229 #endif /* _ATKMM_EDITABLETEXT_H */
230