/* Copyright (C) 2023 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, see <http://www.gnu.org/licenses/>.
 */

_CONFIGINCLUDE(gtkmmconfig.h)

#include <glibmm/object.h>
#include <gdkmm/display.h>
#include <gtkmm/accessible.h>

_DEFS(gtkmm,gtk)
_PINCLUDE(glibmm/private/object_p.h)

namespace Gtk
{
/** %Gtk::ATContext is an abstract class provided by GTK to communicate to
 * platform-specific assistive technologies API.
 *
 * Each platform supported by GTK implements a GtkATContext subclass, and
 * is responsible for updating the accessible state in response to state
 * changes in Gtk::Accessible.
 *
 * @newin{4,10}
 */
class GTKMM_API ATContext : public Glib::Object
{
  _CLASS_GOBJECT(ATContext, GtkATContext, GTK_AT_CONTEXT, Glib::Object, GObject, , , GTKMM_API)
  _DO_NOT_DERIVE_GTYPE dnl// GtkATContext is an internal type
protected:
  _CTOR_DEFAULT()

public:
  _WRAP_METHOD(static Glib::RefPtr<ATContext> create(Accessible::Role accessible_role,
    const Glib::RefPtr<Accessible>& accessible, const Glib::RefPtr<Gdk::Display>& display),
    gtk_at_context_create)

  _WRAP_METHOD(Glib::RefPtr<Accessible> get_accessible(),
    gtk_at_context_get_accessible, refreturn)
  _WRAP_METHOD(Glib::RefPtr<const Accessible> get_accessible() const,
    gtk_at_context_get_accessible, refreturn, constversion)
  _WRAP_METHOD(Accessible::Role get_accessible_role() const,
    gtk_at_context_get_accessible_role)

  _WRAP_PROPERTY("accessible-role", Accessible::Role)
  _WRAP_PROPERTY("accessible", Glib::RefPtr<Accessible>)
  _WRAP_PROPERTY("display", Glib::RefPtr<Gdk::Display>)

  // no_default_handler because the wrapped C signal has no default handler.
  _WRAP_SIGNAL(void state_change(), "state-change", no_default_handler)
};

} //namespace Gtk
