Merge upstream branch 2.31.1 into branch origin/tizen
[platform/upstream/at-spi2-core.git] / idl / component.didl
1
2 using org.freestandards.atspi.Accessible.Reference = Reference;
3
4 /*
5   The Component interface is implemented by objects which occupy on-screen space, e.g. objects
6   which have onscreen visual representations. The methods in Component allow clients to identify
7   where the objects lie in the onscreen coordinate system, their relative size, stacking order, and
8   position.  It also provides a mechanism whereby keyboard focus may be transferred to specific
9   user interface elements programmatically.  This is a 2D API, coordinates of 3D objects are projected into the
10   2-dimensional screen view for purposes of this interface.
11 */
12 interface org.freestandards.atspi.Component {
13
14         /* 
15            Used by Component, Image and Text interfaces to specify whether coordinates are
16            relative to the window or screen.
17         */
18         enum <uint32> CoordType {
19                 COORD_TYPE_SCREEN = 0,
20                 COORD_TYPE_WINDOW = 1
21         }
22
23         /*
24           Used by Component and Text interfaces, a struct defining a bounding rectange.
25           The coordinate system is determined by the context of the API call.
26         */
27         struct BoundingBox {
28                 int32 x;
29                 int32 y;
30                 int32 width;
31                 int32 height;
32         }
33
34         /*
35           Indicates the relative stacking order with respect to the onscreen visual representation.
36
37           The order of layers, from bottom to top is:
38                 LAYER_BACKGROUND
39                 LAYER_WINDOW
40                 LAYER_MDI
41                 LAYER_CANVAS
42                 LAYER_WIDGET
43                 LAYER_POPUP
44                 LAYER_OVERLAY
45         */
46         enum <uint32> ComponentLayer {
47                 LAYER_INVALID,
48                 LAYER_BACKGROUND,
49                 LAYER_CANVAS,
50                 LAYER_WIDGET,
51                 LAYER_MDI,
52                 LAYER_POPUP,
53                 LAYER_OVERLAY,
54                 LAYER_WINDOW,
55                 LAYER_LAST_DEFINED
56         }
57
58         /*
59           Describes where the object should be placed on the window.
60          */
61         enum uint32 ScrollType {
62                 SCROLL_TOP_LEFT = 0,
63                 SCROLL_BOTTOM_RIGHT,
64                 SCROLL_TOP_EDGE,
65                 SCROLL_BOTTOM_EDGE,
66                 SCROLL_LEFT_EDGE,
67                 SCROLL_RIGHT_EDGE,
68                 SCROLL_ANYWHERE
69         }
70
71         /*
72           Specifies whether the coordinates are relative to the screen, to the
73           window, or to the parent object.
74          */
75         enum uint32 CoordType {
76                 COORD_TYPE_SCREEN = 0,
77                 COORD_TYPE_WINDOW,
78                 COORD_TYPE_PARENT
79         }
80
81         /*
82           True if the specified point lies within the components bounding box.
83          */ 
84         method Contains {
85                 int32 x;
86                 int32 y;
87                 CoordType coord_type;
88         } reply {
89                 boolean within;
90         }
91
92         /*
93           Return the accessible child whose bounding box contains the specified point.
94          */
95         method GetAccessibleAtPoint {
96                 int32 x;
97                 int32 y;
98                 CoordType coord_type;
99         } reply {
100                 Reference child;
101         }
102
103         /*
104           Obtain the components bounding box, in pixels, relative to the specified coordinate system.
105         */
106         method GetExtents {
107                 CoordType cood_type;
108         } reply {
109                 BoundingBox box;
110         }
111
112         /*
113           Obtain the position of the current component in the specified coordinate system.
114         */
115         method GetPosition {
116                 CoordType coord_type;
117         } reply {
118                 int32 x;
119                 int32 y;
120         }
121
122         /*
123           Obtain the size in the specified coordinate system.
124           Fully contains teh object's visual representation without accounting for viewport clipping.
125         */
126         method GetSize reply {
127                 int32 width;
128                 int32 height;
129         }
130
131         /*
132           The component layer in which this object resides.
133         */
134         method GetLayer reply {
135                 ComponentLayer layer;
136         }
137
138         /*
139           Obtain the relative stacking order (i.e 'Z' order) of an object.
140           Larger values indicate that an object is on 'top' of the stack.
141           Only relevenat for objects in LAYER_MDI or LAYER_WINDOW.
142         */
143         method GetMDIZOrder reply {
144                 int16 order;
145         }
146
147         /*
148           Request that an object obtain keyboard focus.
149         */
150         method GrabFocus reply {
151                 boolean success;
152         }
153
154         /*
155           Obtain the alpha value of the component.
156           Alpha values are used with Z-Order to determine whether an obeject obscures
157           anothers visual representation.
158         */
159         method GetAlpha reply {
160                 double alpha;
161         }
162
163         /*
164           Scroll this object so it becomes visible on the screen.
165          */
166         method ScrollTo {
167                 ScrollType type;
168         }
169
170         /*
171           Scroll this object so it becomes visible on the screen at a given position.
172          */
173         method ScrollToPoint {
174                 CoordType type;
175                 int32 x;
176                 int32 y;
177         }
178 }