gi-adwaita-1.0.3: Adwaita bindings
CopyrightWill Thompson and Iñaki García Etxebarria
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria
Safe HaskellSafe-Inferred
LanguageHaskell2010

GI.Adw.Objects.SwipeTracker

Description

A swipe tracker used in [classcarousel], [classflap] and [classleaflet].

The AdwSwipeTracker 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 the [propertyswipeTracker:enabled] property. If they expect to use horizontal orientation, [propertyswipeTracker:reversed] 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.Adw.Objects.SwipeTracker

GObject SwipeTracker Source # 
Instance details

Defined in GI.Adw.Objects.SwipeTracker

ManagedPtrNewtype SwipeTracker Source # 
Instance details

Defined in GI.Adw.Objects.SwipeTracker

Methods

toManagedPtr :: SwipeTracker -> ManagedPtr SwipeTracker

TypedObject SwipeTracker Source # 
Instance details

Defined in GI.Adw.Objects.SwipeTracker

Methods

glibType :: IO GType

HasParentTypes SwipeTracker Source # 
Instance details

Defined in GI.Adw.Objects.SwipeTracker

IsGValue (Maybe SwipeTracker) Source #

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

Instance details

Defined in GI.Adw.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.Adw.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.Adw.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

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

Since: 1.0

getAllowMouseDrag

swipeTrackerGetAllowMouseDrag Source #

Arguments

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

self: a swipe tracker

-> m Bool

Returns: whether mouse dragging is allowed

Gets 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: whether self is enabled

Gets whether self is enabled.

Since: 1.0

getReversed

swipeTrackerGetReversed Source #

Arguments

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

self: a swipe tracker

-> m Bool

Returns: whether the direction is reversed

Gets 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 the widget self is attached to.

Since: 1.0

new

swipeTrackerNew Source #

Arguments

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

swipeable: a widget to add the tracker on

-> m SwipeTracker

Returns: the newly created AdwSwipeTracker

Creates a new AdwSwipeTracker for 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.0

setAllowMouseDrag

swipeTrackerSetAllowMouseDrag Source #

Arguments

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

self: a swipe tracker

-> Bool

allowMouseDrag: whether to allow mouse dragging

-> m () 

Sets whether self can be dragged with mouse pointer.

Since: 1.0

setEnabled

swipeTrackerSetEnabled Source #

Arguments

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

self: a swipe tracker

-> Bool

enabled: whether self is enabled

-> m () 

Sets whether self 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

setReversed

swipeTrackerSetReversed Source #

Arguments

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

self: a swipe tracker

-> Bool

reversed: whether to reverse the swipe direction

-> m () 

Sets whether to reverse the swipe direction.

If the swipe tracker is horizontal, it 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 () 

Moves 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.0

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.

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.

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 = IO () Source #

This signal is emitted right before a swipe will be started, after the drag threshold has been passed.

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

 = Double

velocity: the velocity of the swipe

-> Double

to: the progress value to animate to

-> IO () 

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

The user is expected to animate the deceleration from the current progress value to to with an animation using velocity as the initial velocity, provided in pixels per second. [classspringAnimation] is usually a good fit for this.

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

prepare

type SwipeTrackerPrepareCallback Source #

Arguments

 = NavigationDirection

direction: the direction of the swipe

-> 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

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

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

after swipeTracker #prepare 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.

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

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

on swipeTracker #prepare 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