fix for type error on 64 bit systems
[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 #include <glibmm.h>
7
8 /* $Id$ */
9
10 /* Copyright (C) 2002 The gtkmm Development Team
11  *
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.
16  *
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.
21  *
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.
25  */
26
27
28 #include <atkmm/text.h>
29
30 #ifndef DOXYGEN_SHOULD_SKIP_THIS
31 extern "C"
32 {
33   typedef struct _AtkEditableTextIface AtkEditableTextIface;
34   typedef struct _AtkEditableText      AtkEditableText;
35 }
36 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
37
38
39 #ifndef DOXYGEN_SHOULD_SKIP_THIS
40 typedef struct _AtkEditableText AtkEditableText;
41 typedef struct _AtkEditableTextClass AtkEditableTextClass;
42 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
43
44
45 namespace Atk
46 { class EditableText_Class; } // namespace Atk
47 namespace Atk
48 {
49
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. 
56  */
57
58 class EditableText : public Glib::Interface
59 {
60   
61 #ifndef DOXYGEN_SHOULD_SKIP_THIS
62
63 public:
64   typedef EditableText CppObjectType;
65   typedef EditableText_Class CppClassType;
66   typedef AtkEditableText BaseObjectType;
67   typedef AtkEditableTextIface BaseClassType;
68
69 private:
70   friend class EditableText_Class;
71   static CppClassType editabletext_class_;
72
73   // noncopyable
74   EditableText(const EditableText&);
75   EditableText& operator=(const EditableText&);
76
77 protected:
78   EditableText(); // you must derive from this class
79   explicit EditableText(AtkEditableText* castitem);
80
81 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
82
83 public:
84   virtual ~EditableText();
85
86   static void add_interface(GType gtype_implementer);
87
88 #ifndef DOXYGEN_SHOULD_SKIP_THIS
89   static GType get_type()      G_GNUC_CONST;
90   static GType get_base_type() G_GNUC_CONST;
91 #endif
92
93   ///Provides access to the underlying C GObject.
94   AtkEditableText*       gobj()       { return reinterpret_cast<AtkEditableText*>(gobject_); }
95
96   ///Provides access to the underlying C GObject.  
97   const AtkEditableText* gobj() const { return reinterpret_cast<AtkEditableText*>(gobject_); }
98
99 private:
100
101
102 public:
103   
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>.
113    */
114   bool set_run_attributes(const AttributeSet& attrib_set, int start_offset, int end_offset);
115   
116   /** Set text contents of @a text .
117    * @param string String to set for text contents of @a text .
118    */
119   void set_text_contents(const Glib::ustring& string);
120   
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.
127    */
128   void insert_text(const Glib::ustring& string, int length, int& position);
129   
130   /** Copy text from @a start_pos  up to, but not including @a end_pos  
131    * to the clipboard.
132    * @param start_pos Start position.
133    * @param end_pos End position.
134    */
135   void copy_text(int start_pos, int end_pos);
136   
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.
141    */
142   void cut_text(int start_pos, int end_pos);
143   
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.
147    */
148   void delete_text(int start_pos, int end_pos);
149   
150   /** Paste text from clipboard to specified @a position .
151    * @param position Position to paste.
152    */
153   void paste_text(int position);
154
155 protected:
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);
163
164
165 public:
166
167 public:
168   //C++ methods used to invoke GTK+ virtual functions:
169
170 protected:
171   //GTK+ Virtual Functions (override these to change behaviour):
172
173   //Default Signal Handlers::
174
175
176 };
177
178 } // namespace Atk
179
180
181 namespace Glib
182 {
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.
187    */
188   Glib::RefPtr<Atk::EditableText> wrap(AtkEditableText* object, bool take_copy = false);
189
190 } // namespace Glib
191
192 #endif /* _ATKMM_EDITABLETEXT_H */
193