/* 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
{
/** "Press and Hold" gesture.
 *
 * This is a Gesture implementation able to recognize
 * long presses, triggering signal_pressed() after the
 * timeout is exceeded.
 *
 * If the touchpoint is lifted before the timeout passes, or if it drifts
 * too far of the initial press point, signal_cancelled() will be emitted.
 *
 * @newin{3,14}
 *
 * @ingroup Gestures
 */
class GTKMM_API GestureLongPress : public GestureSingle
{
  _CLASS_GOBJECT(GestureLongPress, GtkGestureLongPress, GTK_GESTURE_LONG_PRESS, GestureSingle, GtkGestureSingle, , , GTKMM_API)

protected:
  /** Constructs a Gesture that recognizes long presses.
   */
  _CTOR_DEFAULT

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

  _WRAP_METHOD(void set_delay_factor(double delay_factor), gtk_gesture_long_press_set_delay_factor)
  _WRAP_METHOD(double get_delay_factor() const, gtk_gesture_long_press_get_delay_factor)

  // no_default_handler because GtkGestureLongPressClass is private.
  _WRAP_SIGNAL(void pressed(double x, double y), "pressed", no_default_handler)
  _WRAP_SIGNAL(void cancelled(), "cancelled", no_default_handler)

  _WRAP_PROPERTY("delay-factor", double, newin "3,20")

  // GestureLongPress has no methods
};

} // namespace Gtk
