Merge "Add a callback for navigation policy in web engine." into devel/master
[platform/core/uifw/dali-adaptor.git] / dali / devel-api / atspi-interfaces / component.h
1 #ifndef DALI_ADAPTOR_ATSPI_COMPONENT_H
2 #define DALI_ADAPTOR_ATSPI_COMPONENT_H
3
4 /*
5  * Copyright (c) 2021 Samsung Electronics Co., Ltd.
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  */
19
20 // EXTERNAL INCLUDES
21 #include <cstdint>
22 #include <dali/public-api/math/rect.h>
23
24 // INTERNAL INCLUDES
25 #include <dali/devel-api/adaptor-framework/accessibility.h>
26 #include <dali/devel-api/atspi-interfaces/accessible.h>
27
28 namespace Dali::Accessibility
29 {
30 /**
31  * @brief Interface representing objects having screen coordinates.
32  */
33 class DALI_ADAPTOR_API Component : public virtual Accessible
34 {
35 public:
36   /**
37    * @brief Gets rectangle describing size.
38    *
39    * @param[in] type The enumeration with type of coordinate systems
40    *
41    * @return Rect<> object
42    *
43    * @see Dali::Rect
44    */
45   virtual Rect<> GetExtents(CoordinateType type) const = 0;
46
47   /**
48    * @brief Gets layer current object is localized on.
49    *
50    * @return The enumeration pointing layer
51    *
52    * @see Dali::Accessibility::ComponentLayer
53    */
54   virtual ComponentLayer GetLayer() const = 0;
55
56   /**
57    * @brief Gets value of z-order.
58    *
59    * @return The value of z-order
60    * @remarks MDI means "Multi Document Interface" (https://en.wikipedia.org/wiki/Multiple-document_interface)
61    * which in short means that many stacked windows can be displayed within a single application.
62    * In such model, the concept of z-order of UI element became important to deal with element overlapping.
63    */
64   virtual int16_t GetMdiZOrder() const = 0;
65
66   /**
67    * @brief Sets current object as "focused".
68    *
69    * @return true on success, false otherwise
70    */
71   virtual bool GrabFocus() = 0;
72
73   /**
74    * @brief Gets value of alpha channel.
75    *
76    * @return The alpha channel value in range [0.0, 1.0]
77    */
78   virtual double GetAlpha() const = 0;
79
80   /**
81    * @brief Sets current object as "highlighted".
82    *
83    * The method assings "highlighted" state, simultaneously removing it
84    * from currently highlighted object.
85    *
86    * @return true on success, false otherwise
87    */
88   virtual bool GrabHighlight() = 0;
89
90   /**
91    * @brief Sets current object as "unhighlighted".
92    *
93    * The method removes "highlighted" state from object.
94    *
95    * @return true on success, false otherwise
96    *
97    * @see Dali:Accessibility::State
98    */
99   virtual bool ClearHighlight() = 0;
100
101   /**
102    * @brief Checks whether object can be scrolled.
103    *
104    * @return true if object is scrollable, false otherwise
105    *
106    * @see Dali:Accessibility::State
107    */
108   virtual bool IsScrollable() const = 0;
109
110   /**
111    * @brief Gets Accessible object containing given point.
112    *
113    * @param[in] point The two-dimensional point
114    * @param[in] type The enumeration with type of coordinate system
115    *
116    * @return The handle to last child of current object which contains given point
117    *
118    * @see Dali::Accessibility::Point
119    */
120   virtual Accessible* GetAccessibleAtPoint(Point point, CoordinateType type);
121
122   /**
123    * @brief Checks if the current object contains the given point inside.
124    *
125    * @param[in] point The two-dimensional point
126    * @param[in] type The enumeration with type of coordinate system
127    *
128    * @return True if accessible contains in point, otherwise false.
129    *
130    * @remarks This method is `Contains` in DBus method.
131    * @see Dali::Accessibility::Point
132    */
133   virtual bool IsAccessibleContainingPoint(Point point, CoordinateType type) const;
134 };
135
136 } // namespace Dali::Accessibility
137
138 #endif // DALI_ADAPTOR_ATSPI_COMPONENT_H