gi-secret-0.0.9: Libsecret bindings

CopyrightWill Thompson Iñaki García Etxebarria and Jonas Platte
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria (inaki@blueleaf.cc)
Safe HaskellNone
LanguageHaskell2010

GI.Secret.Objects.Prompt

Contents

Description

A proxy object representing a prompt that the Secret Service will display to the user.

Synopsis

Exported types

newtype Prompt Source #

Memory-managed wrapper type.

Constructors

Prompt (ManagedPtr Prompt) 
Instances
GObject Prompt Source # 
Instance details

Defined in GI.Secret.Objects.Prompt

Methods

gobjectType :: IO GType

HasParentTypes Prompt Source # 
Instance details

Defined in GI.Secret.Objects.Prompt

type ParentTypes Prompt Source # 
Instance details

Defined in GI.Secret.Objects.Prompt

type ParentTypes Prompt = DBusProxy ': (Object ': (AsyncInitable ': (DBusInterface ': (Initable ': ([] :: [Type])))))

class (GObject o, IsDescendantOf Prompt o) => IsPrompt o Source #

Type class for types which can be safely cast to Prompt, for instance with toPrompt.

Instances
(GObject o, IsDescendantOf Prompt o) => IsPrompt o Source # 
Instance details

Defined in GI.Secret.Objects.Prompt

toPrompt :: (MonadIO m, IsPrompt o) => o -> m Prompt Source #

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

noPrompt :: Maybe Prompt Source #

A convenience alias for Nothing :: Maybe Prompt.

Methods

perform

promptPerform Source #

Arguments

:: (HasCallStack, MonadIO m, IsPrompt a, IsCancellable b) 
=> a

self: a prompt

-> Maybe Text

windowId: string form of XWindow id for parent window to be transient for

-> VariantType

returnType: the variant type of the prompt result

-> Maybe b

cancellable: optional cancellation object

-> Maybe AsyncReadyCallback

callback: called when the operation completes

-> m () 

Runs a prompt and performs the prompting. Returns True if the prompt was completed and not dismissed.

If windowId is non-null then it is used as an XWindow id on Linux. The API expects this id to be converted to a string using the <literal>d</literal> printf format. The Secret Service can make its prompt transient for the window with this id. In some Secret Service implementations this is not possible, so the behavior depending on this should degrade gracefully.

This method will return immediately and complete asynchronously.

performFinish

promptPerformFinish Source #

Arguments

:: (HasCallStack, MonadIO m, IsPrompt a, IsAsyncResult b) 
=> a

self: a prompt

-> b

result: the asynchronous result passed to the callback

-> m GVariant

Returns: Nothing if the prompt was dismissed or an error occurred, a variant result if the prompt was successful (Can throw GError)

Complete asynchronous operation to run a prompt and perform the prompting.

Returns a variant result if the prompt was completed and not dismissed. The type of result depends on the action the prompt is completing, and is defined in the Secret Service DBus API specification.

performSync

promptPerformSync Source #

Arguments

:: (HasCallStack, MonadIO m, IsPrompt a, IsCancellable b) 
=> a

self: a prompt

-> Maybe Text

windowId: string form of XWindow id for parent window to be transient for

-> Maybe b

cancellable: optional cancellation object

-> VariantType

returnType: the variant type of the prompt result

-> m GVariant

Returns: Nothing if the prompt was dismissed or an error occurred (Can throw GError)

Runs a prompt and performs the prompting. Returns a variant result if the prompt was completed and not dismissed. The type of result depends on the action the prompt is completing, and is defined in the Secret Service DBus API specification.

If windowId is non-null then it is used as an XWindow id on Linux. The API expects this id to be converted to a string using the <literal>d</literal> printf format. The Secret Service can make its prompt transient for the window with this id. In some Secret Service implementations this is not possible, so the behavior depending on this should degrade gracefully.

This method may block indefinitely and should not be used in user interface threads.

run

promptRun Source #

Arguments

:: (HasCallStack, MonadIO m, IsPrompt a, IsCancellable b) 
=> a

self: a prompt

-> Maybe Text

windowId: string form of XWindow id for parent window to be transient for

-> Maybe b

cancellable: optional cancellation object

-> VariantType

returnType: the variant type of the prompt result

-> m GVariant

Returns: Nothing if the prompt was dismissed or an error occurred (Can throw GError)

Runs a prompt and performs the prompting. Returns a variant result if the prompt was completed and not dismissed. The type of result depends on the action the prompt is completing, and is defined in the Secret Service DBus API specification.

If windowId is non-null then it is used as an XWindow id on Linux. The API expects this id to be converted to a string using the <literal>d</literal> printf format. The Secret Service can make its prompt transient for the window with this id. In some Secret Service implementations this is not possible, so the behavior depending on this should degrade gracefully.

This runs the dialog in a recursive mainloop. When run from a user interface thread, this means the user interface will remain responsive. Care should be taken that appropriate user interface actions are disabled while running the prompt.