gi-adwaita-1.0.5: 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.Carousel

Description

A paginated scrolling widget.

<picture> <source srcset="carousel-dark.png" media="(prefers-color-scheme: dark)"> <img src="carousel.png" alt="carousel"> </picture>

The AdwCarousel widget can be used to display a set of pages with swipe-based navigation between them.

classcarouselIndicatorDots
and [classcarouselIndicatorLines] can be used to provide page indicators for AdwCarousel.

CSS nodes

AdwCarousel has a single CSS node with name carousel.

Synopsis

Exported types

newtype Carousel Source #

Memory-managed wrapper type.

Constructors

Carousel (ManagedPtr Carousel) 

Instances

Instances details
Eq Carousel Source # 
Instance details

Defined in GI.Adw.Objects.Carousel

GObject Carousel Source # 
Instance details

Defined in GI.Adw.Objects.Carousel

ManagedPtrNewtype Carousel Source # 
Instance details

Defined in GI.Adw.Objects.Carousel

Methods

toManagedPtr :: Carousel -> ManagedPtr Carousel

TypedObject Carousel Source # 
Instance details

Defined in GI.Adw.Objects.Carousel

Methods

glibType :: IO GType

HasParentTypes Carousel Source # 
Instance details

Defined in GI.Adw.Objects.Carousel

IsGValue (Maybe Carousel) Source #

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

Instance details

Defined in GI.Adw.Objects.Carousel

Methods

gvalueGType_ :: IO GType

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

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

type ParentTypes Carousel Source # 
Instance details

Defined in GI.Adw.Objects.Carousel

type ParentTypes Carousel = '[Widget, Object, Swipeable, Accessible, Buildable, ConstraintTarget, Orientable]

class (GObject o, IsDescendantOf Carousel o) => IsCarousel o Source #

Type class for types which can be safely cast to Carousel, for instance with toCarousel.

Instances

Instances details
(GObject o, IsDescendantOf Carousel o) => IsCarousel o Source # 
Instance details

Defined in GI.Adw.Objects.Carousel

toCarousel :: (MonadIO m, IsCarousel o) => o -> m Carousel Source #

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

Methods

Click to display all available methods, including inherited ones

Expand

Methods

actionSetEnabled, activate, activateAction, activateDefault, addController, addCssClass, addMnemonicLabel, addTickCallback, allocate, append, bindProperty, bindPropertyFull, childFocus, computeBounds, computeExpand, computePoint, computeTransform, contains, createPangoContext, createPangoLayout, disposeTemplate, dragCheckThreshold, errorBell, forceFloating, freezeNotify, getv, grabFocus, hasCssClass, hasDefault, hasFocus, hasVisibleFocus, hide, inDestruction, initTemplate, insert, insertActionGroup, insertAfter, insertBefore, isAncestor, isDrawable, isFloating, isFocus, isSensitive, isVisible, keynavFailed, listMnemonicLabels, map, measure, mnemonicActivate, notify, notifyByPspec, observeChildren, observeControllers, pick, prepend, queueAllocate, queueDraw, queueResize, realize, ref, refSink, remove, removeController, removeCssClass, removeMnemonicLabel, removeTickCallback, reorder, resetProperty, resetRelation, resetState, runDispose, scrollTo, shouldLayout, show, sizeAllocate, snapshotChild, stealData, stealQdata, thawNotify, translateCoordinates, triggerTooltipQuery, unmap, unparent, unrealize, unref, unsetStateFlags, updateNextAccessibleSibling, updateProperty, updateRelation, updateState, watchClosure.

Getters

getAccessibleParent, getAccessibleRole, getAllocatedBaseline, getAllocatedHeight, getAllocatedWidth, getAllocation, getAllowLongSwipes, getAllowMouseDrag, getAllowScrollWheel, getAncestor, getAtContext, getBounds, getBuildableId, getCanFocus, getCanTarget, getCancelProgress, getChildVisible, getClipboard, getColor, getCssClasses, getCssName, getCursor, getData, getDirection, getDisplay, getDistance, getFirstAccessibleChild, getFirstChild, getFocusChild, getFocusOnClick, getFocusable, getFontMap, getFontOptions, getFrameClock, getHalign, getHasTooltip, getHeight, getHexpand, getHexpandSet, getInteractive, getLastChild, getLayoutManager, getMapped, getMarginBottom, getMarginEnd, getMarginStart, getMarginTop, getNPages, getName, getNative, getNextAccessibleSibling, getNextSibling, getNthPage, getOpacity, getOrientation, getOverflow, getPangoContext, getParent, getPlatformState, getPosition, getPreferredSize, getPrevSibling, getPrimaryClipboard, getProgress, getProperty, getQdata, getRealized, getReceivesDefault, getRequestMode, getRevealDuration, getRoot, getScaleFactor, getScrollParams, getSensitive, getSettings, getSize, getSizeRequest, getSnapPoints, getSpacing, getStateFlags, getStyleContext, getSwipeArea, getTemplateChild, getTooltipMarkup, getTooltipText, getValign, getVexpand, getVexpandSet, getVisible, getWidth.

Setters

setAccessibleParent, setAllowLongSwipes, setAllowMouseDrag, setAllowScrollWheel, setCanFocus, setCanTarget, setChildVisible, setCssClasses, setCursor, setCursorFromName, setData, setDataFull, setDirection, setFocusChild, setFocusOnClick, setFocusable, setFontMap, setFontOptions, setHalign, setHasTooltip, setHexpand, setHexpandSet, setInteractive, setLayoutManager, setMarginBottom, setMarginEnd, setMarginStart, setMarginTop, setName, setOpacity, setOrientation, setOverflow, setParent, setProperty, setReceivesDefault, setRevealDuration, setScrollParams, setSensitive, setSizeRequest, setSpacing, setStateFlags, setTooltipMarkup, setTooltipText, setValign, setVexpand, setVexpandSet, setVisible.

append

carouselAppend Source #

Arguments

:: (HasCallStack, MonadIO m, IsCarousel a, IsWidget b) 
=> a

self: a carousel

-> b

child: a widget to add

-> m () 

Appends child to self.

getAllowLongSwipes

carouselGetAllowLongSwipes Source #

Arguments

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

self: a carousel

-> m Bool

Returns: TRUE if long swipes are allowed

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

getAllowMouseDrag

carouselGetAllowMouseDrag Source #

Arguments

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

self: a carousel

-> m Bool

Returns: whether self can be dragged with mouse pointer

Sets whether self can be dragged with mouse pointer.

getAllowScrollWheel

carouselGetAllowScrollWheel Source #

Arguments

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

self: a carousel

-> m Bool

Returns: TRUE if self will respond to scroll wheel events

Gets whether self will respond to scroll wheel events.

getInteractive

carouselGetInteractive Source #

Arguments

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

self: a carousel

-> m Bool

Returns: whether self can be navigated

Gets whether self can be navigated.

getNPages

carouselGetNPages Source #

Arguments

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

self: a carousel

-> m Word32

Returns: the number of pages in self

Gets the number of pages in self.

getNthPage

carouselGetNthPage Source #

Arguments

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

self: a carousel

-> Word32

n: index of the page

-> m Widget

Returns: the page

Gets the page at position n.

getPosition

carouselGetPosition Source #

Arguments

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

self: a carousel

-> m Double

Returns: the scroll position

Gets current scroll position in self, unitless.

1 matches 1 page. Use [methodcarousel.scroll_to] for changing it.

getRevealDuration

carouselGetRevealDuration Source #

Arguments

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

self: a carousel

-> m Word32

Returns: the duration

Gets the page reveal duration, in milliseconds.

getScrollParams

carouselGetScrollParams Source #

Arguments

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

self: a carousel

-> m SpringParams

Returns: the animation parameters

Gets the scroll animation spring parameters for self.

getSpacing

carouselGetSpacing Source #

Arguments

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

self: a carousel

-> m Word32

Returns: spacing between pages

Gets spacing between pages in pixels.

insert

carouselInsert Source #

Arguments

:: (HasCallStack, MonadIO m, IsCarousel a, IsWidget b) 
=> a

self: a carousel

-> b

child: a widget to add

-> Int32

position: the position to insert child at

-> m () 

Inserts child into self at position position.

If position is -1, or larger than the number of pages, child will be appended to the end.

new

carouselNew Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> m Carousel

Returns: the newly created AdwCarousel

Creates a new AdwCarousel.

prepend

carouselPrepend Source #

Arguments

:: (HasCallStack, MonadIO m, IsCarousel a, IsWidget b) 
=> a

self: a carousel

-> b

child: a widget to add

-> m () 

Prepends child to self.

remove

carouselRemove Source #

Arguments

:: (HasCallStack, MonadIO m, IsCarousel a, IsWidget b) 
=> a

self: a carousel

-> b

child: a widget to remove

-> m () 

Removes child from self.

reorder

carouselReorder Source #

Arguments

:: (HasCallStack, MonadIO m, IsCarousel a, IsWidget b) 
=> a

self: a carousel

-> b

child: a widget to add

-> Int32

position: the position to move child to

-> m () 

Moves child into position position.

If position is -1, or larger than the number of pages, child will be moved at the end.

scrollTo

carouselScrollTo Source #

Arguments

:: (HasCallStack, MonadIO m, IsCarousel a, IsWidget b) 
=> a

self: a carousel

-> b

widget: a child of self

-> Bool

animate: whether to animate the transition

-> m () 

Scrolls to widget.

If animate is TRUE, the transition will be animated.

setAllowLongSwipes

carouselSetAllowLongSwipes Source #

Arguments

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

self: a carousel

-> Bool

allowLongSwipes: whether to allow long swipes

-> m () 

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

If allowLongSwipes is FALSE, each swipe can only move to the adjacent pages.

setAllowMouseDrag

carouselSetAllowMouseDrag Source #

Arguments

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

self: a carousel

-> Bool

allowMouseDrag: whether self can be dragged with mouse pointer

-> m () 

Sets whether self can be dragged with mouse pointer.

If allowMouseDrag is FALSE, dragging is only available on touch.

setAllowScrollWheel

carouselSetAllowScrollWheel Source #

Arguments

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

self: a carousel

-> Bool

allowScrollWheel: whether self will respond to scroll wheel events

-> m () 

Sets whether self will respond to scroll wheel events.

If allowScrollWheel is FALSE, wheel events will be ignored.

setInteractive

carouselSetInteractive Source #

Arguments

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

self: a carousel

-> Bool

interactive: whether self can be navigated

-> m () 

Sets whether self can be navigated.

This can be used to temporarily disable the carousel to only allow navigating it in a certain state.

setRevealDuration

carouselSetRevealDuration Source #

Arguments

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

self: a carousel

-> Word32

revealDuration: the new reveal duration value

-> m () 

Sets the page reveal duration, in milliseconds.

Reveal duration is used when animating adding or removing pages.

setScrollParams

carouselSetScrollParams Source #

Arguments

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

self: a carousel

-> SpringParams

params: the new parameters

-> m () 

Sets the scroll animation spring parameters for self.

The default value is equivalent to:

c code

adw_spring_params_new (1, 0.5, 500)

setSpacing

carouselSetSpacing Source #

Arguments

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

self: a carousel

-> Word32

spacing: the new spacing value

-> m () 

Sets spacing between pages in pixels.

Properties

allowLongSwipes

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

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

constructCarouselAllowLongSwipes :: (IsCarousel 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.

getCarouselAllowLongSwipes :: (MonadIO m, IsCarousel o) => o -> m Bool Source #

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

get carousel #allowLongSwipes

setCarouselAllowLongSwipes :: (MonadIO m, IsCarousel o) => o -> Bool -> m () Source #

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

set carousel [ #allowLongSwipes := value ]

allowMouseDrag

Sets whether the AdwCarousel can be dragged with mouse pointer.

If the value is FALSE, dragging is only available on touch.

constructCarouselAllowMouseDrag :: (IsCarousel 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.

getCarouselAllowMouseDrag :: (MonadIO m, IsCarousel o) => o -> m Bool Source #

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

get carousel #allowMouseDrag

setCarouselAllowMouseDrag :: (MonadIO m, IsCarousel o) => o -> Bool -> m () Source #

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

set carousel [ #allowMouseDrag := value ]

allowScrollWheel

Whether the widget will respond to scroll wheel events.

If the value is FALSE, wheel events will be ignored.

constructCarouselAllowScrollWheel :: (IsCarousel o, MonadIO m) => Bool -> m (GValueConstruct o) Source #

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

getCarouselAllowScrollWheel :: (MonadIO m, IsCarousel o) => o -> m Bool Source #

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

get carousel #allowScrollWheel

setCarouselAllowScrollWheel :: (MonadIO m, IsCarousel o) => o -> Bool -> m () Source #

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

set carousel [ #allowScrollWheel := value ]

interactive

Whether the carousel can be navigated.

This can be used to temporarily disable the carousel to only allow navigating it in a certain state.

constructCarouselInteractive :: (IsCarousel o, MonadIO m) => Bool -> m (GValueConstruct o) Source #

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

getCarouselInteractive :: (MonadIO m, IsCarousel o) => o -> m Bool Source #

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

get carousel #interactive

setCarouselInteractive :: (MonadIO m, IsCarousel o) => o -> Bool -> m () Source #

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

set carousel [ #interactive := value ]

nPages

The number of pages in a AdwCarousel.

getCarouselNPages :: (MonadIO m, IsCarousel o) => o -> m Word32 Source #

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

get carousel #nPages

position

Current scrolling position, unitless.

1 matches 1 page. Use [methodcarousel.scroll_to] for changing it.

getCarouselPosition :: (MonadIO m, IsCarousel o) => o -> m Double Source #

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

get carousel #position

revealDuration

Page reveal duration, in milliseconds.

Reveal duration is used when animating adding or removing pages.

constructCarouselRevealDuration :: (IsCarousel o, MonadIO m) => Word32 -> m (GValueConstruct o) Source #

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

getCarouselRevealDuration :: (MonadIO m, IsCarousel o) => o -> m Word32 Source #

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

get carousel #revealDuration

setCarouselRevealDuration :: (MonadIO m, IsCarousel o) => o -> Word32 -> m () Source #

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

set carousel [ #revealDuration := value ]

scrollParams

Scroll animation spring parameters.

The default value is equivalent to:

c code

adw_spring_params_new (1, 0.5, 500)

constructCarouselScrollParams :: (IsCarousel o, MonadIO m) => SpringParams -> m (GValueConstruct o) Source #

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

getCarouselScrollParams :: (MonadIO m, IsCarousel o) => o -> m (Maybe SpringParams) Source #

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

get carousel #scrollParams

setCarouselScrollParams :: (MonadIO m, IsCarousel o) => o -> SpringParams -> m () Source #

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

set carousel [ #scrollParams := value ]

spacing

Spacing between pages in pixels.

constructCarouselSpacing :: (IsCarousel o, MonadIO m) => Word32 -> m (GValueConstruct o) Source #

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

getCarouselSpacing :: (MonadIO m, IsCarousel o) => o -> m Word32 Source #

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

get carousel #spacing

setCarouselSpacing :: (MonadIO m, IsCarousel o) => o -> Word32 -> m () Source #

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

set carousel [ #spacing := value ]

Signals

pageChanged

type CarouselPageChangedCallback Source #

Arguments

 = Word32

index: current page

-> IO () 

This signal is emitted after a page has been changed.

It can be used to implement "infinite scrolling" by amending the pages after every scroll. Note that an empty carousel is indicated by (int)index == -1.

afterCarouselPageChanged :: (IsCarousel a, MonadIO m) => a -> ((?self :: a) => CarouselPageChangedCallback) -> m SignalHandlerId Source #

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

after carousel #pageChanged 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.

onCarouselPageChanged :: (IsCarousel a, MonadIO m) => a -> ((?self :: a) => CarouselPageChangedCallback) -> m SignalHandlerId Source #

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

on carousel #pageChanged callback