/* $Id: activatable.hg,v 1.3 2006/05/18 17:53:15 murrayc Exp $ */

/* Copyright (C) 2009 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/action.h>
#include <glibmm/interface.h>
_DEFS(gtkmm,gtk)
_PINCLUDE(glibmm/private/interface_p.h)

#ifndef DOXYGEN_SHOULD_SKIP_THIS
extern "C"
{
typedef struct _GtkActivatableIface GtkActivatableIface;
}
#endif /* DOXYGEN_SHOULD_SKIP_THIS */


namespace Gtk
{

//TODO: Use this when we can add new base classes to existing classes.
/** Activatable widgets can be connected to a Gtk::Action and reflect the state 
 * of the action. An Activatable can also provide feedback through its action, 
 * as it is responsible for activating the related action.
 *
 * @newin{2,16}
 */
class Activatable : public Glib::Interface
{
  _CLASS_INTERFACE(Activatable, GtkActivatable, GTK_ACTIVATABLE, GtkActivatableIface)

public:
  _WRAP_METHOD(void do_set_related_action(const Glib::RefPtr<Action>& action), gtk_activatable_do_set_related_action)
  _WRAP_METHOD(Glib::RefPtr<Action> get_related_action(), gtk_activatable_get_related_action, refreturn)
  _WRAP_METHOD(Glib::RefPtr<const Action> get_related_action() const, gtk_activatable_get_related_action, refreturn, constversion)
  _WRAP_METHOD(bool get_use_action_appearance() const, gtk_activatable_get_use_action_appearance)
  _WRAP_METHOD(void sync_action_properties(const Glib::RefPtr<Action>& action), gtk_activatable_sync_action_properties)
  _WRAP_METHOD(void set_related_action(const Glib::RefPtr<Action>& action), gtk_activatable_set_related_action)
  _WRAP_METHOD(void set_use_action_appearance(bool use_appearance = true), gtk_activatable_set_use_action_appearance)

  _WRAP_PROPERTY("related-action", Glib::RefPtr<Action>)
  _WRAP_PROPERTY("use-action-appearance", bool)

#m4 _CONVERSION(`const char*',`const Glib::ustring&',__GCHARP_TO_USTRING)
  _WRAP_VFUNC(void update(const Glib::RefPtr<Action>& action, const Glib::ustring& property_name), update)
  _WRAP_VFUNC(void sync_action_properties(const Glib::RefPtr<Action>& action), sync_action_properties)
};

} // namespace Gtk

