gtkmm  3.95.1
Public Member Functions | Static Public Member Functions | Protected Member Functions | Related Functions | List of all members
Gdk::ContentProvider Class Reference

Provides content for data transfer between applications. More...

#include <gdkmm/contentprovider.h>

Inheritance diagram for Gdk::ContentProvider:
Inheritance graph
[legend]

Public Member Functions

 ContentProvider (ContentProvider&& src) noexcept
 
ContentProvideroperator= (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< ContentFormatsref_formats () const
 Gets the formats that the provider can provide its current contents in. More...
 
Glib::RefPtr< ContentFormatsref_storable_formats () const
 Gets the formats that the provider suggests other applications to store the data in. More...
 
void content_changed ()
 Emits the Gdk::ContentProvider::signal_contents_changed() signal. 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 ()
 
- Public Member Functions inherited from Glib::Object
 Object (const Object &)=delete
 
Objectoperator= (const Object &)=delete
 
 Object (Object &&src) noexcept
 
Objectoperator= (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::Objectwrap (GObject *object, bool take_copy=false)
 
- Public Member Functions inherited from Glib::ObjectBase
 ObjectBase (const ObjectBase &)=delete
 
ObjectBaseoperator= (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
 
- Public Member Functions inherited from sigc::trackable
 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 ()
 
trackableoperator= (const trackable &src)
 
trackableoperator= (trackable &&src) noexcept
 
void remove_destroy_notify_callback (notifiable *data) const
 

Static Public Member Functions

static GType get_type ()
 Get the GType for this class, for use with the underlying GObject type system. More...
 
static Glib::RefPtr< ContentProvidercreate (const Glib::ustring& mime_type, const Glib::RefPtr< const Glib::Bytes >& bytes)
 Create a content provider that provides the given bytes as data for the given mime_type. More...
 
static Glib::RefPtr< ContentProvidercreate (const Glib::ValueBase& value)
 Create a content provider that provides the given value. More...
 

Protected Member Functions

virtual void on_content_changed ()
 This is a default handler for the signal signal_content_changed(). More...
 
- Protected Member Functions inherited from Glib::Object
 Object ()
 
 Object (const Glib::ConstructParams &construct_params)
 
 Object (GObject *castitem)
 
 ~Object () noexcept override
 
- Protected Member Functions inherited from Glib::ObjectBase
 ObjectBase ()
 
 ObjectBase (const char *custom_type_name)
 
 ObjectBase (const std::type_info &custom_type_info)
 
 ObjectBase (ObjectBase &&src) noexcept
 
ObjectBaseoperator= (ObjectBase &&src) noexcept
 
virtual ~ObjectBase () noexcept=0
 
void initialize (GObject *castitem)
 
void initialize_move (GObject *castitem, Glib::ObjectBase *previous_wrapper)
 

Related Functions

(Note that these are not member functions.)

Glib::RefPtr< Gdk::ContentProviderwrap (GdkContentProvider* object, bool take_copy=false)
 A Glib::wrap() method for this object. More...
 

Additional Inherited Members

- Public Types inherited from Glib::Object
typedef void(*)(gpointer data DestroyNotify)
 
- Public Types inherited from sigc::trackable
typedef internal::func_destroy_notify func_destroy_notify
 
- Public Types inherited from sigc::notifiable
typedef internal::func_destroy_notify func_destroy_notify
 

Detailed Description

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:

Constructor & Destructor Documentation

Gdk::ContentProvider::ContentProvider ( ContentProvider&&  src)
noexcept
Gdk::ContentProvider::~ContentProvider ( )
overridenoexcept

Member Function Documentation

void Gdk::ContentProvider::content_changed ( )

Emits the Gdk::ContentProvider::signal_contents_changed() signal.

static Glib::RefPtr<ContentProvider> Gdk::ContentProvider::create ( const Glib::ustring mime_type,
const Glib::RefPtr< const Glib::Bytes > &  bytes 
)
static

Create a content provider that provides the given bytes as data for the given mime_type.

Parameters
mime_typeThe mime type.
bytesA Bytes with the data for mime_type.
Returns
A new Gdk::ContentProvider.
static Glib::RefPtr<ContentProvider> Gdk::ContentProvider::create ( const Glib::ValueBase value)
static

Create a content provider that provides the given value.

Parameters
valueA Value.
Returns
A new Gdk::ContentProvider.
static GType Gdk::ContentProvider::get_type ( )
static

Get the GType for this class, for use with the underlying GObject type system.

GdkContentProvider* Gdk::ContentProvider::gobj ( )
inline

Provides access to the underlying C GObject.

const GdkContentProvider* Gdk::ContentProvider::gobj ( ) const
inline

Provides access to the underlying C GObject.

GdkContentProvider* Gdk::ContentProvider::gobj_copy ( )

Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.

virtual void Gdk::ContentProvider::on_content_changed ( )
protectedvirtual

This is a default handler for the signal signal_content_changed().

ContentProvider& Gdk::ContentProvider::operator= ( ContentProvider&&  src)
noexcept
Glib::PropertyProxy_ReadOnly< Glib::RefPtr<ContentFormats> > Gdk::ContentProvider::property_formats ( ) const

The possible formats that the provider can provide its data in.

Returns
A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.
Glib::PropertyProxy_ReadOnly< Glib::RefPtr<ContentFormats> > Gdk::ContentProvider::property_storable_formats ( ) const

The subset of formats that clipboard managers should store this provider's data in.

Returns
A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.
Glib::RefPtr<ContentFormats> Gdk::ContentProvider::ref_formats ( ) const

Gets the formats that the provider can provide its current contents in.

Returns
The formats of the provider.
Glib::RefPtr<ContentFormats> Gdk::ContentProvider::ref_storable_formats ( ) const

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 ref_formats().

Returns
The storable formats of the provider.
Glib::SignalProxy<void()> Gdk::ContentProvider::signal_content_changed ( )
Slot Prototype:
void on_my_content_changed()

Flags: Run Last

Friends And Related Function Documentation

Glib::RefPtr< Gdk::ContentProvider > wrap ( GdkContentProvider *  object,
bool  take_copy = false 
)
related

A Glib::wrap() method for this object.

Parameters
objectThe C instance.
take_copyFalse if the result should take ownership of the C instance. True if it should take a new copy or ref.
Returns
A C++ instance that wraps this C instance.