/* Copyright (C) 2014 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/gesturesingle.h>

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

namespace Gtk
{
/** Swipe gesture.
 *
 * This is a Gesture implementation able to recognize
 * swipes. After a press/move/.../move/release sequence happens,
 * signal_swipe() will be emitted, providing the velocity
 * and directionality of the sequence at the time it was lifted.
 *
 * If the velocity is desired in intermediate points,
 * get_velocity() can be called on eg. a
 * Gesture::signal_update() handler.
 *
 * All velocities are reported in pixels/sec units.
 *
 * @newin{3,14}
 *
 * @ingroup Gestures
 */
class GTKMM_API GestureSwipe : public GestureSingle
{
  _CLASS_GOBJECT(GestureSwipe, GtkGestureSwipe, GTK_GESTURE_SWIPE, GestureSingle, GtkGestureSingle, , , GTKMM_API)

protected:
  /** Constructs a Gesture that recognizes swipes.
   */
  _CTOR_DEFAULT

public:
  /** Creates a Gesture that recognizes swipes.
   *
   * @newin{3,14}
   *
   * @return A RefPtr to a new GestureSwipe.
   */
  _WRAP_CREATE()

  _WRAP_METHOD(bool get_velocity(double& velocity_x, double& velocity_y) const, gtk_gesture_swipe_get_velocity)

  // no_default_handler because GtkGestureSwipeClass is private.
  _WRAP_SIGNAL(void swipe(double velocity_x, double velocity_y), "swipe", no_default_handler)

  // GestureSwipe has no properties
};

} // namespace Gtk
