Debian Codegraph @

atk/src/action.hg

raw
1 /* Copyright (C) 2002 The gtkmm Development Team
2 *
3 * This library is free software; you can redistribute it and/or
4 * modify it under the terms of the GNU Lesser General Public
5 * License as published by the Free Software Foundation; either
6 * version 2.1 of the License, or (at your option) any later version.
7 *
8 * This library is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 * Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public
14 * License along with this library; if not, see <https://www.gnu.org/licenses/>.
15 */
16
17 _CONFIGINCLUDE(atkmmconfig.h)
18
19 _DEFS(atkmm,atk)
20 _PINCLUDE(glibmm/private/interface_p.h)
21
22 #include <glibmm/interface.h>
23
24 #ifndef DOXYGEN_SHOULD_SKIP_THIS
25 extern "C" { typedef struct _AtkActionIface AtkActionIface; }
26 #endif
27
28
29 namespace Atk
30 {
31
32 /** The ATK interface provided by UI components which the user can activate/interact with,
33 * This should be implemented by instances of Atk::Object classes with which the user can interact directly, i.e. buttons,
34 * checkboxes, scrollbars, e.g. components which are not "passive" providers of UI information.
35 *
36 * Exceptions: when the user interaction is already covered by another appropriate interface such as Atk::EditableText
37 * (insert/delete test, etc.) or Atk::Value (set value) then these actions should not be exposed by Atk::Action as well.
38 *
39 * Also note that the Atk::Action API is limited in that parameters may not be passed to the object being activated;
40 * thus the action must be self-contained and specifiable via only a single "verb". Concrete examples include "press",
41 * "release", "click" for buttons, "drag" (meaning initiate drag) and "drop" for drag sources and drop targets, etc.
42 *
43 * Though most UI interactions on components should be invocable via keyboard as well as mouse, there will generally be
44 * a close mapping between "mouse actions" that are possible on a component and the Atk::Actions. Where mouse and keyboard
45 * actions are redundant in effect, Atk::Action should expose only one action rather than exposing redundant actions if
46 * possible. By convention we have been using "mouse centric" terminology for Atk::Action names.
47 */
48 class ATKMM_API Action : public Glib::Interface
49 {
50 _CLASS_INTERFACE(Action, AtkAction, ATK_ACTION, AtkActionIface, , , ATKMM_API)
51
52 public:
53
54 _WRAP_METHOD(bool do_action(int i), atk_action_do_action)
55 _WRAP_METHOD(int get_n_actions() const, atk_action_get_n_actions)
56 _WRAP_METHOD(Glib::ustring get_description(int i) const, atk_action_get_description)
57 _WRAP_METHOD(Glib::ustring get_name(int i) const, atk_action_get_name)
58 _WRAP_METHOD(Glib::ustring get_keybinding(int i), atk_action_get_keybinding)
59 _WRAP_METHOD(bool set_description(int i, const Glib::ustring& desc), atk_action_set_description)
60 _WRAP_METHOD(Glib::ustring get_localized_name(int i), atk_action_get_localized_name)
61
62 protected:
63 _WRAP_VFUNC(bool do_action(int i), "do_action")
64 _WRAP_VFUNC(int get_n_actions() const, "get_n_actions")
65 _WRAP_VFUNC(const char* get_description(int i) const, "get_description")
66 _WRAP_VFUNC(const char* get_name(int i) const, "get_name")
67 _WRAP_VFUNC(const char* get_keybinding(int i) const, "get_keybinding")
68
69 #m4 _CONVERSION(`const char*',`const Glib::ustring&',__GCHARP_TO_USTRING)
70 _WRAP_VFUNC(bool set_description(int i, const Glib::ustring& desc), "set_description")
71 };
72
73 } // namespace Atk