### Interface

# Handy Swipeable

since: 1.0

#### Description [src]

    interface Handy.Swipeable : Gtk.Widget

An interface for swipeable widgets.

The `HdySwipeable` interface is implemented by all swipeable widgets. They can be synced using `HdySwipeGroup`.

See `HdySwipeTracker` for details about implementing it.

Available since: 1.0

#### Prerequisite

In order to implement Swipeable, your type must inherit from`GtkWidget`.

#### Implementations

- HdyCarousel
- HdyDeck
- HdyFlap
- HdyLeaflet

#### Instance methods

###### hdy_swipeable_emit_child_switched

Emits `HdySwipeable::child-switched` signal.

since: 1.0

###### hdy_swipeable_get_cancel_progress

Gets the progress `self` will snap back to after the gesture is canceled.

since: 1.0

###### hdy_swipeable_get_distance

Gets the swipe distance of `self`.

since: 1.0

###### hdy_swipeable_get_progress

Gets the current progress of `self`.

since: 1.0

###### hdy_swipeable_get_snap_points

Gets the snap points of `self`.

since: 1.0

###### hdy_swipeable_get_swipe_area

Gets the area `self` can start a swipe from for the given direction and gesture type.

since: 1.0

###### hdy_swipeable_get_swipe_tracker

Gets the `HdySwipeTracker` used by this swipeable widget.

since: 1.0

###### hdy_swipeable_switch_child

Switches to child with index `index`.

since: 1.0

#### Signals

###### Handy.Swipeable::child-switched

Emitted when the widget’s visible child is changed.

since: 1.0

#### Interface structure

    struct HandySwipeableInterface {
      GTypeInterface parent;
      void (* switch_child) (
        HdySwipeable* self,
        guint index,
        gint64 duration
      );
      HdySwipeTracker* (* get_swipe_tracker) (
        HdySwipeable* self
      );
      gdouble (* get_distance) (
        HdySwipeable* self
      );
      gdouble* (* get_snap_points) (
        HdySwipeable* self,
        gint* n_snap_points
      );
      gdouble (* get_progress) (
        HdySwipeable* self
      );
      gdouble (* get_cancel_progress) (
        HdySwipeable* self
      );
      void (* get_swipe_area) (
        HdySwipeable* self,
        HdyNavigationDirection navigation_direction,
        gboolean is_drag,
        GdkRectangle* rect
      );

    }

An interface for swipeable widgets.

###### Interface members

`parent` |
    GTypeInterface
| The parent interface.
`switch_child` |
    void (* switch_child) (
        HdySwipeable* self,
        guint index,
        gint64 duration
      )
| No description available.
`get_swipe_tracker` |
    HdySwipeTracker* (* get_swipe_tracker) (
        HdySwipeable* self
      )
| No description available.
`get_distance` |
    gdouble (* get_distance) (
        HdySwipeable* self
      )
| No description available.
`get_snap_points` |
    gdouble* (* get_snap_points) (
        HdySwipeable* self,
        gint* n_snap_points
      )
| No description available.
`get_progress` |
    gdouble (* get_progress) (
        HdySwipeable* self
      )
| No description available.
`get_cancel_progress` |
    gdouble (* get_cancel_progress) (
        HdySwipeable* self
      )
| No description available.
`get_swipe_area` |
    void (* get_swipe_area) (
        HdySwipeable* self,
        HdyNavigationDirection navigation_direction,
        gboolean is_drag,
        GdkRectangle* rect
      )
| No description available.

#### Virtual methods

###### Handy.Swipeable.get_cancel_progress

Gets the progress `self` will snap back to after the gesture is canceled.

since: 1.0

###### Handy.Swipeable.get_distance

Gets the swipe distance of `self`.

since: 1.0

###### Handy.Swipeable.get_progress

Gets the current progress of `self`.

since: 1.0

###### Handy.Swipeable.get_snap_points

Gets the snap points of `self`.

since: 1.0

###### Handy.Swipeable.get_swipe_area

Gets the area `self` can start a swipe from for the given direction and gesture type.

since: 1.0

###### Handy.Swipeable.get_swipe_tracker

Gets the `HdySwipeTracker` used by this swipeable widget.

since: 1.0

###### Handy.Swipeable.switch_child

Switches to child with index `index`.

since: 1.0