gtkmm: Gtk::Shortcut Class Reference

An object describing a keyboard shortcut. More...

#include <gtkmm/shortcut.h>

Inheritance diagram for Gtk::Shortcut:

Public Member Functions

 Shortcut (Shortcut&& src) noexcept
 
Shortcutoperator= (Shortcut&& src) noexcept
 
 ~Shortcut () noexcept override
 
GtkShortcut* gobj ()
 Provides access to the underlying C GObject. More...

 
const GtkShortcut* gobj () const
 Provides access to the underlying C GObject. More...

 
GtkShortcut* 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< ShortcutTriggerget_trigger () const
 Gets the trigger used to trigger self. More...

 
void set_trigger (const Glib::RefPtr< const ShortcutTrigger >& trigger)
 Sets the new trigger for self to be trigger. More...

 
Glib::RefPtr< ShortcutActionget_action () const
 Gets the action that is activated by this shortcut. More...

 
void set_trigger (const Glib::RefPtr< const ShortcutAction >& action)
 Sets the new action for self to be action. More...

 
Glib::VariantBase get_arguments () const
 Gets the arguments that are passed when activating the shortcut. More...

 
void set_arguments (const Glib::VariantBase& args) const
 Sets the arguments to pass when activating the shortcut. More...

 
Glib::PropertyProxy< Glib::RefPtr< ShortcutTrigger > > property_trigger ()
 The trigger that triggers this shortcut. More...

 
Glib::PropertyProxy_ReadOnly< Glib::RefPtr< ShortcutTrigger > > property_trigger () const
 The trigger that triggers this shortcut. More...

 
Glib::PropertyProxy< Glib::RefPtr< ShortcutAction > > property_action ()
 The action that gets activated by this shortcut. More...

 
Glib::PropertyProxy_ReadOnly< Glib::RefPtr< ShortcutAction > > property_action () const
 The action that gets activated by this shortcut. More...

 
Glib::PropertyProxy< Glib::VariantBaseproperty_arguments ()
 Arguments passed to activation. More...

 
Glib::PropertyProxy_ReadOnly< Glib::VariantBaseproperty_arguments () const
 Arguments passed to activation. More...

 
- 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< Shortcutcreate (const Glib::RefPtr< const ShortcutTrigger >& trigger, const Glib::RefPtr< const ShortcutAction >& action)
 

Protected Member Functions

 Shortcut (const Glib::RefPtr< const ShortcutTrigger >& trigger, const Glib::RefPtr< const ShortcutAction >& action)
 
- 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< Gtk::Shortcutwrap (GtkShortcut* 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

An object describing a keyboard shortcut.

Gtk::Shortcut is the low level object used for managing keyboard shortcuts. It contains a description of how to trigger the shortcut via a Gtk::ShortcutTrigger and a way to activate the shortcut on a widget via Gtk::ShortcutAction.

The actual work is usually done via Gtk::ShortcutController, which decides if and when to activate a shortcut. Using that controller directly however is rarely necessary as various higher level convenience APIs exist on Widgets that make it easier to use shortcuts in GTK.

Gtk::Shortcut does provide functionality to make it easy for users to work with shortcuts, either by providing informational strings for display purposes or by allowing shortcuts to be configured.

See also
Gtk::ShortcutController, Gtk::ShortcutAction, Gtk::ShortcutTrigger
Since gtkmm 3.98:

Constructor & Destructor Documentation

Gtk::Shortcut::Shortcut ( Shortcut&&  src)
noexcept
Gtk::Shortcut::~Shortcut ( )
overridenoexcept
Gtk::Shortcut::Shortcut ( const Glib::RefPtr< const ShortcutTrigger >&  trigger,
const Glib::RefPtr< const ShortcutAction >&  action 
)
explicitprotected

Member Function Documentation

static Glib::RefPtr<Shortcut> Gtk::Shortcut::create ( const Glib::RefPtr< const ShortcutTrigger >&  trigger,
const Glib::RefPtr< const ShortcutAction >&  action 
)
static
Glib::RefPtr<ShortcutAction> Gtk::Shortcut::get_action ( ) const

Gets the action that is activated by this shortcut.

Returns
The action.
Glib::VariantBase Gtk::Shortcut::get_arguments ( ) const

Gets the arguments that are passed when activating the shortcut.

Returns
The arguments.
Glib::RefPtr<ShortcutTrigger> Gtk::Shortcut::get_trigger ( ) const

Gets the trigger used to trigger self.

Returns
The trigger used.
static GType Gtk::Shortcut::get_type ( )
static

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

GtkShortcut* Gtk::Shortcut::gobj ( )
inline

Provides access to the underlying C GObject.

const GtkShortcut* Gtk::Shortcut::gobj ( ) const
inline

Provides access to the underlying C GObject.

GtkShortcut* Gtk::Shortcut::gobj_copy ( )

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

Shortcut& Gtk::Shortcut::operator= ( Shortcut&&  src)
noexcept
Glib::PropertyProxy< Glib::RefPtr<ShortcutAction> > Gtk::Shortcut::property_action ( )

The action that gets activated by this shortcut.

Returns
A PropertyProxy that allows you to get or set the value of the property, or receive notification when the value of the property changes.
Glib::PropertyProxy_ReadOnly< Glib::RefPtr<ShortcutAction> > Gtk::Shortcut::property_action ( ) const

The action that gets activated by this shortcut.

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< Glib::VariantBase > Gtk::Shortcut::property_arguments ( )

Arguments passed to activation.

Returns
A PropertyProxy that allows you to get or set the value of the property, or receive notification when the value of the property changes.
Glib::PropertyProxy_ReadOnly< Glib::VariantBase > Gtk::Shortcut::property_arguments ( ) const

Arguments passed to activation.

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< Glib::RefPtr<ShortcutTrigger> > Gtk::Shortcut::property_trigger ( )

The trigger that triggers this shortcut.

Returns
A PropertyProxy that allows you to get or set the value of the property, or receive notification when the value of the property changes.
Glib::PropertyProxy_ReadOnly< Glib::RefPtr<ShortcutTrigger> > Gtk::Shortcut::property_trigger ( ) const

The trigger that triggers this shortcut.

Returns
A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.
void Gtk::Shortcut::set_arguments ( const Glib::VariantBase args) const

Sets the arguments to pass when activating the shortcut.

Parameters
argsArguments to pass when activating self.
void Gtk::Shortcut::set_trigger ( const Glib::RefPtr< const ShortcutTrigger >&  trigger)

Sets the new trigger for self to be trigger.

Parameters
triggerThe new trigger. If the trigger is nullptr, the never trigger will be used.
void Gtk::Shortcut::set_trigger ( const Glib::RefPtr< const ShortcutAction >&  action)

Sets the new action for self to be action.

Parameters
actionThe new action. If the action is nullptr, the nothing action will be used.

Friends And Related Function Documentation

Glib::RefPtr< Gtk::Shortcut > wrap ( GtkShortcut *  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.