Class Prompt
- All Implemented Interfaces:
AsyncInitable,DBusInterface,Initable,Proxy
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 SecretPrompt object is created by this library, and
passed to the Service.prompt(org.gnome.secret.Prompt, org.gnome.glib.VariantType, org.gnome.gio.Cancellable, org.gnome.gio.AsyncReadyCallback) method. In this way it is handled
automatically.
In order to customize prompt handling, override the
Service.promptAsync(org.gnome.secret.Prompt, org.gnome.glib.VariantType, org.gnome.gio.Cancellable, org.gnome.gio.AsyncReadyCallback) and Service.promptFinish(org.gnome.gio.AsyncResult) virtual
methods of the Service class.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classPrompt.Builder<B extends Prompt.Builder<B>>Inner class implementing a builder pattern to construct a GObject with properties.static classThe class forSecretPrompt.Nested classes/interfaces inherited from class org.gnome.gio.DBusProxy
DBusProxy.DBusProxyClass, DBusProxy.GPropertiesChangedCallback, DBusProxy.GSignalCallbackNested classes/interfaces inherited from class org.gnome.gobject.GObject
GObject.NotifyCallback, GObject.ObjectClassNested classes/interfaces inherited from interface org.gnome.gio.AsyncInitable
AsyncInitable.AsyncInitable$Impl, AsyncInitable.AsyncInitableIfaceNested classes/interfaces inherited from interface org.gnome.gio.DBusInterface
DBusInterface.DBusInterface$Impl, DBusInterface.DBusInterfaceIfaceNested classes/interfaces inherited from interface org.gnome.gio.Initable
Initable.Initable$Impl, Initable.InitableIface -
Constructor Summary
ConstructorsConstructorDescriptionPrompt()Creates a new Prompt.Prompt(MemorySegment address) Create a Prompt proxy instance for the provided memory address. -
Method Summary
Modifier and TypeMethodDescriptionprotected PromptasParent()Returns this instance as if it were its parent type.static Prompt.Builder<? extends Prompt.Builder> builder()APrompt.Builderobject constructs aPromptwith the specified properties.static MemoryLayoutThe memory layout of the native struct.static @Nullable TypegetType()Get the GType of the Prompt classvoidperform(@Nullable String windowId, VariantType returnType, @Nullable Cancellable cancellable, @Nullable AsyncReadyCallback callback) Runs a prompt and performs the prompting.performFinish(AsyncResult result) Complete asynchronous operation to run a prompt and perform the prompting.performSync(@Nullable String windowId, @Nullable Cancellable cancellable, VariantType returnType) Runs a prompt and performs the prompting.run(@Nullable String windowId, @Nullable Cancellable cancellable, VariantType returnType) Runs a prompt and performs the prompting.Methods inherited from class org.gnome.gio.DBusProxy
call, call, callFinish, callSync, callSync, callWithUnixFdList, callWithUnixFdList, callWithUnixFdListFinish, callWithUnixFdListSync, callWithUnixFdListSync, emitGPropertiesChanged, emitGSignal, finish, forBusFinish, forBusSync, forBusSync, getCachedProperty, getCachedPropertyNames, getConnection, getDefaultTimeout, getFlags, getInterfaceInfo, getInterfaceName, getName, getNameOwner, getObjectPath, gPropertiesChanged, gSignal, new_, new_, newForBus, newForBus, onGPropertiesChanged, onGSignal, setCachedProperty, setDefaultTimeout, setInterfaceInfo, sync, syncMethods inherited from class org.gnome.gobject.GObject
addToggleRef, addWeakPointer, bindProperty, bindProperty, bindProperty, bindPropertyFull, bindPropertyFull, bindPropertyWithClosures, bindPropertyWithClosures, compatControl, connect, connect, connect, constructed, disconnect, dispatchPropertiesChanged, dispose, dupData, dupQdata, emit, emitNotify, finalize_, forceFloating, freezeNotify, get, getData, getProperty, getProperty, getProperty, getQdata, getv, interfaceFindProperty, interfaceInstallProperty, interfaceListProperties, isFloating, newInstance, newInstance, newv, notify, notify, notifyByPspec, onNotify, ref, refSink, removeToggleRef, removeWeakPointer, replaceData, replaceQdata, runDispose, set, setData, setDataFull, setProperty, setProperty, setProperty, setQdata, setQdataFull, setv, stealData, stealQdata, takeRef, thawNotify, unref, watchClosure, weakRef, weakUnref, withPropertiesMethods inherited from class org.gnome.gobject.TypeInstance
callParent, callParent, cast, getPrivate, readGClass, writeGClassMethods inherited from class org.javagi.base.ProxyInstance
equals, handle, hashCodeMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.gnome.gio.AsyncInitable
initAsync, initFinishMethods inherited from interface org.gnome.gio.DBusInterface
getInfo, getObject, setObject
-
Constructor Details
-
Prompt
Create a Prompt proxy instance for the provided memory address.- Parameters:
address- the memory address of the native object
-
Prompt
public Prompt()Creates a new Prompt.
-
-
Method Details
-
getType
-
getMemoryLayout
The memory layout of the native struct.- Returns:
- the memory layout
-
asParent
Returns this instance as if it were its parent type. This is mostly synonymous to the Javasuperkeyword, but will set the native typeclass function pointers to the parent type. When overriding a native virtual method in Java, "chaining up" withsuper.methodName()doesn't work, because it invokes the overridden function pointer again. To chain up, callasParent().methodName(). This will call the native function pointer of this virtual method in the typeclass of the parent type. -
perform
public void perform(@Nullable String windowId, VariantType returnType, @Nullable Cancellable cancellable, @Nullable AsyncReadyCallback callback) Runs a prompt and performs the prompting.Returns
trueif the prompt was completed and not dismissed.If
windowIdis 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%dprintf 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.
- Parameters:
windowId- string form of XWindow id for parent window to be transient forreturnType- the variant type of the prompt resultcancellable- optional cancellation objectcallback- called when the operation completes
-
performFinish
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.
- Parameters:
result- the asynchronous result passed to the callback- Returns:
nullif the prompt was dismissed or an error occurred, a variant result if the prompt was successful- Throws:
GErrorException- seeGError
-
performSync
public Variant performSync(@Nullable String windowId, @Nullable Cancellable cancellable, VariantType returnType) throws GErrorException 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
windowIdis 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%dprintf 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.
- Parameters:
windowId- string form of XWindow id for parent window to be transient forcancellable- optional cancellation objectreturnType- the variant type of the prompt result- Returns:
nullif the prompt was dismissed or an error occurred- Throws:
GErrorException- seeGError
-
run
public Variant run(@Nullable String windowId, @Nullable Cancellable cancellable, VariantType returnType) throws GErrorException 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
windowIdis 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%dprintf 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.
- Parameters:
windowId- string form of XWindow id for parent window to be transient forcancellable- optional cancellation objectreturnType- the variant type of the prompt result- Returns:
nullif the prompt was dismissed or an error occurred- Throws:
GErrorException- seeGError
-
builder
APrompt.Builderobject constructs aPromptwith the specified properties. Use the variousset...()methods to set properties, and finish construction withPrompt.Builder.build().- Returns:
- the builder object
-