Debian Codegraph @

atk/src/value.hg

raw
1 /* Copyright (C) 2002 The gtkmm Development Team
2 *
3 * This library is free software; you can redistribute it and/or
4 * modify it under the terms of the GNU Lesser General Public
5 * License as published by the Free Software Foundation; either
6 * version 2.1 of the License, or (at your option) any later version.
7 *
8 * This library is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 * Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public
14 * License along with this library; if not, see <https://www.gnu.org/licenses/>.
15 */
16
17 _DEFS(atkmm,atk)
18
19 #include <glibmm/interface.h>
20 #include <atkmm/range.h>
21
22 #ifndef DOXYGEN_SHOULD_SKIP_THIS
23 extern "C"
24 {
25 typedef struct _AtkValueIface AtkValueIface;
26 typedef struct _AtkValue AtkValue;
27 }
28 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
29
30
31 namespace Atk
32 {
33
34 /** The ATK interface implemented by valuators and components which display or select a value from a bounded range of values.
35 * This should be implemented for components which either display a value from a bounded range, or which allow the user
36 * to specify a value from a bounded range, or both. For instance, most sliders and range controls, as well as dials,
37 * should have Atk::Object representations which implement Atk::Value on the component's behalf. Atk::Values may be
38 * read-only, in which case attempts to alter the value return false to indicate failure.
39 */
40 class ATKMM_API Value : public Glib::Interface
41 {
42 _CLASS_INTERFACE(Value, AtkValue, ATK_VALUE, AtkValueIface, , , ATKMM_API)
43
44 public:
45 _WRAP_METHOD(void get_current_value(Glib::ValueBase& value) const, atk_value_get_current_value, deprecated "Use get_value_and_text() instead.")
46 _WRAP_METHOD(void get_maximum_value(Glib::ValueBase& value) const, atk_value_get_maximum_value, deprecated "Use get_range() instead.")
47 _WRAP_METHOD(void get_minimum_value(Glib::ValueBase& value) const, atk_value_get_minimum_value, deprecated "Use get_range() instead.")
48 _WRAP_METHOD(bool set_current_value(const Glib::ValueBase& value), atk_value_set_current_value, deprecated "Use set_value() instead.")
49
50 /** Gets the current value and the human readable text alternative.
51 *
52 * @newin{2,24}
53 */
54 void get_value_and_text(double& value, Glib::ustring& text);
55 _IGNORE(atk_value_get_value_and_text)
56
57 _WRAP_METHOD(Range get_range() const, atk_value_get_range)
58
59 _WRAP_METHOD(double get_increment(), atk_value_get_increment)
60
61 _WRAP_METHOD(void set_value(const gdouble new_value), atk_value_set_value)
62
63 _IGNORE(atk_value_get_minimum_increment)
64
65 //TODO: atk_value_get_sub_ranges ()
66
67
68 protected:
69 _WRAP_VFUNC(void get_current_value(Glib::ValueBase& value) const, get_current_value)
70 _WRAP_VFUNC(void get_maximum_value(Glib::ValueBase& value) const, get_maximum_value)
71 _WRAP_VFUNC(void get_minimum_value(Glib::ValueBase& value) const, get_minimum_value)
72 _WRAP_VFUNC(bool set_current_value(const Glib::ValueBase& value), set_current_value)
73 };
74
75 } // namespace Atk