[dali_2.3.24] Merge branch 'devel/master'
[platform/core/uifw/dali-adaptor.git] / dali / internal / accessibility / bridge / bridge-component.h
1 #ifndef DALI_INTERNAL_ACCESSIBILITY_BRIDGE_COMPONENT_H
2 #define DALI_INTERNAL_ACCESSIBILITY_BRIDGE_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
21 // EXTERNAL INCLUDES
22 #include <array>
23 #include <string>
24 #include <tuple>
25 #include <unordered_map>
26 #include <vector>
27
28 // INTERNAL INCLUDES
29 #include <dali/devel-api/atspi-interfaces/component.h>
30 #include <dali/internal/accessibility/bridge/bridge-base.h>
31
32 /**
33  * @brief The BridgeComponent class is to correspond with Dali::Accessibility::Component.
34  */
35 class BridgeComponent : public virtual BridgeBase
36 {
37 protected:
38   /**
39    * @brief Constructor.
40    */
41   BridgeComponent();
42
43   /**
44    * @brief Registers Component functions to dbus interfaces.
45    */
46   void RegisterInterfaces();
47
48   /**
49    * @brief Returns the Component object of the currently executed DBus method call.
50    *
51    * @return The Component object
52    */
53   Dali::Accessibility::Component* FindSelf() const;
54
55 public:
56   /**
57    * @copydoc Dali::Accessibility::Component::IsAccessibleContainingPoint()
58    */
59   DBus::ValueOrError<bool> IsAccessibleContainingPoint(int32_t x, int32_t y, uint32_t coordType);
60
61   /**
62    * @copydoc Dali::Accessibility::Component::GetAccessibleAtPoint()
63    */
64   DBus::ValueOrError<Dali::Accessibility::Accessible*> GetAccessibleAtPoint(int32_t x, int32_t y, uint32_t coordType);
65
66   /**
67    * @copydoc Dali::Accessibility::Component::GetExtents()
68    */
69   DBus::ValueOrError<std::tuple<int32_t, int32_t, int32_t, int32_t> > GetExtents(uint32_t coordType);
70
71   /**
72    * @brief Gets the position from the given coordinate.
73    * @param[in] coordType The enumeration with type of coordinate systems
74    * @return The X and Y position of rectangle
75    */
76   DBus::ValueOrError<int32_t, int32_t> GetPosition(uint32_t coordType);
77
78   /**
79    * @brief Gets the size from the given coordinate.
80    * @param[in] coordType The enumeration with type of coordinate systems
81    * @return The width and height of rectangle
82    */
83   DBus::ValueOrError<int32_t, int32_t> GetSize(uint32_t coordType);
84
85   /**
86    * @copydoc Dali::Accessibility::Component::GetLayer()
87    */
88   DBus::ValueOrError<Dali::Accessibility::ComponentLayer> GetLayer();
89
90   /**
91    * @copydoc Dali::Accessibility::Component::GetAlpha()
92    */
93   DBus::ValueOrError<double> GetAlpha();
94
95   /**
96    * @copydoc Dali::Accessibility::Component::GrabFocus()
97    */
98   DBus::ValueOrError<bool> GrabFocus();
99
100   /**
101    * @copydoc Dali::Accessibility::Component::GrabHighlight()
102    */
103   DBus::ValueOrError<bool> GrabHighlight();
104
105   /**
106    * @copydoc Dali::Accessibility::Component::ClearHighlight()
107    */
108   DBus::ValueOrError<bool> ClearHighlight();
109
110   /**
111    * @copydoc Dali::Accessibility::Component::GetMdiZOrder()
112    */
113   DBus::ValueOrError<int16_t> GetMdiZOrder();
114 };
115
116 #endif // DALI_INTERNAL_ACCESSIBILITY_BRIDGE_COMPONENT_H