/* Copyright (C) 2020 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/>.
 */

#include <gtkmm/eventcontroller.h>
#include <gdkmm/drop.h>

_DEFS(gtkmm,gtk)
_PINCLUDE(gtkmm/private/eventcontroller_p.h)

namespace Gtk
{
/** Event controller for motion events during a drop.
 *
 * %Gtk::DropControllerMotion is an event controller meant for tracking
 * the pointer hovering over a widget during a drag and drop operation.
 *
 * It is modeled after Gtk::EventControllerMotion so if you have used
 * that, this should feel really familiar.
 *
 * The drop controller is not able to accept drops, use Gtk::DropTarget
 * for that purpose.
 * 
 * @newin{3,98}
 *
 * @see Gdk::Drop, Gtk::DropTarget
 * @ingroup Gestures
 */
class GTKMM_API DropControllerMotion : public EventController
{
  _CLASS_GOBJECT(DropControllerMotion, GtkDropControllerMotion, GTK_DROP_CONTROLLER_MOTION, EventController, GtkEventController, , , GTKMM_API)

protected:
  _CTOR_DEFAULT

public:
  _WRAP_CREATE()

  _WRAP_METHOD(bool contains_pointer() const, gtk_drop_controller_motion_contains_pointer)
  _WRAP_METHOD(bool is_pointer() const, gtk_drop_controller_motion_is_pointer)
  _WRAP_METHOD(Glib::RefPtr<Gdk::Drop> get_drop(), gtk_drop_controller_motion_get_drop, refreturn)
  _WRAP_METHOD(Glib::RefPtr<const Gdk::Drop> get_drop() const, gtk_drop_controller_motion_get_drop, refreturn, constversion)

  // no_default_handler because GtkDropControllerMotionClass is private.
  _WRAP_SIGNAL(void enter(double x, double y), "enter", no_default_handler)
  _WRAP_SIGNAL(void leave(), "leave", no_default_handler)
  _WRAP_SIGNAL(void motion(double x, double y), "motion", no_default_handler)

  _WRAP_PROPERTY("contains-pointer", bool)
  _WRAP_PROPERTY("drop", Glib::RefPtr<Gdk::Drop>)
  _WRAP_PROPERTY("is-pointer", bool)
};

} // namespace Gtk
