~inkscape.dev/inkscape-devlibs/devlibs-gtk3

« back to all changes in this revision

Viewing changes to include/gtkmm-2.4/gtkmm/entrybuffer.h

  • Committer: JazzyNico
  • Date: 2013-01-21 10:11:05 UTC
  • Revision ID: nicoduf@yahoo.fr-20130121101105-i8d8slkq9ng4olx8
Adding gtk2 libraries.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// -*- c++ -*-
 
2
// Generated by gtkmmproc -- DO NOT MODIFY!
 
3
#ifndef _GTKMM_ENTRYBUFFER_H
 
4
#define _GTKMM_ENTRYBUFFER_H
 
5
 
 
6
#include <gtkmmconfig.h>
 
7
 
 
8
 
 
9
#include <glibmm.h>
 
10
 
 
11
/* $Id: entrybuffer.hg,v 1.20 2006/11/20 09:19:49 murrayc Exp $ */
 
12
 
 
13
/* Copyright(C) 1998-2002 The gtkmm Development Team
 
14
 *
 
15
 * This library is free software; you can redistribute it and/or
 
16
 * modify it under the terms of the GNU Lesser General Public
 
17
 * License as published by the Free Software Foundation; either
 
18
 * version 2.1 of the License, or(at your option) any later version.
 
19
 *
 
20
 * This library is distributed in the hope that it will be useful,
 
21
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
22
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
23
 * Lesser General Public License for more details.
 
24
 *
 
25
 * You should have received a copy of the GNU Lesser General Public
 
26
 * License along with this library; if not, write to the Free
 
27
 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
28
 */
 
29
 
 
30
// This is for including the config header before any code (such as
 
31
// the #ifndef GTKMM_DISABLE_DEPRECATED in deprecated classes) is generated:
 
32
 
 
33
 
 
34
#include <gtkmm/object.h>
 
35
#include <gtkmmconfig.h>
 
36
#include <utility>
 
37
 
 
38
 
 
39
#ifndef DOXYGEN_SHOULD_SKIP_THIS
 
40
typedef struct _GtkEntryBuffer GtkEntryBuffer;
 
41
typedef struct _GtkEntryBufferClass GtkEntryBufferClass;
 
42
#endif /* DOXYGEN_SHOULD_SKIP_THIS */
 
43
 
 
44
 
 
45
namespace Gtk
 
46
{ class EntryBuffer_Class; } // namespace Gtk
 
47
namespace Gtk
 
48
{
 
49
 
 
50
/** A Text buffer for the Entry widget.
 
51
 *
 
52
 * The EntryBuffer class contains the actual text displayed in an Entry widget.
 
53
 *
 
54
 * A single EntryBuffer object can be shared by multiple Entry
 
55
 * widgets which will then share the same text content, but not the cursor
 
56
 * position, visibility attributes, icon etc.
 
57
 *
 
58
 * EntryBuffer may be derived from. Such a derived class might allow
 
59
 * text to be stored in an alternate location, such as non-pageable memory,
 
60
 * useful in the case of important passwords. Or a derived class could 
 
61
 * integrate with an application's concept of undo/redo.
 
62
 *
 
63
 * @@newin{2,20}
 
64
 */
 
65
 
 
66
class EntryBuffer : public Glib::Object
 
67
{
 
68
   
 
69
#ifndef DOXYGEN_SHOULD_SKIP_THIS
 
70
 
 
71
public:
 
72
  typedef EntryBuffer CppObjectType;
 
73
  typedef EntryBuffer_Class CppClassType;
 
74
  typedef GtkEntryBuffer BaseObjectType;
 
75
  typedef GtkEntryBufferClass BaseClassType;
 
76
 
 
77
private:  friend class EntryBuffer_Class;
 
78
  static CppClassType entrybuffer_class_;
 
79
 
 
80
private:
 
81
  // noncopyable
 
82
  EntryBuffer(const EntryBuffer&);
 
83
  EntryBuffer& operator=(const EntryBuffer&);
 
84
 
 
85
protected:
 
86
  explicit EntryBuffer(const Glib::ConstructParams& construct_params);
 
87
  explicit EntryBuffer(GtkEntryBuffer* castitem);
 
88
 
 
89
#endif /* DOXYGEN_SHOULD_SKIP_THIS */
 
90
 
 
91
public:
 
92
  virtual ~EntryBuffer();
 
93
 
 
94
#ifndef DOXYGEN_SHOULD_SKIP_THIS
 
95
  static GType get_type()      G_GNUC_CONST;
 
96
 
 
97
 
 
98
  static GType get_base_type() G_GNUC_CONST;
 
99
#endif
 
100
 
 
101
  ///Provides access to the underlying C GObject.
 
102
  GtkEntryBuffer*       gobj()       { return reinterpret_cast<GtkEntryBuffer*>(gobject_); }
 
103
 
 
104
  ///Provides access to the underlying C GObject.
 
105
  const GtkEntryBuffer* gobj() const { return reinterpret_cast<GtkEntryBuffer*>(gobject_); }
 
106
 
 
107
  ///Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.
 
108
  GtkEntryBuffer* gobj_copy();
 
109
 
 
110
private:
 
111
 
 
112
protected:
 
113
 
 
114
  /** Create a new EntryBuffer object with no text.
 
115
   */
 
116
  EntryBuffer();
 
117
 
 
118
  /** Create a new EntryBuffer object.
 
119
   *
 
120
   * @param text Initial buffer text.
 
121
   */
 
122
  explicit EntryBuffer(const Glib::ustring& text);
 
123
 
 
124
public:
 
125
  /** Create a new EntryBuffer object with no text.
 
126
   */
 
127
  
 
128
  static Glib::RefPtr<EntryBuffer> create();
 
129
 
 
130
 
 
131
  /** Create a new EntryBuffer object.
 
132
   *
 
133
   * @param text Initial buffer text.
 
134
   */
 
135
  
 
136
  static Glib::RefPtr<EntryBuffer> create(const Glib::ustring& text);
 
137
 
 
138
 
 
139
  /** Retrieves the length in bytes of the buffer.
 
140
   * See get_length().
 
141
   * 
 
142
   * @newin{2,18}
 
143
   * @return The byte length of the buffer.
 
144
   */
 
145
  gsize get_bytes() const;
 
146
  
 
147
  /** Retrieves the length in characters of the buffer.
 
148
   * 
 
149
   * @newin{2,18}
 
150
   * @return The number of characters in the buffer.
 
151
   */
 
152
  guint get_length() const;
 
153
  
 
154
  /** Retrieves the contents of the buffer.
 
155
   * 
 
156
   * The memory pointer returned by this call will not change
 
157
   * unless this object emits a signal, or is finalized.
 
158
   * 
 
159
   * @newin{2,18}
 
160
   * @return A pointer to the contents of the widget as a
 
161
   * string. This string points to internally allocated
 
162
   * storage in the buffer and must not be freed, modified or
 
163
   * stored.
 
164
   */
 
165
  Glib::ustring get_text() const;
 
166
 
 
167
  /** Sets the text in the buffer.
 
168
   * This is roughly equivalent to calling delete_text() and insert_text().
 
169
   *
 
170
   * @param text The text to set in the buffer.
 
171
   */
 
172
  void set_text(const Glib::ustring& text);
 
173
  
 
174
 
 
175
  /** Sets the maximum allowed length of the contents of the buffer. If
 
176
   * the current contents are longer than the given length, then they
 
177
   * will be truncated to fit.
 
178
   * 
 
179
   * @newin{2,18}
 
180
   * @param max_length The maximum length of the entry buffer, or 0 for no maximum.
 
181
   * (other than the maximum length of entries.) The value passed in will
 
182
   * be clamped to the range 0-65536.
 
183
   */
 
184
  void set_max_length(int max_length);
 
185
  
 
186
  /** Retrieves the maximum allowed length of the text in
 
187
   *  @a buffer. See set_max_length().
 
188
   * 
 
189
   * @newin{2,18}
 
190
   * @return The maximum allowed number of characters
 
191
   * in Gtk::EntryBuffer, or 0 if there is no maximum.
 
192
   */
 
193
  int get_max_length() const;
 
194
 
 
195
  /** Inserts @a text into the contents of the buffer, at position @a position.
 
196
   *
 
197
   * @param position The position at which to insert text.
 
198
   * @param text The text to insert into the buffer.
 
199
   * @result The number of characters actually inserted.
 
200
   */
 
201
  guint insert_text(guint position, const Glib::ustring& text);
 
202
  
 
203
 
 
204
  /** Deletes a sequence of characters from the buffer. @a n_chars characters are
 
205
   * deleted starting at @a position. If @a n_chars is negative, then all characters
 
206
   * until the end of the text are deleted.
 
207
   * 
 
208
   * If @a position or @a n_chars are out of bounds, then they are coerced to sane
 
209
   * values.
 
210
   * 
 
211
   * Note that the positions are specified in characters, not bytes.
 
212
   * 
 
213
   * @newin{2,18}
 
214
   * @param position Position at which to delete text.
 
215
   * @param n_chars Number of characters to delete.
 
216
   * @return The number of characters deleted.
 
217
   */
 
218
  guint delete_text(guint position, int n_chars);
 
219
 
 
220
  /** Used when deriving from EntryBuffer.
 
221
   * @param position Position at which text was inserted.
 
222
   * @param text Text that was inserted.
 
223
   */
 
224
  void emit_inserted_text(guint position, const Glib::ustring& text);
 
225
  
 
226
 
 
227
  /** Used when subclassing Gtk::EntryBuffer
 
228
   * 
 
229
   * @newin{2,18}
 
230
   * @param position Position at which text was deleted.
 
231
   * @param n_chars Number of characters deleted.
 
232
   */
 
233
  void emit_deleted_text(guint position, guint n_chars);
 
234
 
 
235
  
 
236
  /**
 
237
   * @par Prototype:
 
238
   * <tt>void on_my_%inserted_text(guint position, const gchar* chars, guint n_chars)</tt>
 
239
   */
 
240
 
 
241
  Glib::SignalProxy3< void,guint,const gchar*,guint > signal_inserted_text();
 
242
 
 
243
  
 
244
  /**
 
245
   * @par Prototype:
 
246
   * <tt>void on_my_%deleted_text(guint position, guint n_chars)</tt>
 
247
   */
 
248
 
 
249
  Glib::SignalProxy2< void,guint,guint > signal_deleted_text();
 
250
 
 
251
 
 
252
  #ifdef GLIBMM_PROPERTIES_ENABLED
 
253
/** The contents of the buffer.
 
254
   *
 
255
   * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
 
256
   * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
 
257
   * the value of the property changes.
 
258
   */
 
259
  Glib::PropertyProxy<Glib::ustring> property_text() ;
 
260
#endif //#GLIBMM_PROPERTIES_ENABLED
 
261
 
 
262
#ifdef GLIBMM_PROPERTIES_ENABLED
 
263
/** The contents of the buffer.
 
264
   *
 
265
   * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
 
266
   * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
 
267
   * the value of the property changes.
 
268
   */
 
269
  Glib::PropertyProxy_ReadOnly<Glib::ustring> property_text() const;
 
270
#endif //#GLIBMM_PROPERTIES_ENABLED
 
271
 
 
272
  #ifdef GLIBMM_PROPERTIES_ENABLED
 
273
/** Length of the text currently in the buffer.
 
274
   *
 
275
   * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
 
276
   * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
 
277
   * the value of the property changes.
 
278
   */
 
279
  Glib::PropertyProxy_ReadOnly<guint> property_length() const;
 
280
#endif //#GLIBMM_PROPERTIES_ENABLED
 
281
 
 
282
 
 
283
  #ifdef GLIBMM_PROPERTIES_ENABLED
 
284
/** Maximum number of characters for this entry. Zero if no maximum.
 
285
   *
 
286
   * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
 
287
   * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
 
288
   * the value of the property changes.
 
289
   */
 
290
  Glib::PropertyProxy<int> property_max_length() ;
 
291
#endif //#GLIBMM_PROPERTIES_ENABLED
 
292
 
 
293
#ifdef GLIBMM_PROPERTIES_ENABLED
 
294
/** Maximum number of characters for this entry. Zero if no maximum.
 
295
   *
 
296
   * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
 
297
   * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
 
298
   * the value of the property changes.
 
299
   */
 
300
  Glib::PropertyProxy_ReadOnly<int> property_max_length() const;
 
301
#endif //#GLIBMM_PROPERTIES_ENABLED
 
302
 
 
303
 
 
304
public:
 
305
 
 
306
public:
 
307
  //C++ methods used to invoke GTK+ virtual functions:
 
308
 
 
309
protected:
 
310
  //GTK+ Virtual Functions (override these to change behaviour):
 
311
 
 
312
  //Default Signal Handlers::
 
313
  virtual void on_inserted_text(guint position, const gchar* chars, guint n_chars);
 
314
  virtual void on_deleted_text(guint position, guint n_chars);
 
315
 
 
316
 
 
317
};
 
318
 
 
319
} // namespace Gtk
 
320
 
 
321
 
 
322
namespace Glib
 
323
{
 
324
  /** A Glib::wrap() method for this object.
 
325
   * 
 
326
   * @param object The C instance.
 
327
   * @param take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref.
 
328
   * @result A C++ instance that wraps this C instance.
 
329
   *
 
330
   * @relates Gtk::EntryBuffer
 
331
   */
 
332
  Glib::RefPtr<Gtk::EntryBuffer> wrap(GtkEntryBuffer* object, bool take_copy = false);
 
333
}
 
334
 
 
335
 
 
336
#endif /* _GTKMM_ENTRYBUFFER_H */
 
337