glibmm
2.32.0
|
A Glib::Object property. More...
#include <glibmm/property.h>
Public Types | |
typedef T | PropertyType |
typedef Glib::Value< T > | ValueType |
Public Member Functions | |
Property (Glib::Object& object, const Glib::ustring& name) | |
Constructs a property of the object with the specified name. | |
Property (Glib::Object& object, const Glib::ustring& name, const PropertyType& default_value) | |
Constructs a property of the object with the specified name and default_value. | |
void | set_value (const PropertyType& data) |
Sets the value of the property to data. | |
PropertyType | get_value () const |
Returns the value of the property. | |
Property< T >& | operator= (const PropertyType& data) |
Sets the value of the property to data. | |
operator PropertyType () const | |
Returns the value of the property. | |
Glib::PropertyProxy< T > | get_proxy () |
Returns a proxy object that can be used to manipulate this property. |
A Glib::Object property.
This class wraps a GObject property, providing a C++ API to the GObject property system, for use with classes derived from Glib::Object or Glib::Interface.
A property is a value associated with each instance of a type and some class data for each property: * Its unique name, used to identify the property. * A human-readable nick name. * A short description. * The default value and the minimum and maximum bounds (depending on the type of the property). * Flags, defining, among other things, whether the property can be read or written.
This Property class currently supports only the name and default value. The minimum and maximum bounds are set to the full range of the value. The nick and the explanation are set to empty. The flags are set to indicate that the property can be both read from and written to.
The class information must be installed into the GObject system once per property, but this is handled automatically.
A property can be used only as direct data member of a type, inheriting from Glib::Object. A reference to the object must be passed to the constructor of the property.
typedef T Glib::Property< T >::PropertyType |
typedef Glib::Value<T> Glib::Property< T >::ValueType |
Glib::Property< T >::Property | ( | Glib::Object& | object, |
const Glib::ustring& | name | ||
) |
Constructs a property of the object with the specified name.
For each instance of the object, the same property must be constructed with the same name
Glib::Property< T >::Property | ( | Glib::Object& | object, |
const Glib::ustring& | name, | ||
const PropertyType& | default_value | ||
) |
Constructs a property of the object with the specified name and default_value.
For each instance of the object, the same property must be constructed with the same name.
Glib::PropertyProxy<T> Glib::Property< T >::get_proxy | ( | ) | [inline] |
Returns a proxy object that can be used to manipulate this property.
PropertyType Glib::Property< T >::get_value | ( | ) | const [inline] |
Returns the value of the property.
Glib::Property< T >::operator PropertyType | ( | ) | const [inline] |
Returns the value of the property.
Property<T>& Glib::Property< T >::operator= | ( | const PropertyType& | data | ) | [inline] |
Sets the value of the property to data.
The object containing the property will be notified about the change.
void Glib::Property< T >::set_value | ( | const PropertyType& | data | ) | [inline] |
Sets the value of the property to data.
The object containing the property will be notified about the change.