Class ContentDeserializer
- All Implemented Interfaces:
AsyncResult, Proxy
Deserializes content received via inter-application data transfers.
The GdkContentDeserializer transforms serialized content that is
identified by a mime type into an object identified by a GType.
GTK provides serializers and deserializers for common data types
such as text, colors, images or file lists. To register your own
deserialization functions, use Gdk.contentRegisterDeserializer(String, Type, ContentDeserializeFunc).
Also see ContentSerializer.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classInner class implementing a builder pattern to construct a GObject with properties.Nested classes/interfaces inherited from class GObject
GObject.NotifyCallback, GObject.ObjectClassNested classes/interfaces inherited from interface AsyncResult
AsyncResult.AsyncResult$Impl, AsyncResult.AsyncResultIface -
Constructor Summary
ConstructorsConstructorDescriptionCreate a new ContentDeserializer.ContentDeserializer(MemorySegment address) Create a ContentDeserializer instance for the provided memory address. -
Method Summary
Modifier and TypeMethodDescriptionprotected ContentDeserializerasParent()Return this instance as if it were its parent type.static ContentDeserializer.Builder<? extends ContentDeserializer.Builder> builder()AContentDeserializer.Builderobject constructs aContentDeserializerwith the specified properties.@Nullable CancellableGets the cancellable for the current operation.getGtype()Gets theGTypeto create an instance of.Gets the input stream for the current operation.static MemoryLayoutThe memory layout of the native struct.Gets the mime type to deserialize from.intGets the I/O priority for the current operation.@Nullable MemorySegmentGets the data that was associated with the current operation.static @Nullable TypegetType()Get the GType of the ContentDeserializer class.@Nullable MemorySegmentGets the user data that was passed when the deserializer was registered.getValue()Gets theGValueto store the deserialized object in.voidreturnError(GError error) Indicate that the deserialization has ended with an error.voidIndicate that the deserialization has been successfully completed.voidsetTaskData(@Nullable MemorySegment data) Associate data with the current deserialization operation.Methods inherited from class 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 TypeInstance
callParent, callParent, cast, getPrivate, readGClass, writeGClassMethods inherited from class ProxyInstance
equals, handle, hashCodeMethods inherited from class Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface AsyncResult
getSourceObject, isTagged, legacyPropagateError
-
Constructor Details
-
ContentDeserializer
Create a ContentDeserializer instance for the provided memory address.- Parameters:
address- the memory address of the native object
-
ContentDeserializer
public ContentDeserializer()Create a new ContentDeserializer.
-
-
Method Details
-
getType
Get the GType of the ContentDeserializer class.- Returns:
- the GType
-
getMemoryLayout
The memory layout of the native struct.- Returns:
- the memory layout
-
asParent
Return this instance as if it were its parent type. Comparable to the Javasuperkeyword, but ensures the parent typeclass is also used in native code. -
getCancellable
Gets the cancellable for the current operation.
This is the
GCancellablethat was passed toGdk.contentDeserializeAsync(InputStream, String, Type, int, Cancellable, AsyncReadyCallback).- Returns:
- the cancellable for the current operation
-
getGtype
Gets theGTypeto create an instance of.- Returns:
- the
GTypefor the current operation
-
getInputStream
Gets the input stream for the current operation.
This is the stream that was passed to
Gdk.contentDeserializeAsync(InputStream, String, Type, int, Cancellable, AsyncReadyCallback).- Returns:
- the input stream for the current operation
-
getMimeType
Gets the mime type to deserialize from.- Returns:
- the mime type for the current operation
-
getPriority
public int getPriority()Gets the I/O priority for the current operation.
This is the priority that was passed to
Gdk.contentDeserializeAsync(InputStream, String, Type, int, Cancellable, AsyncReadyCallback).- Returns:
- the I/O priority for the current operation
-
getTaskData
Gets the data that was associated with the current operation.
- Returns:
- the task data for this ContentDeserializer
-
getUserData
Gets the user data that was passed when the deserializer was registered.- Specified by:
getUserDatain interfaceAsyncResult- Returns:
- the user data for this deserializer
-
getValue
Gets theGValueto store the deserialized object in.- Returns:
- the
GValuefor the current operation
-
returnError
Indicate that the deserialization has ended with an error.
This function consumes
error.- Parameters:
error- aGError
-
returnSuccess
public void returnSuccess()Indicate that the deserialization has been successfully completed. -
setTaskData
Associate data with the current deserialization operation.- Parameters:
data- data to associate with this operation
-
builder
AContentDeserializer.Builderobject constructs aContentDeserializerwith the specified properties. Use the variousset...()methods to set properties, and finish construction withContentDeserializer.Builder.build().- Returns:
- the builder object
-