cluttermm: Clutter::TextBuffer Class Reference

Inheritance diagram for Clutter::TextBuffer:
Collaboration diagram for Clutter::TextBuffer:

Public Member Functions

virtual ~TextBuffer ()
 
ClutterTextBuffer* gobj ()
 Provides access to the underlying C GObject. More...

 
const ClutterTextBuffer* gobj () const
 Provides access to the underlying C GObject. More...

 
ClutterTextBuffer* gobj_copy ()
 Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs. More...

 
void set_text (const Glib::ustring& text)
 sets the text in the buffer. More...

 
Glib::ustring get_text () const
 Retrieves the contents of the buffer. More...

 
gsize get_bytes () const
 Retrieves the length in bytes of the buffer. More...

 
guint get_length () const
 Retrieves the length in characters of the buffer. More...

 
void set_max_length (int max_length)
 Sets the maximum allowed length of the contents of the buffer. More...

 
int get_max_length () const
 Retrieves the maximum allowed length of the text in buffer. More...

 
guint insert_text (guint position, const Glib::ustring& chars, int n_chars)
 Inserts n_chars characters of chars into the contents of the buffer, at position position. More...

 
guint delete_text (guint position, int n_chars)
 Deletes a sequence of characters from the buffer. More...

 
void emit_inserted_text (guint position, const Glib::ustring& chars, guint n_chars)
 Emits the Clutter::TextBuffer::signal_inserted_text() signal on buffer. More...

 
void emit_deleted_text (guint position, guint n_chars)
 Emits the Clutter::TextBuffer::signal_deleted_text() signal on buffer. More...

 
Glib::SignalProxy2< void,

guint, guint > 
signal_deleted_text ()
 
Glib::SignalProxy3< void,

guint, const Glib::ustring

&, guint > 
signal_inserted_text ()
 
Glib::PropertyProxy_ReadOnly

< guint > 
property_length () const
 Length of the text currently in the buffer. More...

 
Glib::PropertyProxy< int > property_max_length ()
 Maximum number of characters for this entry. More...

 
Glib::PropertyProxy_ReadOnly< int > property_max_length () const
 Maximum number of characters for this entry. More...

 
Glib::PropertyProxy_ReadOnly

< Glib::ustring
property_text () const
 The contents of the buffer. More...

 

Static Public Member Functions

static GType get_type ()
 Get the GType for this class, for use with the underlying GObject type system. More...

 
static Glib::RefPtr< TextBuffercreate ()
 

Protected Member Functions

 TextBuffer ()
 
 TextBuffer (const Glib::ustring& text)
 Create a new ClutterTextBuffer object with some text. More...

 
virtual void on_deleted_text (guint position, guint n_chars)
 This is a default handler for the signal signal_deleted_text(). More...

 
virtual void on_inserted_text (guint position, const Glib::ustring& chars, guint n_chars)
 This is a default handler for the signal signal_inserted_text(). More...

 

Related Functions

(Note that these are not member functions.)

Glib::RefPtr< Clutter::TextBufferwrap (ClutterTextBuffer* object, bool take_copy=false)
 A Glib::wrap() method for this object. More...

 

Constructor & Destructor Documentation

virtual Clutter::TextBuffer::~TextBuffer ( )
virtual
Clutter::TextBuffer::TextBuffer ( )
explicitprotected
Clutter::TextBuffer::TextBuffer ( const Glib::ustring text)
explicitprotected

Create a new ClutterTextBuffer object with some text.

Since cluttermm 1.10:
Parameters
textInitial buffer text.
text_lenInitial buffer text length, or -1 for null-terminated.
Returns
A new ClutterTextBuffer object.

Member Function Documentation

static Glib::RefPtr<TextBuffer> Clutter::TextBuffer::create ( )
static
guint Clutter::TextBuffer::delete_text ( guint  position,
int  n_chars 
)

Deletes a sequence of characters from the buffer.

n_chars characters are deleted starting at position. If n_chars is negative, then all characters until the end of the text are deleted.

If position or n_chars are out of bounds, then they are coerced to sane values.

Note that the positions are specified in characters, not bytes.

Since cluttermm 1.10:
Parameters
positionPosition at which to delete text.
n_charsNumber of characters to delete.
Returns
The number of characters deleted.
void Clutter::TextBuffer::emit_deleted_text ( guint  position,
guint  n_chars 
)

Emits the Clutter::TextBuffer::signal_deleted_text() signal on buffer.

Used when subclassing Clutter::TextBuffer

Since cluttermm 1.10:
Parameters
positionPosition at which text was deleted.
n_charsNumber of characters deleted.
void Clutter::TextBuffer::emit_inserted_text ( guint  position,
const Glib::ustring chars,
guint  n_chars 
)

Emits the Clutter::TextBuffer::signal_inserted_text() signal on buffer.

Used when subclassing Clutter::TextBuffer

Since cluttermm 1.10:
Parameters
positionPosition at which text was inserted.
charsText that was inserted.
n_charsNumber of characters inserted.
gsize Clutter::TextBuffer::get_bytes ( ) const

Retrieves the length in bytes of the buffer.

See get_length().

Since cluttermm 1.10:
Returns
The byte length of the buffer.
guint Clutter::TextBuffer::get_length ( ) const

Retrieves the length in characters of the buffer.

Since cluttermm 1.10:
Returns
The number of characters in the buffer.
int Clutter::TextBuffer::get_max_length ( ) const

Retrieves the maximum allowed length of the text in buffer.

See set_max_length().

Since cluttermm 1.10:
Returns
The maximum allowed number of characters in Clutter::TextBuffer, or 0 if there is no maximum.
Glib::ustring Clutter::TextBuffer::get_text ( ) const

Retrieves the contents of the buffer.

The memory pointer returned by this call will not change unless this object emits a signal, or is finalized.

Since cluttermm 1.10:
Returns
A pointer to the contents of the widget as a string. This string points to internally allocated storage in the buffer and must not be freed, modified or stored.
static GType Clutter::TextBuffer::get_type ( )
static

Get the GType for this class, for use with the underlying GObject type system.

ClutterTextBuffer* Clutter::TextBuffer::gobj ( )
inline

Provides access to the underlying C GObject.

const ClutterTextBuffer* Clutter::TextBuffer::gobj ( ) const
inline

Provides access to the underlying C GObject.

ClutterTextBuffer* Clutter::TextBuffer::gobj_copy ( )

Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.

guint Clutter::TextBuffer::insert_text ( guint  position,
const Glib::ustring chars,
int  n_chars 
)

Inserts n_chars characters of chars into the contents of the buffer, at position position.

If n_chars is negative, then characters from chars will be inserted until a null-terminator is found. If position or n_chars are out of bounds, or the maximum buffer text length is exceeded, then they are coerced to sane values.

Note that the position and length are in characters, not in bytes.

Since cluttermm 1.10:
Parameters
positionThe position at which to insert text.
charsThe text to insert into the buffer.
n_charsThe length of the text in characters, or -1.
Returns
The number of characters actually inserted.
virtual void Clutter::TextBuffer::on_deleted_text ( guint  position,
guint  n_chars 
)
protectedvirtual

This is a default handler for the signal signal_deleted_text().

virtual void Clutter::TextBuffer::on_inserted_text ( guint  position,
const Glib::ustring chars,
guint  n_chars 
)
protectedvirtual

This is a default handler for the signal signal_inserted_text().

Glib::PropertyProxy_ReadOnly< guint > Clutter::TextBuffer::property_length ( ) const

Length of the text currently in the buffer.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns
A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.
Glib::PropertyProxy< int > Clutter::TextBuffer::property_max_length ( )

Maximum number of characters for this entry.

Zero if no maximum.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns
A PropertyProxy that allows you to get or set the value of the property, or receive notification when the value of the property changes.
Glib::PropertyProxy_ReadOnly< int > Clutter::TextBuffer::property_max_length ( ) const

Maximum number of characters for this entry.

Zero if no maximum.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns
A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.
Glib::PropertyProxy_ReadOnly< Glib::ustring > Clutter::TextBuffer::property_text ( ) const

The contents of the buffer.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns
A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.
void Clutter::TextBuffer::set_max_length ( int  max_length)

Sets the maximum allowed length of the contents of the buffer.

If the current contents are longer than the given length, then they will be truncated to fit.

Since cluttermm 1.10:
Parameters
max_lengthThe maximum length of the entry buffer, or 0 for no maximum. (other than the maximum length of entries.) The value passed in will be clamped to the range [ 0, Clutter::TEXT_BUFFER_MAX_SIZE ].
void Clutter::TextBuffer::set_text ( const Glib::ustring text)

sets the text in the buffer.

Glib::SignalProxy2< void,guint,guint > Clutter::TextBuffer::signal_deleted_text ( )
Slot Prototype:
void on_my_deleted_text(guint position, guint n_chars)

This signal is emitted after text is deleted from the buffer.

Since cluttermm 1.10:
Parameters
positionThe position the text was deleted at.
n_charsThe number of characters that were deleted.
Glib::SignalProxy3< void,guint,const Glib::ustring&,guint > Clutter::TextBuffer::signal_inserted_text ( )
Slot Prototype:
void on_my_inserted_text(guint position, const Glib::ustring& chars, guint n_chars)

This signal is emitted after text is inserted into the buffer.

Since cluttermm 1.10:
Parameters
positionThe position the text was inserted at.
charsThe text that was inserted.
n_charsThe number of characters that were inserted.

Friends And Related Function Documentation

Glib::RefPtr< Clutter::TextBuffer > wrap ( ClutterTextBuffer *  object,
bool  take_copy = false 
)
related

A Glib::wrap() method for this object.

Parameters
objectThe C instance.
take_copyFalse if the result should take ownership of the C instance. True if it should take a new copy or ref.
Returns
A C++ instance that wraps this C instance.

The documentation for this class was generated from the following file:
  • cluttermm/text-buffer.h