/*
 * Copyright (C) 1998-2002 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., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 */

#include <gdkmm/enums.h>
#include <glibmm/object.h>
#include <gdk/gdk.h>

_DEFS(gdkmm,gdk)
_PINCLUDE(glibmm/private/object_p.h)

namespace Gdk
{
class ContentFormats;
class ContentProvider;
class Device;
class Display;
class Surface;

_WRAP_ENUM(DragCancelReason, GdkDragCancelReason)

/** A %Gdk::Drag holds information about a drag in progress.
 * It is used on both source and destination sides.
 */
class Drag : public Glib::Object
{
  _CLASS_GOBJECT(Drag, GdkDrag, GDK_DRAG, Glib::Object, GObject)

public:
  // The Gtk::DnD namespace contains functions that logically are Gdk::Drag methods.
  // However, they can't be members of Gdk::Drag, because they depend on code in
  // the gtk part of gtk+. Such a dependency is not allowed in a Gdk class.

  _WRAP_METHOD(Glib::RefPtr<Display> get_display(), gdk_drag_get_display, refreturn)
  _WRAP_METHOD(Glib::RefPtr<const Display> get_display() const, gdk_drag_get_display, refreturn, constversion)

  _WRAP_METHOD(Glib::RefPtr<Device> get_device(), gdk_drag_get_device, refreturn)
  _WRAP_METHOD(Glib::RefPtr<const Device> get_device() const, gdk_drag_get_device, refreturn, constversion)

  _WRAP_METHOD(Glib::RefPtr<ContentFormats> get_formats(), gdk_drag_get_formats, refreturn)
  _WRAP_METHOD(Glib::RefPtr<const ContentFormats> get_formats() const, gdk_drag_get_formats, refreturn, constversion)

  _WRAP_METHOD(DragAction get_actions() const, gdk_drag_get_actions)
  _WRAP_METHOD(DragAction get_selected_action() const, gdk_drag_get_selected_action)
  _WRAP_METHOD(static bool action_is_unique(DragAction action), gdk_drag_action_is_unique)

  _WRAP_METHOD(void drag_drop_done(bool success), gdk_drag_drop_done)

  // No unconst version of get_drag_surface(). The surface is owned by the Drag, and shall not be changed by the caller.
  _WRAP_METHOD(Glib::RefPtr<const Surface> get_drag_surface() const, gdk_drag_get_drag_surface, refreturn)

  _WRAP_METHOD(void set_hotspot(int hot_x, int hot_y), gdk_drag_set_hotspot)

  _WRAP_PROPERTY("content", Glib::RefPtr<ContentProvider>)
  _WRAP_PROPERTY("device", Glib::RefPtr<Device>)
  _WRAP_PROPERTY("display", Glib::RefPtr<Display>)
  _WRAP_PROPERTY("formats", Glib::RefPtr<ContentFormats>)
  _WRAP_PROPERTY("selected-action", DragAction)
  _WRAP_PROPERTY("actions", DragAction)
  _WRAP_PROPERTY("surface", Glib::RefPtr<Surface>)

  // no_default_handler because GdkDragClass is private.
  _WRAP_SIGNAL(void cancel(DragCancelReason reason), "cancel", no_default_handler)
  _WRAP_SIGNAL(void drop_performed(), "drop-performed", no_default_handler)
  _WRAP_SIGNAL(void dnd_finished(), "dnd-finished", no_default_handler)
};

} // namespace Gdk
