2
// Generated by gtkmmproc -- DO NOT MODIFY!
3
#ifndef _ATKMM_ACTION_H
4
#define _ATKMM_ACTION_H
9
/* $Id: action.hg,v 1.5 2004/03/12 20:35:53 murrayc Exp $ */
11
/* Copyright (C) 2002 The gtkmm Development Team
13
* This library is free software; you can redistribute it and/or
14
* modify it under the terms of the GNU Lesser General Public
15
* License as published by the Free Software Foundation; either
16
* version 2.1 of the License, or (at your option) any later version.
18
* This library is distributed in the hope that it will be useful,
19
* but WITHOUT ANY WARRANTY; without even the implied warranty of
20
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21
* Lesser General Public License for more details.
23
* You should have received a copy of the GNU Lesser General Public
24
* License along with this library; if not, write to the Free
25
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
29
#ifndef DOXYGEN_SHOULD_SKIP_THIS
30
extern "C" { typedef struct _AtkActionIface AtkActionIface; }
34
#ifndef DOXYGEN_SHOULD_SKIP_THIS
35
typedef struct _AtkAction AtkAction;
36
typedef struct _AtkActionClass AtkActionClass;
37
#endif /* DOXYGEN_SHOULD_SKIP_THIS */
41
{ class Action_Class; } // namespace Atk
45
/** The ATK interface provided by UI components which the user can activate/interact with,
46
* This should be implemented by instances of Atk::Object classes with which the user can interact directly, i.e. buttons,
47
* checkboxes, scrollbars, e.g. components which are not "passive" providers of UI information.
49
* Exceptions: when the user interaction is already covered by another appropriate interface such as Atk::EditableText
50
* (insert/delete test, etc.) or Atk::Value (set value) then these actions should not be exposed by Atk::Action as well.
52
* Also note that the Atk::Action API is limited in that parameters may not be passed to the object being activated;
53
* thus the action must be self-contained and specifiable via only a single "verb". Concrete examples include "press",
54
* "release", "click" for buttons, "drag" (meaning initiate drag) and "drop" for drag sources and drop targets, etc.
56
* Though most UI interactions on components should be invocable via keyboard as well as mouse, there will generally be
57
* a close mapping between "mouse actions" that are possible on a component and the Atk::Actions. Where mouse and keyboard
58
* actions are redundant in effect, Atk::Action should expose only one action rather than exposing redundant actions if
59
* possible. By convention we have been using "mouse centric" terminology for Atk::Action names.
62
class Action : public Glib::Interface
65
#ifndef DOXYGEN_SHOULD_SKIP_THIS
68
typedef Action CppObjectType;
69
typedef Action_Class CppClassType;
70
typedef AtkAction BaseObjectType;
71
typedef AtkActionIface BaseClassType;
74
friend class Action_Class;
75
static CppClassType action_class_;
78
Action(const Action&);
79
Action& operator=(const Action&);
82
Action(); // you must derive from this class
84
/** Called by constructors of derived classes. Provide the result of
85
* the Class init() function to ensure that it is properly
88
* @param interface_class The Class object for the derived type.
90
explicit Action(const Glib::Interface_Class& interface_class);
93
// This is public so that C++ wrapper instances can be
94
// created for C instances of unwrapped types.
95
// For instance, if an unexpected C type implements the C interface.
96
explicit Action(AtkAction* castitem);
99
#endif /* DOXYGEN_SHOULD_SKIP_THIS */
104
static void add_interface(GType gtype_implementer);
106
#ifndef DOXYGEN_SHOULD_SKIP_THIS
107
static GType get_type() G_GNUC_CONST;
108
static GType get_base_type() G_GNUC_CONST;
111
///Provides access to the underlying C GObject.
112
AtkAction* gobj() { return reinterpret_cast<AtkAction*>(gobject_); }
114
///Provides access to the underlying C GObject.
115
const AtkAction* gobj() const { return reinterpret_cast<AtkAction*>(gobject_); }
123
/** Perform the specified action on the object.
124
* @param i The action index corresponding to the action to be performed.
125
* @return <tt>true</tt> if success, <tt>false</tt> otherwise.
127
bool do_action(int i);
129
/** Gets the number of accessible actions available on the object.
130
* If there are more than one, the first one is considered the
131
* "default" action of the object.
132
* @return A the number of actions, or 0 if @a action does not
133
* implement this interface.
135
int get_n_actions() const;
137
/** Returns a description of the specified action of the object.
138
* @param i The action index corresponding to the action to be performed.
139
* @return A description string, or <tt>0</tt>
140
* if @a action does not implement this interface.
142
Glib::ustring get_description(int i) const;
144
/** Returns the name of the specified action of the object.
145
* @param i The action index corresponding to the action to be performed.
146
* @return A name string, or an empty string if @a action does not implement this interface.
148
Glib::ustring get_name(int i) const;
150
/** Returns a keybinding associated with this action, if one exists.
151
* @param i The action index corresponding to the action to be performed.
152
* @return A string representing the keybinding, or an empty string
153
* if there is no keybinding for this action.
155
Glib::ustring get_keybinding(int i);
157
/** Sets a description of the specified action of the object.
158
* @param i The action index corresponding to the action to be performed.
159
* @param desc The description to be assigned to this action.
160
* @return A <tt>bool</tt> representing if the description was successfully set;.
162
bool set_description(int i, const Glib::ustring& desc);
164
/** Returns the localized name of the specified action of the object.
165
* @param i The action index corresponding to the action to be performed.
166
* @return A name string, or an empty string
167
* if @a action does not implement this interface.
169
Glib::ustring get_localized_name(int i);
172
virtual bool do_action_vfunc(int i);
174
virtual int get_n_actions_vfunc() const;
176
virtual const char* get_description_vfunc(int i) const;
178
virtual const char* get_name_vfunc(int i) const;
180
virtual const char* get_keybinding_vfunc(int i) const;
183
virtual bool set_description_vfunc(int i, const Glib::ustring& desc);
189
//C++ methods used to invoke GTK+ virtual functions:
192
//GTK+ Virtual Functions (override these to change behaviour):
194
//Default Signal Handlers::
204
/** A Glib::wrap() method for this object.
206
* @param object The C instance.
207
* @param take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref.
208
* @result A C++ instance that wraps this C instance.
210
* @relates Atk::Action
212
Glib::RefPtr<Atk::Action> wrap(AtkAction* object, bool take_copy = false);
217
#endif /* _ATKMM_ACTION_H */