HdySwipeable: Handy Reference Manual

## HdySwipeable HdySwipeable — An interface for swipeable widgets. |

## Signals

void | begin-swipe | Run First
void | end-swipe | Run First
void | switch-child | Run First
void | update-swipe | Run First

## Types and Values

#define | HDY_TYPE_SWIPEABLE
struct | HdySwipeableInterface
| HdySwipeable

## Object Hierarchy

        GInterface
        ╰── HdySwipeable

## Prerequisites

HdySwipeable requires GtkWidget.

## Known Implementations

HdySwipeable is implemented by HdyLeaflet and HdyPaginator.

## Description

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

HdySwipeable is only meant to be used by libhandy widgets and is currently implemented by HdyLeaflet and HdyPaginator. It should not be implemented by applications.

## Functions

## Types and Values

### HDY_TYPE_SWIPEABLE

    #define HDY_TYPE_SWIPEABLE (hdy_swipeable_get_type ())

### struct HdySwipeableInterface

    struct HdySwipeableInterface {
      GTypeInterface parent;

      void (*switch_child) (HdySwipeable *self,
                            guint         index,
                            gint64        duration);
      void (*begin_swipe)  (HdySwipeable *self,
                            gint          direction,
                            gboolean      direct);
      void (*update_swipe) (HdySwipeable *self,
                            gdouble       value);
      void (*end_swipe)    (HdySwipeable *self,
                            gint64        duration,
                            gdouble       to);
    };

An interface for swipeable widgets.

#### Members

GTypeInterface `parent`; | The parent interface. |
`switch_child` () | Switches visible child. |
`begin_swipe` () | Starts a swipe gesture. |
`update_swipe` () | Updates swipe progress value. |
`end_swipe` () | Ends a swipe gesture. |

Since: 0.0.12

### HdySwipeable

    typedef struct _HdySwipeable HdySwipeable;

## Signal Details

### The `“begin-swipe”` signal

    void
    user_function (HdySwipeable *self,
                   int           direction,
                   gpointer      user_data)

This signal is emitted when a possible swipe is detected. This is used by HdySwipeGroup, applications should not connect to it. The `direction` value can be used to restrict the swipe to a certain direction.

#### Parameters

self | The HdySwipeable instance |
direction | The direction of the swipe, can be 1 or -1 |
user_data | user data set when the signal handler was connected. |

Flags: Run First

Since: 0.0.12

### The `“end-swipe”` signal

    void
    user_function (HdySwipeable *self,
                   gint64        duration,
                   double        to,
                   gpointer      user_data)

This signal is emitted as soon as the gesture has stopped. This is used by HdySwipeGroup, applications should not connect to it.

#### Parameters

self | The HdySwipeable instance |
duration | Snap-back animation duration in milliseconds |
to | The progress value to animate to |
user_data | user data set when the signal handler was connected. |

Flags: Run First

Since: 0.0.12

### The `“switch-child”` signal

    void
    user_function (HdySwipeable *self,
                   guint         index,
                   gint64        duration,
                   gpointer      user_data)

This signal should be emitted when the widget's visible child is changed.

`duration` can be 0 if the child is switched without animation.

#### Parameters

self | The HdySwipeable instance |
index | the index of the child to switch to |
duration | Animation duration in milliseconds |
user_data | user data set when the signal handler was connected. |

Flags: Run First

Since: 0.0.12

### The `“update-swipe”` signal

    void
    user_function (HdySwipeable *self,
                   double        value,
                   gpointer      user_data)

This signal is emitted every time the progress value changes. This is used by HdySwipeGroup, applications should not connect to it.

#### Parameters

self | The HdySwipeable instance |
value | The current animation progress value |
user_data | user data set when the signal handler was connected. |

Flags: Run First

Since: 0.0.12

## See Also

HdyLeaflet, HdyPaginator, HdySwipeGroup