Copyright | Will Thompson and Iñaki García Etxebarria |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
A prompt in the Service
A proxy object representing a prompt that the Secret Service will display to the user.
Certain actions on the Secret Service require user prompting to complete,
such as creating a collection, or unlocking a collection. When such a prompt
is necessary, then a Prompt
object is created by this library, and
passed to the [methodservice
.prompt] method. In this way it is handled
automatically.
In order to customize prompt handling, override the
[vfuncservice
.prompt_async] and [vfuncservice
.prompt_finish] virtual
methods of the [classservice
] class.
Synopsis
- newtype Prompt = Prompt (ManagedPtr Prompt)
- class (GObject o, IsDescendantOf Prompt o) => IsPrompt o
- toPrompt :: (MonadIO m, IsPrompt o) => o -> m Prompt
- promptPerform :: (HasCallStack, MonadIO m, IsPrompt a, IsCancellable b) => a -> Maybe Text -> VariantType -> Maybe b -> Maybe AsyncReadyCallback -> m ()
- promptPerformFinish :: (HasCallStack, MonadIO m, IsPrompt a, IsAsyncResult b) => a -> b -> m GVariant
- promptPerformSync :: (HasCallStack, MonadIO m, IsPrompt a, IsCancellable b) => a -> Maybe Text -> Maybe b -> VariantType -> m GVariant
- promptRun :: (HasCallStack, MonadIO m, IsPrompt a, IsCancellable b) => a -> Maybe Text -> Maybe b -> VariantType -> m GVariant
Exported types
Memory-managed wrapper type.
Instances
Eq Prompt Source # | |
GObject Prompt Source # | |
Defined in GI.Secret.Objects.Prompt | |
ManagedPtrNewtype Prompt Source # | |
Defined in GI.Secret.Objects.Prompt toManagedPtr :: Prompt -> ManagedPtr Prompt | |
TypedObject Prompt Source # | |
Defined in GI.Secret.Objects.Prompt | |
HasParentTypes Prompt Source # | |
Defined in GI.Secret.Objects.Prompt | |
IsGValue (Maybe Prompt) Source # | Convert |
Defined in GI.Secret.Objects.Prompt gvalueGType_ :: IO GType gvalueSet_ :: Ptr GValue -> Maybe Prompt -> IO () gvalueGet_ :: Ptr GValue -> IO (Maybe Prompt) | |
type ParentTypes Prompt Source # | |
Defined in GI.Secret.Objects.Prompt type ParentTypes Prompt = '[DBusProxy, Object, AsyncInitable, DBusInterface, Initable] |
class (GObject o, IsDescendantOf Prompt o) => IsPrompt o Source #
Instances
(GObject o, IsDescendantOf Prompt o) => IsPrompt o Source # | |
Defined in GI.Secret.Objects.Prompt |
Methods
Click to display all available methods, including inherited ones
Methods
bindProperty, bindPropertyFull, call, callFinish, callSync, callWithUnixFdList, callWithUnixFdListFinish, callWithUnixFdListSync, forceFloating, freezeNotify, getv, init, initAsync, initFinish, isFloating, notify, notifyByPspec, perform, performFinish, performSync, ref, refSink, run, runDispose, stealData, stealQdata, thawNotify, unref, watchClosure.
Getters
getCachedProperty, getCachedPropertyNames, getConnection, getData, getDefaultTimeout, getFlags, getInfo, getInterfaceInfo, getInterfaceName, getName, getNameOwner, getObject, getObjectPath, getProperty, getQdata.
Setters
setCachedProperty, setData, setDataFull, setDefaultTimeout, setInterfaceInfo, setObject, setProperty.
perform
:: (HasCallStack, MonadIO m, IsPrompt a, IsCancellable b) | |
=> a |
|
-> Maybe Text |
|
-> VariantType |
|
-> Maybe b |
|
-> Maybe AsyncReadyCallback |
|
-> 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 %d
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
:: (HasCallStack, MonadIO m, IsPrompt a, IsAsyncResult b) | |
=> a |
|
-> b |
|
-> m GVariant | Returns: |
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
:: (HasCallStack, MonadIO m, IsPrompt a, IsCancellable b) | |
=> a |
|
-> Maybe Text |
|
-> Maybe b |
|
-> VariantType |
|
-> m GVariant | Returns: |
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 %d
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
:: (HasCallStack, MonadIO m, IsPrompt a, IsCancellable b) | |
=> a |
|
-> Maybe Text |
|
-> Maybe b |
|
-> VariantType |
|
-> m GVariant | Returns: |
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 %d
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.