gi-handy-1.0.2: libhandy bindings
CopyrightWill Thompson and Iñaki García Etxebarria
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria
Safe HaskellSafe-Inferred
LanguageHaskell2010

GI.Handy.Objects.SwipeTracker

Description

Swipe tracker used in [classcarousel] and [classleaflet].

The HdySwipeTracker object can be used for implementing widgets with swipe gestures. It supports touch-based swipes, pointer dragging, and touchpad scrolling.

The widgets will probably want to expose [propertyswipeTracker:enabled] property. If they expect to use horizontal orientation, [propertyswipeTracker:reversed] property can be used for supporting RTL text direction.

Since: 1.0

Synopsis

Exported types

newtype SwipeTracker Source #

Memory-managed wrapper type.

Constructors

SwipeTracker (ManagedPtr SwipeTracker) 

Instances

Instances details
Eq SwipeTracker Source # 
Instance details

Defined in GI.Handy.Objects.SwipeTracker

GObject SwipeTracker Source # 
Instance details

Defined in GI.Handy.Objects.SwipeTracker

ManagedPtrNewtype SwipeTracker Source # 
Instance details

Defined in GI.Handy.Objects.SwipeTracker

Methods

toManagedPtr :: SwipeTracker -> ManagedPtr SwipeTracker

TypedObject SwipeTracker Source # 
Instance details

Defined in GI.Handy.Objects.SwipeTracker

Methods

glibType :: IO GType

HasParentTypes SwipeTracker Source # 
Instance details

Defined in GI.Handy.Objects.SwipeTracker

IsGValue (Maybe SwipeTracker) Source #

Convert SwipeTracker to and from GValue. See toGValue and fromGValue.

Instance details

Defined in GI.Handy.Objects.SwipeTracker

Methods

gvalueGType_ :: IO GType

gvalueSet_ :: Ptr GValue -> Maybe SwipeTracker -> IO ()

gvalueGet_ :: Ptr GValue -> IO (Maybe SwipeTracker)

type ParentTypes SwipeTracker Source # 
Instance details

Defined in GI.Handy.Objects.SwipeTracker

type ParentTypes SwipeTracker = '[Object, Orientable]

class (GObject o, IsDescendantOf SwipeTracker o) => IsSwipeTracker o Source #

Type class for types which can be safely cast to SwipeTracker, for instance with toSwipeTracker.

Instances

Instances details
(GObject o, IsDescendantOf SwipeTracker o) => IsSwipeTracker o Source # 
Instance details

Defined in GI.Handy.Objects.SwipeTracker

toSwipeTracker :: (MonadIO m, IsSwipeTracker o) => o -> m SwipeTracker Source #

Cast to SwipeTracker, for types for which this is known to be safe. For general casts, use castTo.

Methods

getAllowLongSwipes

swipeTrackerGetAllowLongSwipes Source #

Arguments

:: (HasCallStack, MonadIO m, IsSwipeTracker a) 
=> a

self: a swipe tracker

-> m Bool

Returns: whether long swipes are allowed

Whether to allow swiping for more than one snap point at a time.

If the value is FALSE, each swipe can only move to the adjacent snap points.

Since: 1.2

getAllowMouseDrag

swipeTrackerGetAllowMouseDrag Source #

Arguments

:: (HasCallStack, MonadIO m, IsSwipeTracker a) 
=> a

self: a swipe tracker

-> m Bool

Returns: TRUE is mouse dragging is allowed

Get whether self can be dragged with mouse pointer.

Since: 1.0

getEnabled

swipeTrackerGetEnabled Source #

Arguments

:: (HasCallStack, MonadIO m, IsSwipeTracker a) 
=> a

self: a swipe tracker

-> m Bool

Returns: TRUE if self is enabled

Get whether self is enabled.

Since: 1.0

getReversed

swipeTrackerGetReversed Source #

Arguments

:: (HasCallStack, MonadIO m, IsSwipeTracker a) 
=> a

self: a swipe tracker

-> m Bool

Returns: TRUE is the direction is reversed

Get whether self is reversing the swipe direction.

Since: 1.0

getSwipeable

swipeTrackerGetSwipeable Source #

Arguments

:: (HasCallStack, MonadIO m, IsSwipeTracker a) 
=> a

self: a swipe tracker

-> m Swipeable

Returns: the swipeable widget

Get self's swipeable widget.

Since: 1.0

new

swipeTrackerNew Source #

Arguments

:: (HasCallStack, MonadIO m, IsSwipeable a) 
=> a

swipeable: a swipeable to add the tracker on

-> m SwipeTracker

Returns: the newly created HdySwipeTracker

Creates a new HdySwipeTracker object on widget.

Since: 1.0

setAllowLongSwipes

swipeTrackerSetAllowLongSwipes Source #

Arguments

:: (HasCallStack, MonadIO m, IsSwipeTracker a) 
=> a

self: a swipe tracker

-> Bool

allowLongSwipes: whether to allow long swipes

-> m () 

Sets whether to allow swiping for more than one snap point at a time.

If the value is FALSE, each swipe can only move to the adjacent snap points.

Since: 1.2

setAllowMouseDrag

swipeTrackerSetAllowMouseDrag Source #

Arguments

:: (HasCallStack, MonadIO m, IsSwipeTracker a) 
=> a

self: a swipe tracker

-> Bool

allowMouseDrag: whether to allow mouse dragging

-> m () 

Set whether self can be dragged with mouse pointer.

This should usually be FALSE.

Since: 1.0

setEnabled

swipeTrackerSetEnabled Source #

Arguments

:: (HasCallStack, MonadIO m, IsSwipeTracker a) 
=> a

self: a swipe tracker

-> Bool

enabled: whether to enable to swipe tracker

-> m () 

Set whether self is enabled.

Since: 1.0

setReversed

swipeTrackerSetReversed Source #

Arguments

:: (HasCallStack, MonadIO m, IsSwipeTracker a) 
=> a

self: a swipe tracker

-> Bool

reversed: whether to reverse the swipe direction

-> m () 

Set whether to reverse the swipe direction.

If self is horizontal, can be used for supporting RTL text direction.

Since: 1.0

shiftPosition

swipeTrackerShiftPosition Source #

Arguments

:: (HasCallStack, MonadIO m, IsSwipeTracker a) 
=> a

self: a swipe tracker

-> Double

delta: the position delta

-> m () 

Move the current progress value by delta.

This can be used to adjust the current position if snap points move during the gesture.

Since: 1.0

Properties

allowLongSwipes

Whether to allow swiping for more than one snap point at a time.

If the value is FALSE, each swipe can only move to the adjacent snap points.

Since: 1.2

constructSwipeTrackerAllowLongSwipes :: (IsSwipeTracker o, MonadIO m) => Bool -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “allow-long-swipes” property. This is rarely needed directly, but it is used by new.

getSwipeTrackerAllowLongSwipes :: (MonadIO m, IsSwipeTracker o) => o -> m Bool Source #

Get the value of the “allow-long-swipes” property. When overloading is enabled, this is equivalent to

get swipeTracker #allowLongSwipes

setSwipeTrackerAllowLongSwipes :: (MonadIO m, IsSwipeTracker o) => o -> Bool -> m () Source #

Set the value of the “allow-long-swipes” property. When overloading is enabled, this is equivalent to

set swipeTracker [ #allowLongSwipes := value ]

allowMouseDrag

Whether to allow dragging with mouse pointer.

This should usually be FALSE.

Since: 1.0

constructSwipeTrackerAllowMouseDrag :: (IsSwipeTracker o, MonadIO m) => Bool -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “allow-mouse-drag” property. This is rarely needed directly, but it is used by new.

getSwipeTrackerAllowMouseDrag :: (MonadIO m, IsSwipeTracker o) => o -> m Bool Source #

Get the value of the “allow-mouse-drag” property. When overloading is enabled, this is equivalent to

get swipeTracker #allowMouseDrag

setSwipeTrackerAllowMouseDrag :: (MonadIO m, IsSwipeTracker o) => o -> Bool -> m () Source #

Set the value of the “allow-mouse-drag” property. When overloading is enabled, this is equivalent to

set swipeTracker [ #allowMouseDrag := value ]

enabled

Whether the swipe tracker is enabled.

When it's not enabled, no events will be processed. Usually widgets will want to expose this via a property.

Since: 1.0

constructSwipeTrackerEnabled :: (IsSwipeTracker o, MonadIO m) => Bool -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “enabled” property. This is rarely needed directly, but it is used by new.

getSwipeTrackerEnabled :: (MonadIO m, IsSwipeTracker o) => o -> m Bool Source #

Get the value of the “enabled” property. When overloading is enabled, this is equivalent to

get swipeTracker #enabled

setSwipeTrackerEnabled :: (MonadIO m, IsSwipeTracker o) => o -> Bool -> m () Source #

Set the value of the “enabled” property. When overloading is enabled, this is equivalent to

set swipeTracker [ #enabled := value ]

reversed

Whether to reverse the swipe direction.

If the swipe tracker is horizontal, it can be used for supporting RTL text direction.

Since: 1.0

constructSwipeTrackerReversed :: (IsSwipeTracker o, MonadIO m) => Bool -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “reversed” property. This is rarely needed directly, but it is used by new.

getSwipeTrackerReversed :: (MonadIO m, IsSwipeTracker o) => o -> m Bool Source #

Get the value of the “reversed” property. When overloading is enabled, this is equivalent to

get swipeTracker #reversed

setSwipeTrackerReversed :: (MonadIO m, IsSwipeTracker o) => o -> Bool -> m () Source #

Set the value of the “reversed” property. When overloading is enabled, this is equivalent to

set swipeTracker [ #reversed := value ]

swipeable

The widget the swipe tracker is attached to. Must not be NULL.

Since: 1.0

constructSwipeTrackerSwipeable :: (IsSwipeTracker o, MonadIO m, IsSwipeable a) => a -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “swipeable” property. This is rarely needed directly, but it is used by new.

getSwipeTrackerSwipeable :: (MonadIO m, IsSwipeTracker o) => o -> m Swipeable Source #

Get the value of the “swipeable” property. When overloading is enabled, this is equivalent to

get swipeTracker #swipeable

Signals

beginSwipe

type SwipeTrackerBeginSwipeCallback Source #

Arguments

 = NavigationDirection

direction: the direction of the swipe

-> Bool

direct: TRUE if the swipe is directly triggered by a gesture, FALSE if it's triggered via a [classswipeGroup]

-> IO () 

This signal is emitted when a possible swipe is detected.

The direction value can be used to restrict the swipe to a certain direction.

Since: 1.0

afterSwipeTrackerBeginSwipe :: (IsSwipeTracker a, MonadIO m) => a -> ((?self :: a) => SwipeTrackerBeginSwipeCallback) -> m SignalHandlerId Source #

Connect a signal handler for the beginSwipe signal, to be run after the default handler. When overloading is enabled, this is equivalent to

after swipeTracker #beginSwipe callback

By default the object invoking the signal is not passed to the callback. If you need to access it, you can use the implit ?self parameter. Note that this requires activating the ImplicitParams GHC extension.

onSwipeTrackerBeginSwipe :: (IsSwipeTracker a, MonadIO m) => a -> ((?self :: a) => SwipeTrackerBeginSwipeCallback) -> m SignalHandlerId Source #

Connect a signal handler for the beginSwipe signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on swipeTracker #beginSwipe callback

endSwipe

type SwipeTrackerEndSwipeCallback Source #

Arguments

 = Int64

duration: snap-back animation duration, in milliseconds

-> Double

to: the progress value to animate to

-> IO () 

This signal is emitted as soon as the gesture has stopped.

Since: 1.0

afterSwipeTrackerEndSwipe :: (IsSwipeTracker a, MonadIO m) => a -> ((?self :: a) => SwipeTrackerEndSwipeCallback) -> m SignalHandlerId Source #

Connect a signal handler for the endSwipe signal, to be run after the default handler. When overloading is enabled, this is equivalent to

after swipeTracker #endSwipe callback

By default the object invoking the signal is not passed to the callback. If you need to access it, you can use the implit ?self parameter. Note that this requires activating the ImplicitParams GHC extension.

onSwipeTrackerEndSwipe :: (IsSwipeTracker a, MonadIO m) => a -> ((?self :: a) => SwipeTrackerEndSwipeCallback) -> m SignalHandlerId Source #

Connect a signal handler for the endSwipe signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on swipeTracker #endSwipe callback

updateSwipe

type SwipeTrackerUpdateSwipeCallback Source #

Arguments

 = Double

progress: the current animation progress value

-> IO () 

This signal is emitted every time the progress value changes.

Since: 1.0

afterSwipeTrackerUpdateSwipe :: (IsSwipeTracker a, MonadIO m) => a -> ((?self :: a) => SwipeTrackerUpdateSwipeCallback) -> m SignalHandlerId Source #

Connect a signal handler for the updateSwipe signal, to be run after the default handler. When overloading is enabled, this is equivalent to

after swipeTracker #updateSwipe callback

By default the object invoking the signal is not passed to the callback. If you need to access it, you can use the implit ?self parameter. Note that this requires activating the ImplicitParams GHC extension.

onSwipeTrackerUpdateSwipe :: (IsSwipeTracker a, MonadIO m) => a -> ((?self :: a) => SwipeTrackerUpdateSwipeCallback) -> m SignalHandlerId Source #

Connect a signal handler for the updateSwipe signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on swipeTracker #updateSwipe callback