52051c130e4e2785a882ea2674245ef00135fff6
[platform/upstream/atk.git] / atk / atkselection.h
1 /* ATK -  Accessibility Toolkit
2  * Copyright 2001 Sun Microsystems Inc.
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Library General Public
6  * License as published by the Free Software Foundation; either
7  * version 2 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12  * Library General Public License for more details.
13  *
14  * You should have received a copy of the GNU Library General Public
15  * License along with this library; if not, write to the
16  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17  * Boston, MA 02111-1307, USA.
18  */
19
20 #ifndef __ATK_SELECTION_H__
21 #define __ATK_SELECTION_H__
22
23 #include <atk/atkobject.h>
24
25 #ifdef __cplusplus
26 extern "C" {
27 #endif /* __cplusplus */
28
29 /*
30  * This AtkSelection interface provides the standard mechanism for an 
31  * assistive technology to determine what the current selected children are, 
32  * as well as modify the selection set. Any object that has children that 
33  * can be selected should support the AtkSelection interface.
34  */
35
36 #define ATK_TYPE_SELECTION                        (atk_selection_get_type ())
37 #define ATK_IS_SELECTION(obj)                     G_TYPE_CHECK_INSTANCE_TYPE ((obj), ATK_TYPE_SELECTION)
38 #define ATK_SELECTION(obj)                        G_TYPE_CHECK_INSTANCE_CAST ((obj), ATK_TYPE_SELECTION, AtkSelection)
39 #define ATK_SELECTION_GET_IFACE(obj)              (G_TYPE_INSTANCE_GET_INTERFACE ((obj), ATK_TYPE_SELECTION, AtkSelectionIface))
40
41 #ifndef _TYPEDEF_ATK_SELECTION_
42 #define _TYPEDEF_ATK_SELECTION_
43 typedef struct _AtkSelection AtkSelection;
44 #endif
45
46 struct _AtkSelectionIface
47 {
48   GTypeInterface parent;
49
50   /*
51    * Adds the specified accessible child of the object to the
52    * object's selection.
53    */
54   void         (* add_selection)        (AtkSelection   *selection,
55                                          gint           i);
56   /*
57    * Clears the selection in the object so that no children in the object
58    * are selected.
59    */
60   void         (* clear_selection)      (AtkSelection   *selection);
61   /*
62    * Returns a reference to the accessible object representing the specified 
63    * selected * child of the object.
64    */
65   AtkObject*   (* ref_selection)        (AtkSelection   *selection,
66                                          gint           i);
67   /*
68    * Returns the number of accessible children currently selected.
69    */
70   gint         (* get_selection_count)  (AtkSelection   *selection);
71   /*
72    * Determines if the current child of this object is selected
73    */
74   gboolean     (* is_child_selected)    (AtkSelection   *selection,
75                                          gint           i);
76   /*
77    * Removes the specified child of the object from the object's selection.
78    */
79   void         (* remove_selection)     (AtkSelection   *selection,
80                                          gint           i);
81   /*
82    * Causes every child of the object to be selected if the object
83    * supports multiple selections.
84    */
85   void         (* select_all_selection) (AtkSelection   *selection);
86
87 };
88 GType atk_selection_get_type ();
89
90 void         atk_selection_add_selection        (AtkSelection   *selection,
91                                                  gint           i);
92
93 void         atk_selection_clear_selection      (AtkSelection   *selection);
94
95 AtkObject*   atk_selection_ref_selection        (AtkSelection   *selection,
96                                                  gint           i);
97
98 gint         atk_selection_get_selection_count  (AtkSelection   *selection);
99
100 gboolean     atk_selection_is_child_selected    (AtkSelection   *selection,
101                                                  gint           i);
102
103 void         atk_selection_remove_selection     (AtkSelection   *selection,
104                                                  gint           i);
105
106 void         atk_selection_select_all_selection (AtkSelection   *selection);
107
108 #ifdef __cplusplus
109 }
110 #endif /* __cplusplus */
111
112
113 #endif /* __ATK_SELECTION_H__ */