2
// Generated by gtkmmproc -- DO NOT MODIFY!
3
#ifndef _GTKMM_ENTRYBUFFER_H
4
#define _GTKMM_ENTRYBUFFER_H
6
#include <gtkmmconfig.h>
11
/* $Id: entrybuffer.hg,v 1.20 2006/11/20 09:19:49 murrayc Exp $ */
13
/* Copyright(C) 1998-2002 The gtkmm Development Team
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.
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.
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.
30
// This is for including the config header before any code (such as
31
// the #ifndef GTKMM_DISABLE_DEPRECATED in deprecated classes) is generated:
34
#include <gtkmm/object.h>
35
#include <gtkmmconfig.h>
39
#ifndef DOXYGEN_SHOULD_SKIP_THIS
40
typedef struct _GtkEntryBuffer GtkEntryBuffer;
41
typedef struct _GtkEntryBufferClass GtkEntryBufferClass;
42
#endif /* DOXYGEN_SHOULD_SKIP_THIS */
46
{ class EntryBuffer_Class; } // namespace Gtk
50
/** A Text buffer for the Entry widget.
52
* The EntryBuffer class contains the actual text displayed in an Entry widget.
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.
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.
66
class EntryBuffer : public Glib::Object
69
#ifndef DOXYGEN_SHOULD_SKIP_THIS
72
typedef EntryBuffer CppObjectType;
73
typedef EntryBuffer_Class CppClassType;
74
typedef GtkEntryBuffer BaseObjectType;
75
typedef GtkEntryBufferClass BaseClassType;
77
private: friend class EntryBuffer_Class;
78
static CppClassType entrybuffer_class_;
82
EntryBuffer(const EntryBuffer&);
83
EntryBuffer& operator=(const EntryBuffer&);
86
explicit EntryBuffer(const Glib::ConstructParams& construct_params);
87
explicit EntryBuffer(GtkEntryBuffer* castitem);
89
#endif /* DOXYGEN_SHOULD_SKIP_THIS */
92
virtual ~EntryBuffer();
94
#ifndef DOXYGEN_SHOULD_SKIP_THIS
95
static GType get_type() G_GNUC_CONST;
98
static GType get_base_type() G_GNUC_CONST;
101
///Provides access to the underlying C GObject.
102
GtkEntryBuffer* gobj() { return reinterpret_cast<GtkEntryBuffer*>(gobject_); }
104
///Provides access to the underlying C GObject.
105
const GtkEntryBuffer* gobj() const { return reinterpret_cast<GtkEntryBuffer*>(gobject_); }
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();
114
/** Create a new EntryBuffer object with no text.
118
/** Create a new EntryBuffer object.
120
* @param text Initial buffer text.
122
explicit EntryBuffer(const Glib::ustring& text);
125
/** Create a new EntryBuffer object with no text.
128
static Glib::RefPtr<EntryBuffer> create();
131
/** Create a new EntryBuffer object.
133
* @param text Initial buffer text.
136
static Glib::RefPtr<EntryBuffer> create(const Glib::ustring& text);
139
/** Retrieves the length in bytes of the buffer.
143
* @return The byte length of the buffer.
145
gsize get_bytes() const;
147
/** Retrieves the length in characters of the buffer.
150
* @return The number of characters in the buffer.
152
guint get_length() const;
154
/** Retrieves the contents of the buffer.
156
* The memory pointer returned by this call will not change
157
* unless this object emits a signal, or is finalized.
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
165
Glib::ustring get_text() const;
167
/** Sets the text in the buffer.
168
* This is roughly equivalent to calling delete_text() and insert_text().
170
* @param text The text to set in the buffer.
172
void set_text(const Glib::ustring& text);
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.
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.
184
void set_max_length(int max_length);
186
/** Retrieves the maximum allowed length of the text in
187
* @a buffer. See set_max_length().
190
* @return The maximum allowed number of characters
191
* in Gtk::EntryBuffer, or 0 if there is no maximum.
193
int get_max_length() const;
195
/** Inserts @a text into the contents of the buffer, at position @a position.
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.
201
guint insert_text(guint position, const Glib::ustring& text);
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.
208
* If @a position or @a n_chars are out of bounds, then they are coerced to sane
211
* Note that the positions are specified in characters, not bytes.
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.
218
guint delete_text(guint position, int n_chars);
220
/** Used when deriving from EntryBuffer.
221
* @param position Position at which text was inserted.
222
* @param text Text that was inserted.
224
void emit_inserted_text(guint position, const Glib::ustring& text);
227
/** Used when subclassing Gtk::EntryBuffer
230
* @param position Position at which text was deleted.
231
* @param n_chars Number of characters deleted.
233
void emit_deleted_text(guint position, guint n_chars);
238
* <tt>void on_my_%inserted_text(guint position, const gchar* chars, guint n_chars)</tt>
241
Glib::SignalProxy3< void,guint,const gchar*,guint > signal_inserted_text();
246
* <tt>void on_my_%deleted_text(guint position, guint n_chars)</tt>
249
Glib::SignalProxy2< void,guint,guint > signal_deleted_text();
252
#ifdef GLIBMM_PROPERTIES_ENABLED
253
/** The contents of the buffer.
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.
259
Glib::PropertyProxy<Glib::ustring> property_text() ;
260
#endif //#GLIBMM_PROPERTIES_ENABLED
262
#ifdef GLIBMM_PROPERTIES_ENABLED
263
/** The contents of the buffer.
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.
269
Glib::PropertyProxy_ReadOnly<Glib::ustring> property_text() const;
270
#endif //#GLIBMM_PROPERTIES_ENABLED
272
#ifdef GLIBMM_PROPERTIES_ENABLED
273
/** Length of the text currently in the buffer.
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.
279
Glib::PropertyProxy_ReadOnly<guint> property_length() const;
280
#endif //#GLIBMM_PROPERTIES_ENABLED
283
#ifdef GLIBMM_PROPERTIES_ENABLED
284
/** Maximum number of characters for this entry. Zero if no maximum.
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.
290
Glib::PropertyProxy<int> property_max_length() ;
291
#endif //#GLIBMM_PROPERTIES_ENABLED
293
#ifdef GLIBMM_PROPERTIES_ENABLED
294
/** Maximum number of characters for this entry. Zero if no maximum.
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.
300
Glib::PropertyProxy_ReadOnly<int> property_max_length() const;
301
#endif //#GLIBMM_PROPERTIES_ENABLED
307
//C++ methods used to invoke GTK+ virtual functions:
310
//GTK+ Virtual Functions (override these to change behaviour):
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);
324
/** A Glib::wrap() method for this object.
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.
330
* @relates Gtk::EntryBuffer
332
Glib::RefPtr<Gtk::EntryBuffer> wrap(GtkEntryBuffer* object, bool take_copy = false);
336
#endif /* _GTKMM_ENTRYBUFFER_H */