gdk.content_provider
Module for [ContentProvider] class
Types 3
A [gdk.content_provider.ContentProvider] is used to provide content for the clipboard or for drag-and-drop operations in a number of formats.
To create a [gdk.content_provider.ContentProvider], use [gdk.content_provider.ContentProvider.newForValue] or [gdk.content_provider.ContentProvider.newForBytes].
GDK knows how to handle common text and image formats out-of-the-box. See [gdk.content_serializer.ContentSerializer] and [gdk.content_deserializer.ContentDeserializer] if you want to add support for application-specific data formats.
Methods
ContentProvider self()Returns `this`, for use in `with` statements.ContentProviderGidBuilder builder()Get builder for [gdk.content_provider.ContentProvider] Returns: New builder objectgdk.content_formats.ContentFormats formats() @propertyGet `formats` property. Returns: The possible formats that the provider can provide its data in.gdk.content_formats.ContentFormats storableFormats() @propertyGet `storableFormats` property. Returns: The subset of formats that clipboard managers should store this provider's data in.gdk.content_provider.ContentProvider newForBytes(string mimeType, glib.bytes.Bytes bytes)Create a content provider that provides the given bytes as data for the given mime_type.gdk.content_provider.ContentProvider newForValue(gobject.value.Value value)Create a content provider that provides the given value.void contentChanged()Emits the ::content-changed signal.bool getValue(out gobject.value.Value value)Gets the contents of provider stored in value.gdk.content_formats.ContentFormats refFormats()Gets the formats that the provider can provide its current contents in. Returns: The formats of the providergdk.content_formats.ContentFormats refStorableFormats()Gets the formats that the provider suggests other applications to store the data in.void writeMimeTypeAsync(string mimeType, gio.output_stream.OutputStream stream, int ioPriority, gio.cancellable.Cancellable cancellable = null, gio.types.AsyncReadyCallback callback = null)Asynchronously writes the contents of provider to stream in the given mime_type.bool writeMimeTypeFinish(gio.async_result.AsyncResult result)Finishes an asynchronous write operation.gulong connectContentChanged(T)(T callback, Flag!"After" after = No.After) if (isCallable!T
&& is(ReturnType!T == void)
&& (Parameters!T.length < 1 || (ParameterStorageClassTuple!T[0] == ParameterStorageClass.none && is(Parameters!T[0] : gdk.content_provider.ContentProvider)))
&& Parameters!T.length < 2)Connect to `ContentChanged` signal.Fluent builder for [gdk.content_provider.ContentProvider]
Methods