~ubuntu-branches/ubuntu/precise/atkmm1.6/precise

« back to all changes in this revision

Viewing changes to atk/atkmm/selection.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
Tags: upstream-2.22.1
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_SELECTION_H
 
4
#define _ATKMM_SELECTION_H
 
5
 
 
6
 
 
7
#include <glibmm.h>
 
8
 
 
9
/* $Id: selection.hg,v 1.2 2004/01/02 09:56:43 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"
 
31
{
 
32
  typedef struct _AtkSelectionIface AtkSelectionIface;
 
33
  typedef struct _AtkSelection      AtkSelection;
 
34
}
 
35
#endif /* DOXYGEN_SHOULD_SKIP_THIS */
 
36
 
 
37
 
 
38
#ifndef DOXYGEN_SHOULD_SKIP_THIS
 
39
typedef struct _AtkSelection AtkSelection;
 
40
typedef struct _AtkSelectionClass AtkSelectionClass;
 
41
#endif /* DOXYGEN_SHOULD_SKIP_THIS */
 
42
 
 
43
 
 
44
namespace Atk
 
45
{ class Selection_Class; } // namespace Atk
 
46
namespace Atk
 
47
{
 
48
 
 
49
class Object;
 
50
 
 
51
/** The ATK interface implemented by container objects whose Atk::Object children can be selected.
 
52
 * This should be implemented by UI components with children which are exposed by Atk::Object::ref_child and
 
53
 * Atk::Object::get_n_children, if the use of the parent UI component ordinarily involves selection of one or
 
54
 * more of the objects corresponding to those AtkObject children - for example, selectable lists.
 
55
 *
 
56
 * Note that other types of "selection" (for instance text selection) are accomplished a other ATK interfaces -
 
57
 * Atk::Selection is limited to the selection/deselection of children. 
 
58
 */
 
59
 
 
60
class Selection : public Glib::Interface
 
61
{
 
62
  
 
63
#ifndef DOXYGEN_SHOULD_SKIP_THIS
 
64
 
 
65
public:
 
66
  typedef Selection CppObjectType;
 
67
  typedef Selection_Class CppClassType;
 
68
  typedef AtkSelection BaseObjectType;
 
69
  typedef AtkSelectionIface BaseClassType;
 
70
 
 
71
private:
 
72
  friend class Selection_Class;
 
73
  static CppClassType selection_class_;
 
74
 
 
75
  // noncopyable
 
76
  Selection(const Selection&);
 
77
  Selection& operator=(const Selection&);
 
78
 
 
79
protected:
 
80
  Selection(); // you must derive from this class
 
81
 
 
82
  /** Called by constructors of derived classes. Provide the result of 
 
83
   * the Class init() function to ensure that it is properly 
 
84
   * initialized.
 
85
   * 
 
86
   * @param interface_class The Class object for the derived type.
 
87
   */
 
88
  explicit Selection(const Glib::Interface_Class& interface_class);
 
89
 
 
90
public:
 
91
  // This is public so that C++ wrapper instances can be
 
92
  // created for C instances of unwrapped types.
 
93
  // For instance, if an unexpected C type implements the C interface. 
 
94
  explicit Selection(AtkSelection* castitem);
 
95
 
 
96
protected:
 
97
#endif /* DOXYGEN_SHOULD_SKIP_THIS */
 
98
 
 
99
public:
 
100
  virtual ~Selection();
 
101
 
 
102
  static void add_interface(GType gtype_implementer);
 
103
 
 
104
#ifndef DOXYGEN_SHOULD_SKIP_THIS
 
105
  static GType get_type()      G_GNUC_CONST;
 
106
  static GType get_base_type() G_GNUC_CONST;
 
107
#endif
 
108
 
 
109
  ///Provides access to the underlying C GObject.
 
110
  AtkSelection*       gobj()       { return reinterpret_cast<AtkSelection*>(gobject_); }
 
111
 
 
112
  ///Provides access to the underlying C GObject.  
 
113
  const AtkSelection* gobj() const { return reinterpret_cast<AtkSelection*>(gobject_); }
 
114
 
 
115
private:
 
116
 
 
117
 
 
118
public:
 
119
  
 
120
  /** Adds the specified accessible child of the object to the
 
121
   * object's selection.
 
122
   * @param i A <tt>int</tt> specifying the child index.
 
123
   * @return <tt>true</tt> if success, <tt>false</tt> otherwise.
 
124
   */
 
125
  bool add_selection(int i);
 
126
  
 
127
  /** Clears the selection in the object so that no children in the object
 
128
   * are selected.
 
129
   * @return <tt>true</tt> if success, <tt>false</tt> otherwise.
 
130
   */
 
131
  bool clear_selection();
 
132
  
 
133
  /** Gets a reference to the accessible object representing the specified 
 
134
   * selected child of the object.
 
135
   * @note callers should not rely on <tt>0</tt> or on a zero value for
 
136
   * indication of whether AtkSelectionIface is implemented, they should
 
137
   * use type checking/interface checking macros or the
 
138
   * atk_get_accessible_value() convenience method.
 
139
   * @param i A <tt>int</tt> specifying the index in the selection set.  (e.g. the
 
140
   * ith selection as opposed to the ith child).
 
141
   * @return An Atk::Object representing the selected accessible , or <tt>0</tt>
 
142
   * if @a selection does not implement this interface.
 
143
   */
 
144
  Glib::RefPtr<Atk::Object> get_selection(int i);
 
145
  
 
146
  /** Gets the number of accessible children currently selected.
 
147
   * @note callers should not rely on <tt>0</tt> or on a zero value for
 
148
   * indication of whether AtkSelectionIface is implemented, they should
 
149
   * use type checking/interface checking macros or the
 
150
   * atk_get_accessible_value() convenience method.
 
151
   * @return A <tt>int</tt> representing the number of items selected, or 0
 
152
   * if @a selection does not implement this interface.
 
153
   */
 
154
  int get_selection_count() const;
 
155
  
 
156
  /** Determines if the current child of this object is selected
 
157
   * @note callers should not rely on <tt>0</tt> or on a zero value for
 
158
   * indication of whether AtkSelectionIface is implemented, they should
 
159
   * use type checking/interface checking macros or the
 
160
   * atk_get_accessible_value() convenience method.
 
161
   * @param i A <tt>int</tt> specifying the child index.
 
162
   * @return A <tt>bool</tt> representing the specified child is selected, or 0
 
163
   * if @a selection does not implement this interface.
 
164
   */
 
165
  bool is_child_selected(int i) const;
 
166
  
 
167
  /** Removes the specified child of the object from the object's selection.
 
168
   * @param i A <tt>int</tt> specifying the index in the selection set.  (e.g. the
 
169
   * ith selection as opposed to the ith child).
 
170
   * @return <tt>true</tt> if success, <tt>false</tt> otherwise.
 
171
   */
 
172
  bool remove_selection(int i);
 
173
  
 
174
  /** Causes every child of the object to be selected if the object
 
175
   * supports multiple selections.
 
176
   * @return <tt>true</tt> if success, <tt>false</tt> otherwise.
 
177
   */
 
178
  bool select_all_selection();
 
179
 
 
180
  
 
181
  /**
 
182
   * @par Prototype:
 
183
   * <tt>void on_my_%selection_changed()</tt>
 
184
   */
 
185
 
 
186
  Glib::SignalProxy0< void > signal_selection_changed();
 
187
 
 
188
 
 
189
protected:
 
190
    virtual bool add_selection_vfunc(int i);
 
191
 
 
192
    virtual bool clear_selection_vfunc();
 
193
 
 
194
    virtual Glib::RefPtr<Atk::Object> get_selection_vfunc(int i);
 
195
 
 
196
    virtual int get_selection_count_vfunc() const;
 
197
 
 
198
    virtual bool is_child_selected_vfunc(int i) const;
 
199
 
 
200
    virtual bool remove_selection_vfunc(int i);
 
201
 
 
202
    virtual bool select_all_selection_vfunc();
 
203
 
 
204
 
 
205
public:
 
206
 
 
207
public:
 
208
  //C++ methods used to invoke GTK+ virtual functions:
 
209
 
 
210
protected:
 
211
  //GTK+ Virtual Functions (override these to change behaviour):
 
212
 
 
213
  //Default Signal Handlers::
 
214
  virtual void on_selection_changed();
 
215
 
 
216
 
 
217
};
 
218
 
 
219
} // namespace Atk
 
220
 
 
221
 
 
222
namespace Glib
 
223
{
 
224
  /** A Glib::wrap() method for this object.
 
225
   * 
 
226
   * @param object The C instance.
 
227
   * @param take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref.
 
228
   * @result A C++ instance that wraps this C instance.
 
229
   *
 
230
   * @relates Atk::Selection
 
231
   */
 
232
  Glib::RefPtr<Atk::Selection> wrap(AtkSelection* object, bool take_copy = false);
 
233
 
 
234
} // namespace Glib
 
235
 
 
236
 
 
237
#endif /* _ATKMM_SELECTION_H */
 
238