// INTERNAL INCLUDES
#include <dali/devel-api/adaptor-framework/accessibility.h>
#include <dali/devel-api/atspi-interfaces/accessible.h>
+#include <dali/devel-api/atspi-interfaces/component.h>
namespace Dali::Accessibility
{
/**
* @brief The minimalistic, always empty Accessible object with settable address.
*
- * For those situations, where you want to return address in different bridge
- * (embedding for example), but the object itself ain't planned to be used otherwise.
- * This object has null parent, no children, empty name and so on
+ * To be used as a proxy object, in those situations where you want to return an address in
+ * a different bridge (embedding for example), but the object itself isn't planned to be used
+ * otherwise. This object has a settable parent, no children, an empty name and so on.
*/
-class DALI_ADAPTOR_API EmptyAccessibleWithAddress : public virtual Accessible
+class DALI_ADAPTOR_API ProxyAccessible : public virtual Accessible, public virtual Component
{
public:
- EmptyAccessibleWithAddress() = default;
-
- EmptyAccessibleWithAddress(Address address)
- : mAddress(std::move(address))
+ ProxyAccessible()
+ : mAddress{},
+ mParent{nullptr}
{
}
void SetAddress(Address address)
{
- this->mAddress = std::move(address);
+ mAddress = std::move(address);
}
- std::string GetName() override
+ void SetParent(Accessible* parent)
+ {
+ mParent = parent;
+ }
+
+ std::string GetName() const override
{
return "";
}
- std::string GetDescription() override
+ std::string GetDescription() const override
{
return "";
}
Accessible* GetParent() override
{
- return nullptr;
+ return mParent;
}
- size_t GetChildCount() override
+ size_t GetChildCount() const override
{
return 0;
}
return static_cast<size_t>(-1);
}
- Role GetRole() override
+ Role GetRole() const override
{
return {};
}
- std::string GetRoleName() override;
+ std::string GetRoleName() const override
+ {
+ return {};
+ }
States GetStates() override
{
return {};
}
- Attributes GetAttributes() override
+ bool IsProxy() const override
{
- return {};
+ return true;
}
- Address GetAddress() override
+ Address GetAddress() const override
{
return mAddress;
}
return Dali::Actor{};
}
+ Rect<> GetExtents(CoordinateType type) const override
+ {
+ auto* parent = Component::DownCast(mParent);
+
+ return parent ? parent->GetExtents(type) : Rect<>{};
+ }
+
+ ComponentLayer GetLayer() const override
+ {
+ return ComponentLayer::WINDOW;
+ }
+
+ int16_t GetMdiZOrder() const override
+ {
+ return false;
+ }
+
+ bool GrabFocus() override
+ {
+ return false;
+ }
+
+ double GetAlpha() const override
+ {
+ return 0.0;
+ }
+
+ bool GrabHighlight() override
+ {
+ return false;
+ }
+
+ bool ClearHighlight() override
+ {
+ return false;
+ }
+
+ bool IsScrollable() const override
+ {
+ return false;
+ }
+
private:
- Address mAddress;
+ Address mAddress;
+ Accessible* mParent;
};
} // namespace Dali::Accessibility