|
| ContentProvider (ContentProvider&& src) noexcept |
|
ContentProvider& | operator= (ContentProvider&& src) noexcept |
|
| ~ContentProvider () noexcept override |
|
GdkContentProvider* | gobj () |
| Provides access to the underlying C GObject. More...
|
|
const GdkContentProvider* | gobj () const |
| Provides access to the underlying C GObject. More...
|
|
GdkContentProvider* | gobj_copy () |
| Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs. More...
|
|
Glib::RefPtr< ContentFormats > | ref_formats () const |
| Gets the formats that the provider can provide its current contents in. More...
|
|
Glib::RefPtr< ContentFormats > | ref_storable_formats () const |
| Gets the formats that the provider suggests other applications to store the data in. More...
|
|
void | content_changed () |
| Emits the signal_content_changed() signal. More...
|
|
void | write_mime_type_async (const Glib::ustring& mime_type, const Glib::RefPtr< Gio::OutputStream >& stream, int io_priority, const Gio::SlotAsyncReady& slot, const Glib::RefPtr< Gio::Cancellable >& cancellable) const |
| Asynchronously writes the contents of provider to stream in the given mime_type. More...
|
|
void | write_mime_type_async (const Glib::ustring& mime_type, const Glib::RefPtr< Gio::OutputStream >& stream, int io_priority, const Gio::SlotAsyncReady& slot) const |
| A write_mime_type_async() convenience overload. More...
|
|
void | write_mime_type_finish (const Glib::RefPtr< Gio::AsyncResult >& result) const |
| Finishes an asynchronous write operation. More...
|
|
void | get_value (Glib::ValueBase& value) const |
| Gets the contents of provider stored in value. More...
|
|
Glib::PropertyProxy_ReadOnly< Glib::RefPtr< ContentFormats > > | property_formats () const |
| The possible formats that the provider can provide its data in. More...
|
|
Glib::PropertyProxy_ReadOnly< Glib::RefPtr< ContentFormats > > | property_storable_formats () const |
| The subset of formats that clipboard managers should store this provider's data in. More...
|
|
Glib::SignalProxy< void()> | signal_content_changed () |
|
| Object (const Object &)=delete |
|
Object & | operator= (const Object &)=delete |
|
| Object (Object &&src) noexcept |
|
Object & | operator= (Object &&src) noexcept |
|
void * | get_data (const QueryQuark &key) |
|
void | set_data (const Quark &key, void *data) |
|
void | set_data (const Quark &key, void *data, DestroyNotify notify) |
|
void | remove_data (const QueryQuark &quark) |
|
void * | steal_data (const QueryQuark &quark) |
|
Glib::RefPtr< Glib::Object > | wrap (GObject *object, bool take_copy=false) |
|
| ObjectBase (const ObjectBase &)=delete |
|
ObjectBase & | operator= (const ObjectBase &)=delete |
|
void | set_property_value (const Glib::ustring &property_name, const Glib::ValueBase &value) |
|
void | get_property_value (const Glib::ustring &property_name, Glib::ValueBase &value) const |
|
void | set_property (const Glib::ustring &property_name, const PropertyType &value) |
|
void | get_property (const Glib::ustring &property_name, PropertyType &value) const |
|
PropertyType | get_property (const Glib::ustring &property_name) const |
|
sigc::connection | connect_property_changed (const Glib::ustring &property_name, const sigc::slot< void()> &slot) |
|
sigc::connection | connect_property_changed (const Glib::ustring &property_name, sigc::slot< void()> &&slot) |
|
void | freeze_notify () |
|
void | thaw_notify () |
|
virtual void | reference () const |
|
virtual void | unreference () const |
|
GObject * | gobj () |
|
const GObject * | gobj () const |
|
GObject * | gobj_copy () const |
|
| trackable () noexcept |
|
| trackable (const trackable &src) noexcept |
|
| trackable (trackable &&src) noexcept |
|
| ~trackable () |
|
void | add_destroy_notify_callback (notifiable *data, func_destroy_notify func) const |
|
void | notify_callbacks () |
|
trackable & | operator= (const trackable &src) |
|
trackable & | operator= (trackable &&src) noexcept |
|
void | remove_destroy_notify_callback (notifiable *data) const |
|
Provides content for data transfer between applications.
A Gdk::ContentProvider is used to provide content for the clipboard in a number of formats.
To create a ContentProvider, use one of the overloaded create() methods.
GDK knows how to handle common text and image formats out-of-the-box. See Gdk::ContentSerializer and Gdk::ContentDeserializer if you want to add support for application-specific data formats.
- See also
- Gdk::ContentSerializer, Gdk::ContentDeserializer
- Since gtkmm 3.94:
Creates a content provider that represents all the given providers.
Whenever data needs to be written, the union provider will try the given providers in the given order and the first one supporting a format will be chosen to provide it.
This allows an easy way to support providing data in different formats. For example, an image may be provided by its file and by the image contents with a call such as
gdk_content_provider_new_union ((GdkContentProvider *[2]) {
gdk_content_provider_new_typed (G_TYPE_FILE, file),
gdk_content_provider_new_typed (G_TYPE_TEXTURE, texture)
}, 2);
- Parameters
-
providers | The Gdk::ContentProviders to present the union of. |
n_providers | The number of providers. |
- Returns
- A new
GdkContentProvider
.
Asynchronously writes the contents of provider to stream in the given mime_type.
When the operation is finished slot will be called. You must then call [method Gdk.ContentProvider.write_mime_type_finish] to get the result of the operation.
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, Gio::Error::NOT_SUPPORTED will be reported.
The given stream will not be closed.
- Parameters
-
mime_type | The mime type to provide the data in. |
stream | The GOutputStream to write to. |
io_priority | I/O priority of the request. |
cancellable | Optional GCancellable object, nullptr to ignore. |
slot | Callback to call when the request is satisfied. |