Package ch.bailu.gtk.gdk
Klasse ContentProvider
java.lang.Object
ch.bailu.gtk.type.Type
ch.bailu.gtk.type.Pointer
ch.bailu.gtk.gobject.Object
ch.bailu.gtk.type.PropertyHolder
ch.bailu.gtk.gdk.ContentProvider
- Alle implementierten Schnittstellen:
PointerInterface
Provides content for the clipboard or for drag-and-drop operations
in a number of formats.
To create a `GdkContentProvider`, use [ctor@Gdk.ContentProvider.new_for_value]
or [ctor@Gdk.ContentProvider.new_for_bytes].
GDK knows how to handle common text and image formats out-of-the-box. See
[class@Gdk.ContentSerializer] and [class@Gdk.ContentDeserializer] if you want
to add support for application-specific data formats.
in a number of formats.
To create a `GdkContentProvider`, use [ctor@Gdk.ContentProvider.new_for_value]
or [ctor@Gdk.ContentProvider.new_for_bytes].
GDK knows how to handle common text and image formats out-of-the-box. See
[class@Gdk.ContentSerializer] and [class@Gdk.ContentDeserializer] if you want
to add support for application-specific data formats.
-
Verschachtelte Klassen - Übersicht
Verschachtelte KlassenModifizierer und TypKlasseBeschreibungstatic interface
static interface
Von Klasse geerbte verschachtelte Klassen/Schnittstellen ch.bailu.gtk.gobject.Object
Object.OnBindingTransformFunc, Object.OnDestroyNotify, Object.OnDuplicateFunc, Object.OnNotify, Object.OnToggleNotify, Object.OnWeakNotify
-
Feldübersicht
FelderVon Klasse geerbte Felder ch.bailu.gtk.gobject.Object
SIGNAL_ON_NOTIFY
-
Konstruktorübersicht
Konstruktoren -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungvoid
Emits the ::content-changed signal.static ClassHandler
static int
static long
static TypeSystem.TypeSize
static long
static TypeSystem.TypeSize
boolean
Gets the contents of @provider stored in @value.static ContentProvider
newForBytesContentProvider
(Str mime_type, Bytes bytes) Create a content provider that provides the given @bytes as data for
the given @mime_type.static ContentProvider
newForBytesContentProvider
(String mime_type, Bytes bytes) Create a content provider that provides the given @bytes as data for
the given @mime_type.static ContentProvider
newForValueContentProvider
(Value value) Create a content provider that provides the given @value.static ContentProvider
newTypedContentProvider
(long type, Object... _ellipsis) Create a content provider that provides the value of the given
@type.Connect to signal "content-changed".Gets the formats that the provider can provide its current contents in.Gets the formats that the provider suggests other applications to store
the data in.void
writeMimeTypeAsync
(Str mime_type, OutputStream stream, int io_priority, Cancellable cancellable, ContentProvider.OnAsyncReadyCallback callback, Pointer user_data) Asynchronously writes the contents of @provider to @stream in the given
@mime_type.void
writeMimeTypeAsync
(String mime_type, OutputStream stream, int io_priority, Cancellable cancellable, ContentProvider.OnAsyncReadyCallback callback, Pointer user_data) Asynchronously writes the contents of @provider to @stream in the given
@mime_type.boolean
writeMimeTypeFinish
(AsyncResult result) Finishes an asynchronous write operation.Von Klasse geerbte Methoden ch.bailu.gtk.type.PropertyHolder
getBooleanProperty, getIntProperty, getObjectProperty, getStringProperty, getStrProperty, setBooleanProperty, setIntProperty, setObjectProperty, setStringProperty, setStrProperty
Von Klasse geerbte Methoden ch.bailu.gtk.gobject.Object
addToggleRef, bindProperty, bindProperty, bindPropertyFull, bindPropertyFull, bindPropertyWithClosures, bindPropertyWithClosures, compatControl, connect, connect, disconnect, disconnect, dupData, dupData, dupQdata, forceFloating, freezeNotify, get, get, getData, getData, getProperty, getProperty, getQdata, interfaceFindProperty, interfaceInstallProperty, isFloating, notify, notify, notifyByPspec, onNotify, ref, refSink, removeToggleRef, replaceData, replaceData, replaceQdata, runDispose, set, set, setData, setData, setDataFull, setDataFull, setProperty, setProperty, setQdata, setQdataFull, stealData, stealData, stealQdata, takeRef, thawNotify, unref, watchClosure, weakRef, weakUnref
Von Klasse geerbte Methoden ch.bailu.gtk.type.Pointer
asCPointer, cast, connectSignal, disconnectSignals, disconnectSignals, equals, hashCode, throwIfNull, throwNullPointerException, toString, unregisterCallbacks, unregisterCallbacks
Von Klasse geerbte Methoden ch.bailu.gtk.type.Type
asCPointer, asCPointer, asCPointerNotNull, asJnaPointer, asJnaPointer, asPointer, asPointer, cast, cast, throwIfNull
Von Klasse geerbte Methoden java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Von Schnittstelle geerbte Methoden ch.bailu.gtk.type.PointerInterface
asCPointerNotNull, asJnaPointer, asPointer, isNotNull, isNull
-
Felddetails
-
SIGNAL_ON_CONTENT_CHANGED
- Siehe auch:
-
-
Konstruktordetails
-
ContentProvider
-
-
Methodendetails
-
getClassHandler
-
newForBytesContentProvider
public static ContentProvider newForBytesContentProvider(@Nonnull Str mime_type, @Nonnull Bytes bytes) Create a content provider that provides the given @bytes as data for
the given @mime_type.- Parameter:
mime_type
- the mime typebytes
- a `GBytes` with the data for @mime_type- Gibt zurück:
- a new `GdkContentProvider`
-
newForBytesContentProvider
Create a content provider that provides the given @bytes as data for
the given @mime_type.- Parameter:
mime_type
- the mime typebytes
- a `GBytes` with the data for @mime_type- Gibt zurück:
- a new `GdkContentProvider`
-
newForValueContentProvider
Create a content provider that provides the given @value.- Parameter:
value
- a `GValue`- Gibt zurück:
- a new `GdkContentProvider`
-
newTypedContentProvider
Create a content provider that provides the value of the given
@type.
The value is provided using G_VALUE_COLLECT(), so the same rules
apply as when calling g_object_new() or g_object_set().- Parameter:
type
- Type of value to follow_ellipsis
- value- Gibt zurück:
- a new `GdkContentProvider`
-
contentChanged
public void contentChanged()Emits the ::content-changed signal. -
getValue
Gets the contents of @provider stored in @value.
The @value will have been initialized to the `GType` the value should be
provided in. This given `GType` does not need to be listed in the formats
returned by [method@Gdk.ContentProvider.ref_formats]. However, if the
given `GType` is not supported, this operation can fail and
`G_IO_ERROR_NOT_SUPPORTED` will be reported.- Parameter:
value
- the `GValue` to fill- Gibt zurück:
- %TRUE if the value was set successfully. Otherwise @error will be set to describe the failure.
- Löst aus:
AllocationError
-
refFormats
Gets the formats that the provider can provide its current contents in.- Gibt zurück:
- The formats of the provider
-
refStorableFormats
Gets the formats that the provider suggests other applications to store
the data in.
An example of such an application would be a clipboard manager.
This can be assumed to be a subset of [method@Gdk.ContentProvider.ref_formats].- Gibt zurück:
- The storable formats of the provider
-
writeMimeTypeAsync
public void writeMimeTypeAsync(@Nonnull Str mime_type, @Nonnull OutputStream stream, int io_priority, @Nullable Cancellable cancellable, ContentProvider.OnAsyncReadyCallback callback, @Nullable Pointer user_data) Asynchronously writes the contents of @provider to @stream in the given
@mime_type.
The given mime type does not need to be listed in the formats returned by
[method@Gdk.ContentProvider.ref_formats]. However, if the given `GType` is
not supported, `G_IO_ERROR_NOT_SUPPORTED` will be reported.
The given @stream will not be closed.- Parameter:
mime_type
- the mime type to provide the data instream
- the `GOutputStream` to write toio_priority
- I/O priority of the request.cancellable
- optional `GCancellable` object, %NULL to ignore.callback
- callback to call when the request is satisfieduser_data
- the data to pass to callback function
-
writeMimeTypeAsync
public void writeMimeTypeAsync(String mime_type, @Nonnull OutputStream stream, int io_priority, @Nullable Cancellable cancellable, ContentProvider.OnAsyncReadyCallback callback, @Nullable Pointer user_data) Asynchronously writes the contents of @provider to @stream in the given
@mime_type.
The given mime type does not need to be listed in the formats returned by
[method@Gdk.ContentProvider.ref_formats]. However, if the given `GType` is
not supported, `G_IO_ERROR_NOT_SUPPORTED` will be reported.
The given @stream will not be closed.- Parameter:
mime_type
- the mime type to provide the data instream
- the `GOutputStream` to write toio_priority
- I/O priority of the request.cancellable
- optional `GCancellable` object, %NULL to ignore.callback
- callback to call when the request is satisfieduser_data
- the data to pass to callback function
-
writeMimeTypeFinish
Finishes an asynchronous write operation.
See [method@Gdk.ContentProvider.write_mime_type_async].- Parameter:
result
- a `GAsyncResult`- Gibt zurück:
- %TRUE if the operation was completed successfully. Otherwise @error will be set to describe the failure.
- Löst aus:
AllocationError
-
onContentChanged
Connect to signal "content-changed".
SeeContentProvider.OnContentChanged.onContentChanged()
for signal description.
FieldSIGNAL_ON_CONTENT_CHANGED
contains original signal name and can be used as resource reference.- Parameter:
signal
- callback function (lambda).- Gibt zurück:
SignalHandler
. Can be used to disconnect signal and to release callback function.
-
getTypeID
public static long getTypeID() -
getParentTypeID
public static long getParentTypeID() -
getTypeSize
-
getParentTypeSize
-
getInstanceSize
public static int getInstanceSize()
-