/* $Id: scalebutton.hg,v 1.5 2005/11/30 14:10:49 murrayc Exp $ */

/* scalebutton.h
 *
 * Copyright (C) 2007 The gtkmm Development Team
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 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
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free
 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */

#include <gtkmm/button.h>
#include <gtkmm/adjustment.h>
#include <gtkmm/enums.h>
_DEFS(gtkmm,gtk)
_PINCLUDE(gtkmm/private/button_p.h)


namespace Gtk
{

//TODO: Inherit/Implement Orientation when we can break ABI.

/** A button which pops up a scale widget.
 *
 * This kind of widget is commonly used for volume controls in multimedia 
 * applications, and there is a Gtk::VolumeButton subclass that is tailored 
 * for this use case.
 * 
 * @ingroup Widgets
 * @newin{2,12}
 */
class ScaleButton : public Button
{
  _CLASS_GTKOBJECT(ScaleButton, GtkScaleButton, GTK_SCALE_BUTTON, Gtk::Button, GtkButton)
public:
  
  _WRAP_CTOR(ScaleButton(IconSize size, double min, double max, double step, const Glib::StringArrayHandle& icons), gtk_scale_button_new)

  _WRAP_METHOD(void set_icons(const Glib::StringArrayHandle& icons), gtk_scale_button_set_icons)
  _WRAP_METHOD(double get_value() const, gtk_scale_button_get_value)
  _WRAP_METHOD(void set_value(double value), gtk_scale_button_set_value)
  _WRAP_METHOD(Gtk::Adjustment*	get_adjustment(), gtk_scale_button_get_adjustment, refreturn)
  _WRAP_METHOD(Gtk::Adjustment*	get_adjustment() const, gtk_scale_button_get_adjustment, constversion)
  _WRAP_METHOD(void set_adjustment(Gtk::Adjustment& adjustment), gtk_scale_button_set_adjustment)
  _WRAP_METHOD(Orientation get_orientation(), gtk_scale_button_get_orientation)
  _WRAP_METHOD(void set_orientation(Orientation orientation), gtk_scale_button_set_orientation)
  _WRAP_METHOD(Widget* get_plus_button(), gtk_scale_button_get_plus_button)
  _WRAP_METHOD(const Widget* get_plus_button() const, gtk_scale_button_get_plus_button, constversion)
  _WRAP_METHOD(Widget* get_minus_button(), gtk_scale_button_get_minus_button)
  _WRAP_METHOD(const Widget* get_minus_button() const, gtk_scale_button_get_minus_button, constversion)
  _WRAP_METHOD(Gtk::Widget* get_popup(), gtk_scale_button_get_popup)
  _WRAP_METHOD(const Gtk::Widget* get_popup() const, gtk_scale_button_get_popup)

  _WRAP_SIGNAL(void value_changed(double value), "value_changed")

  //Ignore key-binding signals:
  _IGNORE_SIGNAL("popup")
  _IGNORE_SIGNAL("popdown")

  _WRAP_PROPERTY("value", double)
  _WRAP_PROPERTY("size", IconSize)
  _WRAP_PROPERTY("adjustment", Adjustment*)
  _WRAP_PROPERTY("orientation", Orientation)
};


} // namespace Gtk

