1 #ifndef DALI_ADAPTOR_PROXY_ACCESSIBLE_H
2 #define DALI_ADAPTOR_PROXY_ACCESSIBLE_H
5 * Copyright (c) 2021 Samsung Electronics Co., Ltd.
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
11 * http://www.apache.org/licenses/LICENSE-2.0
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.
25 #include <dali/devel-api/adaptor-framework/accessibility.h>
26 #include <dali/devel-api/atspi-interfaces/accessible.h>
27 #include <dali/devel-api/atspi-interfaces/component.h>
29 namespace Dali::Accessibility
32 * @brief The minimalistic, always empty Accessible object with settable address.
34 * To be used as a proxy object, in those situations where you want to return an address in
35 * a different bridge (embedding for example), but the object itself isn't planned to be used
36 * otherwise. This object has a settable parent, no children, an empty name and so on.
38 class DALI_ADAPTOR_API ProxyAccessible : public virtual Accessible, public virtual Component
47 void SetAddress(Address address)
49 mAddress = std::move(address);
52 void SetParent(Accessible* parent)
57 std::string GetName() const override
62 std::string GetDescription() const override
67 Accessible* GetParent() override
72 size_t GetChildCount() const override
77 std::vector<Accessible*> GetChildren() override
82 Accessible* GetChildAtIndex(size_t index) override
84 throw std::domain_error{"out of bounds index (" + std::to_string(index) + ") - no children"};
87 size_t GetIndexInParent() override
89 return static_cast<size_t>(-1);
92 Role GetRole() const override
97 std::string GetRoleName() const override
102 States GetStates() override
107 Attributes GetAttributes() const override
112 bool IsProxy() const override
117 Address GetAddress() const override
122 bool DoGesture(const GestureInfo& gestureInfo) override
127 std::vector<Relation> GetRelationSet() override
132 Dali::Actor GetInternalActor() override
134 return Dali::Actor{};
137 Rect<> GetExtents(CoordinateType type) const override
139 auto* parent = Component::DownCast(mParent);
141 return parent ? parent->GetExtents(type) : Rect<>{};
144 ComponentLayer GetLayer() const override
146 return ComponentLayer::WINDOW;
149 int16_t GetMdiZOrder() const override
154 bool GrabFocus() override
159 double GetAlpha() const override
164 bool GrabHighlight() override
169 bool ClearHighlight() override
174 bool IsScrollable() const override
184 } // namespace Dali::Accessibility
186 #endif // DALI_ADAPTOR_PROXY_ACCESSIBLE_H