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