~ubuntu-branches/ubuntu/saucy/atkmm1.6/saucy-proposed

« back to all changes in this revision

Viewing changes to atk/atkmm/action.h

  • Committer: Bazaar Package Importer
  • Author(s): Krzysztof Klimonda
  • Date: 2010-11-02 20:35:53 UTC
  • Revision ID: james.westby@ubuntu.com-20101102203553-syno2w6yedmcdgk8
ImportĀ upstreamĀ versionĀ 2.22.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// -*- c++ -*-
 
2
// Generated by gtkmmproc -- DO NOT MODIFY!
 
3
#ifndef _ATKMM_ACTION_H
 
4
#define _ATKMM_ACTION_H
 
5
 
 
6
 
 
7
#include <glibmm.h>
 
8
 
 
9
/* $Id: action.hg,v 1.5 2004/03/12 20:35:53 murrayc Exp $ */
 
10
 
 
11
/* Copyright (C) 2002 The gtkmm Development Team
 
12
 *
 
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.
 
17
 *
 
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.
 
22
 *
 
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.
 
26
 */
 
27
 
 
28
 
 
29
#ifndef DOXYGEN_SHOULD_SKIP_THIS
 
30
extern "C" { typedef struct _AtkActionIface AtkActionIface; }
 
31
#endif
 
32
 
 
33
 
 
34
#ifndef DOXYGEN_SHOULD_SKIP_THIS
 
35
typedef struct _AtkAction AtkAction;
 
36
typedef struct _AtkActionClass AtkActionClass;
 
37
#endif /* DOXYGEN_SHOULD_SKIP_THIS */
 
38
 
 
39
 
 
40
namespace Atk
 
41
{ class Action_Class; } // namespace Atk
 
42
namespace Atk
 
43
{
 
44
 
 
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.
 
48
 *
 
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.
 
51
 * 
 
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.
 
55
 * 
 
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. 
 
60
 */
 
61
 
 
62
class Action : public Glib::Interface
 
63
{
 
64
  
 
65
#ifndef DOXYGEN_SHOULD_SKIP_THIS
 
66
 
 
67
public:
 
68
  typedef Action CppObjectType;
 
69
  typedef Action_Class CppClassType;
 
70
  typedef AtkAction BaseObjectType;
 
71
  typedef AtkActionIface BaseClassType;
 
72
 
 
73
private:
 
74
  friend class Action_Class;
 
75
  static CppClassType action_class_;
 
76
 
 
77
  // noncopyable
 
78
  Action(const Action&);
 
79
  Action& operator=(const Action&);
 
80
 
 
81
protected:
 
82
  Action(); // you must derive from this class
 
83
 
 
84
  /** Called by constructors of derived classes. Provide the result of 
 
85
   * the Class init() function to ensure that it is properly 
 
86
   * initialized.
 
87
   * 
 
88
   * @param interface_class The Class object for the derived type.
 
89
   */
 
90
  explicit Action(const Glib::Interface_Class& interface_class);
 
91
 
 
92
public:
 
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);
 
97
 
 
98
protected:
 
99
#endif /* DOXYGEN_SHOULD_SKIP_THIS */
 
100
 
 
101
public:
 
102
  virtual ~Action();
 
103
 
 
104
  static void add_interface(GType gtype_implementer);
 
105
 
 
106
#ifndef DOXYGEN_SHOULD_SKIP_THIS
 
107
  static GType get_type()      G_GNUC_CONST;
 
108
  static GType get_base_type() G_GNUC_CONST;
 
109
#endif
 
110
 
 
111
  ///Provides access to the underlying C GObject.
 
112
  AtkAction*       gobj()       { return reinterpret_cast<AtkAction*>(gobject_); }
 
113
 
 
114
  ///Provides access to the underlying C GObject.  
 
115
  const AtkAction* gobj() const { return reinterpret_cast<AtkAction*>(gobject_); }
 
116
 
 
117
private:
 
118
 
 
119
 
 
120
public:
 
121
 
 
122
  
 
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.
 
126
   */
 
127
  bool do_action(int i);
 
128
  
 
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.
 
134
   */
 
135
  int get_n_actions() const;
 
136
  
 
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.
 
141
   */
 
142
  Glib::ustring get_description(int i) const;
 
143
  
 
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.
 
147
   */
 
148
  Glib::ustring get_name(int i) const;
 
149
  
 
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.
 
154
   */
 
155
  Glib::ustring get_keybinding(int i);
 
156
  
 
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;.
 
161
   */
 
162
  bool set_description(int i, const Glib::ustring& desc);
 
163
  
 
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.
 
168
   */
 
169
  Glib::ustring get_localized_name(int i);
 
170
 
 
171
protected:
 
172
    virtual bool do_action_vfunc(int i);
 
173
 
 
174
    virtual int get_n_actions_vfunc() const;
 
175
 
 
176
    virtual const char* get_description_vfunc(int i) const;
 
177
 
 
178
    virtual const char* get_name_vfunc(int i) const;
 
179
 
 
180
    virtual const char* get_keybinding_vfunc(int i) const;
 
181
 
 
182
 
 
183
    virtual bool set_description_vfunc(int i, const Glib::ustring& desc);
 
184
 
 
185
 
 
186
public:
 
187
 
 
188
public:
 
189
  //C++ methods used to invoke GTK+ virtual functions:
 
190
 
 
191
protected:
 
192
  //GTK+ Virtual Functions (override these to change behaviour):
 
193
 
 
194
  //Default Signal Handlers::
 
195
 
 
196
 
 
197
};
 
198
 
 
199
} // namespace Atk
 
200
 
 
201
 
 
202
namespace Glib
 
203
{
 
204
  /** A Glib::wrap() method for this object.
 
205
   * 
 
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.
 
209
   *
 
210
   * @relates Atk::Action
 
211
   */
 
212
  Glib::RefPtr<Atk::Action> wrap(AtkAction* object, bool take_copy = false);
 
213
 
 
214
} // namespace Glib
 
215
 
 
216
 
 
217
#endif /* _ATKMM_ACTION_H */
 
218