#ifndef DALI_ATSPI_ACCESSIBILITY_H\r
#define DALI_ATSPI_ACCESSIBILITY_H\r
/*\r
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.\r
+ * Copyright (c) 2021 Samsung Electronics Co., Ltd.\r
*\r
* Licensed under the Apache License, Version 2.0 (the "License");\r
* you may not use this file except in compliance with the License.\r
\r
// EXTERNAL INCLUDES\r
\r
+#include <string.h>\r
#include <array>\r
#include <atomic>\r
#include <bitset>\r
+#include <cassert>\r
#include <exception>\r
#include <functional>\r
+#include <list>\r
+#include <map>\r
#include <memory>\r
+#include <sstream>\r
#include <string>\r
-#include <map>\r
#include <unordered_map>\r
#include <vector>\r
-#include <list>\r
-#include <cassert>\r
-#include <sstream>\r
-#include <string.h>\r
\r
// INTERNAL INCLUDES\r
#include <dali/public-api/dali-adaptor-common.h>\r
{\r
namespace Accessibility\r
{\r
+/**\r
+ * @brief Enumeration describing type of object move relative to the screen. Only outgoing moves are signalled to AT-clients.\r
+ */\r
+enum class ScreenRelativeMoveType\r
+{\r
+ OUTSIDE = 0, ///< Object moves outside of the screen\r
+ OUTGOING_TOP_LEFT = 1, ///< Object moves out through the top(or left) side of the screen. Maps to: ATSPI_MOVE_OUTED_TOP_LEFT\r
+ OUTGOING_BOTTOM_RIGHT = 2, ///< Object moves out through the bottom(or right) side of the screen. Maps to: ATSPI_MOVE_OUTED_BOTTOM_RIGHT\r
+ INSIDE ///< Object moves into the screen or moves inside the screen\r
+};\r
\r
/**\r
* @brief Enumeration describing a relation between accessible objects\r
*/\r
enum class RelationType : uint32_t\r
{\r
- NULL_OF, ///< Null Relation.\r
- LABEL_FOR, ///< Label For.\r
- LABELLED_BY, ///< Labelled By.\r
- CONTROLLER_FOR, ///< Controller For.\r
- CONTROLLED_BY, ///< Controlled By.\r
- MEMBER_OF, ///< Member Of.\r
- TOOLTIP_FOR, ///< ToolTip For.\r
- NODE_CHILD_OF, ///< Node Child Of.\r
- NODE_PARENT_OF, ///< Node Parent Of.\r
- EXTENDED, ///< Extended.\r
- FLOWS_TO, ///< Flows To.\r
- FLOWS_FROM, ///< Flows From.\r
- SUBWINDOW_OF, ///< Sub Window Of.\r
- EMBEDS, ///< Embeds.\r
- EMBEDDED_BY, ///< Embedded By.\r
- POPUP_FOR, ///< Popup For\r
+ NULL_OF, ///< Null Relation.\r
+ LABEL_FOR, ///< Label For.\r
+ LABELLED_BY, ///< Labelled By.\r
+ CONTROLLER_FOR, ///< Controller For.\r
+ CONTROLLED_BY, ///< Controlled By.\r
+ MEMBER_OF, ///< Member Of.\r
+ TOOLTIP_FOR, ///< ToolTip For.\r
+ NODE_CHILD_OF, ///< Node Child Of.\r
+ NODE_PARENT_OF, ///< Node Parent Of.\r
+ EXTENDED, ///< Extended.\r
+ FLOWS_TO, ///< Flows To.\r
+ FLOWS_FROM, ///< Flows From.\r
+ SUBWINDOW_OF, ///< Sub Window Of.\r
+ EMBEDS, ///< Embeds.\r
+ EMBEDDED_BY, ///< Embedded By.\r
+ POPUP_FOR, ///< Popup For\r
PARENT_WINDOW_OF, ///< Parent Window Of.\r
- DESCRIPTION_FOR, ///< Description For.\r
- DESCRIBED_BY, ///< Described By.\r
- DETAILS, ///< Details.\r
- DETAILS_FOR, ///< Details For.\r
- ERROR_MESSAGE, ///< Error Message.\r
- ERROR_FOR, ///< Error For.\r
+ DESCRIPTION_FOR, ///< Description For.\r
+ DESCRIBED_BY, ///< Described By.\r
+ DETAILS, ///< Details.\r
+ DETAILS_FOR, ///< Details For.\r
+ ERROR_MESSAGE, ///< Error Message.\r
+ ERROR_FOR, ///< Error For.\r
MAX_COUNT\r
};\r
\r
/**\r
* @brief Enumeration describing if coordinates are relative to screen or window\r
* @see Accessibility::Component::GetExtents\r
- * @see Accessibility::Component::Contains\r
+ * @see Accessibility::Component::IsAccessibleContainedAtPoint\r
*/\r
-enum class CoordType\r
+enum class CoordinateType\r
{\r
SCREEN, ///< Screen.\r
- WINDOW ///< Window.\r
+ WINDOW ///< Window.\r
};\r
\r
/**\r
*/\r
enum class ComponentLayer\r
{\r
- INVALID, ///< Invalid.\r
+ INVALID, ///< Invalid.\r
BACKGROUND, ///< Background.\r
- CANVAS, ///< Canvas.\r
- WIDGET, ///< Widget.\r
- MDI, ///< MDI.\r
- POPUP, ///< Popup.\r
- OVERLAY, ///< Overlay.\r
- WINDOW, ///< Window.\r
+ CANVAS, ///< Canvas.\r
+ WIDGET, ///< Widget.\r
+ MDI, ///< MDI.\r
+ POPUP, ///< Popup.\r
+ OVERLAY, ///< Overlay.\r
+ WINDOW, ///< Window.\r
MAX_COUNT\r
};\r
\r
enum class TextBoundary : uint32_t\r
{\r
CHARACTER, ///> Only one character is acquired.\r
- WORD, ///> Not supported.\r
- SENTENCE, ///> Not supported.\r
- LINE, ///> Not supported.\r
+ WORD, ///> Not supported.\r
+ SENTENCE, ///> Not supported.\r
+ LINE, ///> Not supported.\r
PARAGRAPH, ///> Not supported.\r
MAX_COUNT\r
};\r
* @see Dali::Accessibility::Accessible::GetStates\r
* @see Dali::Accessibility::Accessible::GetRoles\r
*/\r
-template < size_t I, typename S >\r
+template<size_t I, typename S>\r
class BitSets\r
{\r
- std::array< uint32_t, I > data;\r
+ std::array<uint32_t, I> data;\r
\r
- void _set()\r
+ void Set()\r
{\r
}\r
\r
- static constexpr bool _accepts()\r
+ static constexpr bool Accepts()\r
{\r
return true;\r
}\r
\r
- template < typename T > static constexpr bool _accepts()\r
+ template<typename T>\r
+ static constexpr bool Accepts()\r
{\r
- return std::is_enum< T >::value;\r
+ return std::is_enum<T>::value;\r
}\r
\r
- template < typename T, typename T2, typename ... ARGS > static constexpr bool _accepts()\r
+ template<typename T, typename T2, typename... ARGS>\r
+ static constexpr bool Accepts()\r
{\r
- return std::is_enum< T >::value && _accepts< T2, ARGS... >();\r
+ return std::is_enum<T>::value && Accepts<T2, ARGS...>();\r
}\r
\r
- template < typename T, typename ... ARGS > void _set(T t, ARGS ... args)\r
+ template<typename T, typename... ARGS>\r
+ void Set(T t, ARGS... args)\r
{\r
(*this)[t] = true;\r
- _set(args...);\r
+ Set(args...);\r
}\r
+\r
public:\r
BitSets()\r
{\r
- for( auto& u : data )\r
+ for(auto& u : data)\r
{\r
u = 0;\r
}\r
}\r
BitSets(const BitSets&) = default;\r
- BitSets(BitSets&&) = default;\r
+ BitSets(BitSets&&) = default;\r
\r
- template < typename T, typename ... ARGS, typename std::enable_if< _accepts< T, ARGS... >() >::type * = nullptr >BitSets( T t, ARGS ... args )\r
+ template<typename T, typename... ARGS, typename std::enable_if<Accepts<T, ARGS...>()>::type* = nullptr>\r
+ BitSets(T t, ARGS... args)\r
{\r
- for( auto& u : data )\r
- u = 0;\r
- _set( t, args... );\r
+ for(auto& u : data)\r
+ u = 0;\r
+ Set(t, args...);\r
}\r
\r
- explicit BitSets( std::array< uint32_t, I > d )\r
+ explicit BitSets(std::array<uint32_t, I> d)\r
{\r
- for( auto i = 0u; i < I; ++i )\r
+ for(auto i = 0u; i < I; ++i)\r
{\r
data[i] = d[i];\r
}\r
}\r
\r
- explicit BitSets( std::array< int32_t, I > d )\r
+ explicit BitSets(std::array<int32_t, I> d)\r
{\r
- for( auto i = 0u; i < I; ++i )\r
+ for(auto i = 0u; i < I; ++i)\r
{\r
- data[i] = static_cast<uint32_t>( d[i] );\r
+ data[i] = static_cast<uint32_t>(d[i]);\r
}\r
}\r
\r
- BitSets& operator = (const BitSets&) = default;\r
- BitSets& operator = (BitSets&&) = default;\r
+ BitSets& operator=(const BitSets&) = default;\r
+ BitSets& operator=(BitSets&&) = default;\r
\r
struct reference\r
{\r
- std::array< uint32_t, I >& data;\r
- size_t pos;\r
+ std::array<uint32_t, I>& data;\r
+ size_t pos;\r
\r
- reference& operator=( reference r )\r
+ reference& operator=(reference r)\r
{\r
- (*this) = static_cast<bool>( r );\r
+ (*this) = static_cast<bool>(r);\r
return *this;\r
}\r
\r
- reference& operator=( bool v )\r
+ reference& operator=(bool v)\r
{\r
- if( v )\r
+ if(v)\r
{\r
data[pos / 32] |= 1 << (pos & 31);\r
}\r
\r
operator bool() const\r
{\r
- auto i = static_cast<size_t>( pos );\r
+ auto i = static_cast<size_t>(pos);\r
return (data[i / 32] & (1 << (i & 31))) != 0;\r
}\r
};\r
\r
- reference operator[]( S index )\r
+ reference operator[](S index)\r
{\r
- return { data, static_cast<size_t>( index ) };\r
+ return {data, static_cast<size_t>(index)};\r
}\r
\r
- bool operator[]( S index ) const\r
+ bool operator[](S index) const\r
{\r
- auto i = static_cast<size_t>( index );\r
- return ( data[i / 32] & ( 1 << (i & 31) ) ) != 0;\r
+ auto i = static_cast<size_t>(index);\r
+ return (data[i / 32] & (1 << (i & 31))) != 0;\r
}\r
\r
- std::array< uint32_t, I > GetRawData() const\r
+ std::array<uint32_t, I> GetRawData() const\r
{\r
return data;\r
}\r
\r
- BitSets operator|( BitSets b ) const\r
+ BitSets operator|(BitSets b) const\r
{\r
BitSets r;\r
- for( auto i = 0u; i < I; ++i )\r
+ for(auto i = 0u; i < I; ++i)\r
{\r
r.data[i] = data[i] | b.data[i];\r
}\r
return r;\r
}\r
\r
- BitSets operator^( BitSets b ) const\r
+ BitSets operator^(BitSets b) const\r
{\r
BitSets r;\r
- for( auto i = 0u; i < I; ++i )\r
+ for(auto i = 0u; i < I; ++i)\r
{\r
r.data[i] = data[i] ^ b.data[i];\r
}\r
return r;\r
}\r
\r
- BitSets operator&( BitSets b ) const\r
+ BitSets operator&(BitSets b) const\r
{\r
BitSets r;\r
- for( auto i = 0u; i < I; ++i )\r
+ for(auto i = 0u; i < I; ++i)\r
{\r
r.data[i] = data[i] & b.data[i];\r
}\r
return r;\r
}\r
\r
- bool operator==( BitSets b ) const\r
+ bool operator==(BitSets b) const\r
{\r
- for( auto i = 0u; i < I; ++i )\r
+ for(auto i = 0u; i < I; ++i)\r
{\r
- if( data[i] != b.data[i] )\r
+ if(data[i] != b.data[i])\r
{\r
return false;\r
}\r
\r
explicit operator bool() const\r
{\r
- for( auto& u : data )\r
+ for(auto& u : data)\r
{\r
- if( u )\r
+ if(u)\r
{\r
return true;\r
}\r
};\r
\r
using ReadingInfoTypes = BitSets<1, ReadingInfoType>;\r
-using States = BitSets< 2, State >;\r
-using Attributes = std::unordered_map< std::string, std::string >;\r
+using States = BitSets<2, State>;\r
+using Attributes = std::unordered_map<std::string, std::string>;\r
\r
/**\r
* @brief Class representing unique object address on accessibility bus\r
public:\r
Address() = default;\r
\r
- Address( std::string bus, std::string path )\r
+ Address(std::string bus, std::string path)\r
: mBus(std::move(bus)),\r
mPath(std::move(path))\r
{\r
return mPath;\r
}\r
\r
- bool operator == ( const Address& a ) const\r
+ bool operator==(const Address& a) const\r
{\r
return mBus == a.mBus && mPath == a.mPath;\r
}\r
\r
- bool operator != ( const Address& a ) const\r
+ bool operator!=(const Address& a) const\r
{\r
return !(*this == a);\r
}\r
\r
Point() = default;\r
\r
- Point( int x, int y )\r
+ Point(int x, int y)\r
: x(x),\r
y(y)\r
{\r
*/\r
struct DALI_ADAPTOR_API Size\r
{\r
- int width = 0;\r
+ int width = 0;\r
int height = 0;\r
\r
Size() = default;\r
{\r
}\r
\r
- bool operator==( Size p ) const\r
+ bool operator==(Size p) const\r
{\r
return width == p.width && height == p.height;\r
}\r
\r
- bool operator!=( Size p ) const\r
+ bool operator!=(Size p) const\r
{\r
return !(*this == p);\r
}\r
/**\r
* @brief Helper class used to store data related with Accessibility::Text interface\r
* @see Dali::Accessibility::Text::GetTextAtOffset\r
- * @see Dali::Accessibility::Text::GetSelection\r
+ * @see Dali::Accessibility::Text::GetRangeOfSelection\r
*/\r
struct DALI_ADAPTOR_API Range\r
{\r
- int32_t startOffset = 0;\r
- int32_t endOffset = 0;\r
+ int32_t startOffset = 0;\r
+ int32_t endOffset = 0;\r
std::string content;\r
\r
Range() = default;\r
{\r
}\r
\r
- Gesture type{};\r
- int32_t xBeg{};\r
- int32_t xEnd{};\r
- int32_t yBeg{};\r
- int32_t yEnd{};\r
+ Gesture type{};\r
+ int32_t xBeg{};\r
+ int32_t xEnd{};\r
+ int32_t yBeg{};\r
+ int32_t yEnd{};\r
GestureState state{};\r
- uint32_t eventTime{};\r
+ uint32_t eventTime{};\r
};\r
\r
/**\r
*/\r
struct DALI_ADAPTOR_API Relation\r
{\r
-Relation(RelationType relationType, std::vector<Address> targets)\r
-: relationType(relationType),\r
- targets(targets)\r
-{\r
-}\r
+ Relation(RelationType relationType, std::vector<Address> targets)\r
+ : relationType(relationType),\r
+ targets(targets)\r
+ {\r
+ }\r
\r
-RelationType relationType;\r
-std::vector<Address> targets;\r
+ RelationType relationType;\r
+ std::vector<Address> targets;\r
};\r
\r
} // namespace Accessibility\r