/* $Id: value.hg,v 1.2 2004/01/02 09:56:43 murrayc Exp $ */

/* Copyright (C) 2002 The gtkmm Development Team
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Library General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Library General Public License for more details.
 *
 * You should have received a copy of the GNU Library General Public
 * License along with this library; if not, write to the Free
 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */

_DEFS(atkmm,atk)

#ifndef DOXYGEN_SHOULD_SKIP_THIS
extern "C"
{
  typedef struct _AtkValueIface AtkValueIface;
  typedef struct _AtkValue      AtkValue;
}
#endif /* DOXYGEN_SHOULD_SKIP_THIS */


namespace Atk
{

/** 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.
 */
class Value : public Glib::Interface
{
  _CLASS_INTERFACE(Value, AtkValue, ATK_VALUE, AtkValueIface)

public:
  _WRAP_METHOD(void get_current_value(Glib::ValueBase& value) const, atk_value_get_current_value)
  _WRAP_METHOD(void get_maximum_value(Glib::ValueBase& value) const, atk_value_get_maximum_value)
  _WRAP_METHOD(void get_minimum_value(Glib::ValueBase& value) const, atk_value_get_minimum_value)
  _WRAP_METHOD(bool set_current_value(const Glib::ValueBase& value), atk_value_set_current_value)

protected:
  _WRAP_VFUNC(void get_current_value(Glib::ValueBase& value) const, get_current_value)
  _WRAP_VFUNC(void get_maximum_value(Glib::ValueBase& value) const, get_maximum_value)
  _WRAP_VFUNC(void get_minimum_value(Glib::ValueBase& value) const, get_minimum_value)
  _WRAP_VFUNC(bool set_current_value(const Glib::ValueBase& value), set_current_value)
};

} // namespace Atk

