atkmm: Atk::Value Class Reference

atkmm 2.28.2

Public Member Functions | Static Public Member Functions | Protected Member Functions | Related Functions | List of all members
Atk::Value Class Reference

The ATK interface implemented by valuators and components which display or select a value from a bounded range of values. More...

`#include <atkmm/value.h>`

Inheritance diagram for Atk::Value:
[legend]

## Public Member Functions
| Value (Value&& src) noexcept
Value& | operator= (Value&& src) noexcept
| ~Value () noexcept override
AtkValue* | gobj ()
| Provides access to the underlying C GObject. More...
const AtkValue* | gobj () const
| Provides access to the underlying C GObject. More...
void | get_current_value (Glib::ValueBase& value) const
| Gets the value of this object. More...
void | get_maximum_value (Glib::ValueBase& value) const
| Gets the maximum value of this object. More...
void | get_minimum_value (Glib::ValueBase& value) const
| Gets the minimum value of this object. More...
bool | set_current_value (const Glib::ValueBase& value)
| Sets the value of this object. More...
void | get_value_and_text (double& value, Glib::ustring& text)
| Gets the current value and the human readable text alternative. More...
Range | get_range () const
| Gets the range of this object. More...
double | get_increment ()
| Gets the minimum increment by which the value of this object may be changed. More...
void | set_value (const gdouble new_value)
| Sets the value of this object. More...
Public Member Functions inherited from Glib::Interface
| Interface ()
| Interface (Interface &&src) noexcept
Interface & | operator= (Interface &&src) noexcept
| Interface (const Glib::Interface_Class &interface_class)
| Interface (GObject *castitem)
| ~Interface () noexcept override
| Interface (const Interface &)=delete
Interface & | operator= (const Interface &)=delete
GObject * | gobj ()
const GObject * | gobj () const
Public Member Functions inherited from Glib::ObjectBase
| ObjectBase (const ObjectBase &)=delete
ObjectBase & | operator= (const ObjectBase &)=delete
void | set_property_value (const Glib::ustring &property_name, const Glib::ValueBase &value)
void | get_property_value (const Glib::ustring &property_name, Glib::ValueBase &value) const
void | set_property (const Glib::ustring &property_name, const PropertyType &value)
void | get_property (const Glib::ustring &property_name, PropertyType &value) const
void | connect_property_changed (const Glib::ustring &property_name, const sigc::slot< void > &slot)
void | connect_property_changed (const Glib::ustring &property_name, sigc::slot< void > &&slot)
sigc::connection | connect_property_changed_with_return (const Glib::ustring &property_name, const sigc::slot< void > &slot)
sigc::connection | connect_property_changed_with_return (const Glib::ustring &property_name, sigc::slot< void > &&slot)
void | freeze_notify ()
void | thaw_notify ()
virtual void | reference () const
virtual void | unreference () const
GObject * | gobj ()
const GObject * | gobj () const
GObject * | gobj_copy () const
Public Member Functions inherited from sigc::trackable
| trackable () noexcept
| trackable (const trackable &src) noexcept
| trackable (trackable &&src)
| ~trackable ()
void | add_destroy_notify_callback (void *data, func_destroy_notify func) const
void | notify_callbacks ()
trackable & | operator= (const trackable &src)
trackable & | operator= (trackable &&src)
void | remove_destroy_notify_callback (void *data) const

## Static Public Member Functions
static void | add_interface (GType gtype_implementer)
static GType | get_type ()
| Get the GType for this class, for use with the underlying GObject type system. More...

## Protected Member Functions
| Value ()
| You should derive from this class to use it. More...
virtual void | get_current_value_vfunc (Glib::ValueBase& value) const
virtual void | get_maximum_value_vfunc (Glib::ValueBase& value) const
virtual void | get_minimum_value_vfunc (Glib::ValueBase& value) const
virtual bool | set_current_value_vfunc (const Glib::ValueBase& value)
Protected Member Functions inherited from Glib::ObjectBase
| ObjectBase ()
| ObjectBase (const char *custom_type_name)
| ObjectBase (const std::type_info &custom_type_info)
| ObjectBase (ObjectBase &&src) noexcept
ObjectBase & | operator= (ObjectBase &&src) noexcept
virtual | ~ObjectBase () noexcept=0
void | initialize (GObject *castitem)
void | initialize_move (GObject *castitem, Glib::ObjectBase *previous_wrapper)

## Related Functions
(Note that these are not member functions.)
Glib::RefPtr< Atk::Value > | wrap (AtkValue* object, bool take_copy=false)
| A Glib::wrap() method for this object. More...

## Additional Inherited Members
Public Types inherited from sigc::trackable
typedef internal::func_destroy_notify | func_destroy_notify

## Detailed Description

The ATK interface implemented by valuators and components which display or select a value from a bounded range of values.

This should be implemented for components which either display a value from a bounded range, or which allow the user to specify a value from a bounded range, or both. For instance, most sliders and range controls, as well as dials, should have Atk::Object representations which implement Atk::Value on the component's behalf. Atk::Values may be read-only, in which case attempts to alter the value return false to indicate failure.

## Constructor & Destructor Documentation

## ◆ Value() [1/2]

Atk::Value::Value | ( |  | ) |
| protected

You should derive from this class to use it.

## ◆ Value() [2/2]

Atk::Value::Value | ( | Value&& | src | ) |
| noexcept

## ◆ ~Value()

Atk::Value::~Value | ( |  | ) |
| overridenoexcept

## Member Function Documentation

## ◆ add_interface()

static void Atk::Value::add_interface | ( | GType | gtype_implementer | ) |
| static

## ◆ get_current_value()

void Atk::Value::get_current_value | ( | Glib::ValueBase & | value | ) | const

Gets the value of this object.

Deprecated: Since 2.12. Use get_value_and_text() instead.

Deprecated:
  Use get_value_and_text() instead.

Parameters

  value | A Value representing the current accessible value.

## ◆ get_current_value_vfunc()

virtual void Atk::Value::get_current_value_vfunc | ( | Glib::ValueBase & | value | ) | const
| protectedvirtual

## ◆ get_increment()

double Atk::Value::get_increment | ( |  | ) |

Gets the minimum increment by which the value of this object may be changed.

If zero, the minimum increment is undefined, which may mean that it is limited only by the floating point precision of the platform.

Since atkmm 2.12:

Returns
  The minimum increment by which the value of this object may be changed. zero if undefined.

## ◆ get_maximum_value()

void Atk::Value::get_maximum_value | ( | Glib::ValueBase & | value | ) | const

Gets the maximum value of this object.

Deprecated: Since 2.12. Use get_range() instead.

Deprecated:
  Use get_range() instead.

Parameters

  value | A Value representing the maximum accessible value.

## ◆ get_maximum_value_vfunc()

virtual void Atk::Value::get_maximum_value_vfunc | ( | Glib::ValueBase & | value | ) | const
| protectedvirtual

## ◆ get_minimum_value()

void Atk::Value::get_minimum_value | ( | Glib::ValueBase & | value | ) | const

Gets the minimum value of this object.

Deprecated: Since 2.12. Use get_range() instead.

Deprecated:
  Use get_range() instead.

Parameters

  value | A Value representing the minimum accessible value.

## ◆ get_minimum_value_vfunc()

virtual void Atk::Value::get_minimum_value_vfunc | ( | Glib::ValueBase & | value | ) | const
| protectedvirtual

## ◆ get_range()

Range Atk::Value::get_range | ( |  | ) | const

Gets the range of this object.

Since atkmm 2.12:

Returns
  A newly allocated Atk::Range that represents the minimum, maximum and descriptor (if available) of obj. `nullptr` if that range is not defined.

## ◆ get_type()

static GType Atk::Value::get_type | ( |  | ) |
| static

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

## ◆ get_value_and_text()

void Atk::Value::get_value_and_text | ( | double & | value,
|  | Glib::ustring & | text
| ) |  |

Gets the current value and the human readable text alternative.

Since atkmm 2.24:

## ◆ gobj() [1/2]

AtkValue* Atk::Value::gobj | ( |  | ) |
| inline

Provides access to the underlying C GObject.

## ◆ gobj() [2/2]

const AtkValue* Atk::Value::gobj | ( |  | ) | const
| inline

Provides access to the underlying C GObject.

## ◆ operator=()

Value& Atk::Value::operator= | ( | Value&& | src | ) |
| noexcept

## ◆ set_current_value()

bool Atk::Value::set_current_value | ( | const Glib::ValueBase & | value | ) |

Sets the value of this object.

Deprecated: Since 2.12. Use set_value() instead.

Deprecated:
  Use set_value() instead.

Parameters

  value | A Value which is the desired new accessible value.

Returns
  `true` if new value is successfully set, `false` otherwise.

## ◆ set_current_value_vfunc()

virtual bool Atk::Value::set_current_value_vfunc | ( | const Glib::ValueBase & | value | ) |
| protectedvirtual

## ◆ set_value()

void Atk::Value::set_value | ( | const gdouble | new_value | ) |

Sets the value of this object.

This method is intended to provide a way to change the value of the object. In any case, it is possible that the value can't be modified (ie: a read-only component). If the value changes due this call, it is possible that the text could change, and will trigger an Atk::Value::signal_value_changed() signal emission.

Note for implementors: the deprecated set_current_value() method returned `true` or `false` depending if the value was assigned or not. In the practice several implementors were not able to decide it, and returned `true` in any case. For that reason it is not required anymore to return if the value was properly assigned or not.

Since atkmm 2.12:

Parameters

  new_value | A double which is the desired new accessible value.

## Friends And Related Function Documentation

## ◆ wrap()

Glib::RefPtr< Atk::Value > wrap | ( | AtkValue * | object,
|  | bool | take_copy = `false`
| ) |  |
| related

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

Parameters

  object | The C instance.
  take_copy | False 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.