X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali%2Fdevel-api%2Fadaptor-framework%2Faccessibility.h;h=1f49d2bae8d568ca5833db23a35525347b588a70;hb=fc7b883f6198c5683f596b82a79d11d063eca361;hp=a6e373e7658b84097d3d07e0d891b47a2c59eb94;hpb=df659b2741d25de3744253b4de17df837bacedb5;p=platform%2Fcore%2Fuifw%2Fdali-adaptor.git diff --git a/dali/devel-api/adaptor-framework/accessibility.h b/dali/devel-api/adaptor-framework/accessibility.h index a6e373e..1f49d2b 100644 --- a/dali/devel-api/adaptor-framework/accessibility.h +++ b/dali/devel-api/adaptor-framework/accessibility.h @@ -1,7 +1,7 @@ #ifndef DALI_ATSPI_ACCESSIBILITY_H #define DALI_ATSPI_ACCESSIBILITY_H /* - * Copyright (c) 2019 Samsung Electronics Co., Ltd. + * Copyright (c) 2021 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,20 +19,20 @@ // EXTERNAL INCLUDES +#include #include #include #include +#include #include #include +#include +#include #include +#include #include -#include #include #include -#include -#include -#include -#include // INTERNAL INCLUDES #include @@ -41,6 +41,16 @@ namespace Dali { namespace Accessibility { +/** + * @brief Enumeration describing type of object move relative to the screen. Only outgoing moves are signalled to AT-clients. + */ +enum class ScreenRelativeMoveType +{ + OUTSIDE = 0, ///< Object moves outside of the screen + OUTGOING_TOP_LEFT = 1, ///< Object moves out through the top(or left) side of the screen. Maps to: ATSPI_MOVE_OUTED_TOP_LEFT + OUTGOING_BOTTOM_RIGHT = 2, ///< Object moves out through the bottom(or right) side of the screen. Maps to: ATSPI_MOVE_OUTED_BOTTOM_RIGHT + INSIDE ///< Object moves into the screen or moves inside the screen +}; /** * @brief Enumeration describing a relation between accessible objects @@ -49,41 +59,41 @@ namespace Accessibility */ enum class RelationType : uint32_t { - NULL_OF, ///< Null Relation. - LABEL_FOR, ///< Label For. - LABELLED_BY, ///< Labelled By. - CONTROLLER_FOR, ///< Controller For. - CONTROLLED_BY, ///< Controlled By. - MEMBER_OF, ///< Member Of. - TOOLTIP_FOR, ///< ToolTip For. - NODE_CHILD_OF, ///< Node Child Of. - NODE_PARENT_OF, ///< Node Parent Of. - EXTENDED, ///< Extended. - FLOWS_TO, ///< Flows To. - FLOWS_FROM, ///< Flows From. - SUBWINDOW_OF, ///< Sub Window Of. - EMBEDS, ///< Embeds. - EMBEDDED_BY, ///< Embedded By. - POPUP_FOR, ///< Popup For + NULL_OF, ///< Null Relation. + LABEL_FOR, ///< Label For. + LABELLED_BY, ///< Labelled By. + CONTROLLER_FOR, ///< Controller For. + CONTROLLED_BY, ///< Controlled By. + MEMBER_OF, ///< Member Of. + TOOLTIP_FOR, ///< ToolTip For. + NODE_CHILD_OF, ///< Node Child Of. + NODE_PARENT_OF, ///< Node Parent Of. + EXTENDED, ///< Extended. + FLOWS_TO, ///< Flows To. + FLOWS_FROM, ///< Flows From. + SUBWINDOW_OF, ///< Sub Window Of. + EMBEDS, ///< Embeds. + EMBEDDED_BY, ///< Embedded By. + POPUP_FOR, ///< Popup For PARENT_WINDOW_OF, ///< Parent Window Of. - DESCRIPTION_FOR, ///< Description For. - DESCRIBED_BY, ///< Described By. - DETAILS, ///< Details. - DETAILS_FOR, ///< Details For. - ERROR_MESSAGE, ///< Error Message. - ERROR_FOR, ///< Error For. + DESCRIPTION_FOR, ///< Description For. + DESCRIBED_BY, ///< Described By. + DETAILS, ///< Details. + DETAILS_FOR, ///< Details For. + ERROR_MESSAGE, ///< Error Message. + ERROR_FOR, ///< Error For. MAX_COUNT }; /** * @brief Enumeration describing if coordinates are relative to screen or window * @see Accessibility::Component::GetExtents - * @see Accessibility::Component::Contains + * @see Accessibility::Component::IsAccessibleContainedAtPoint */ -enum class CoordType +enum class CoordinateType { SCREEN, ///< Screen. - WINDOW ///< Window. + WINDOW ///< Window. }; /** @@ -95,14 +105,14 @@ enum class CoordType */ enum class ComponentLayer { - INVALID, ///< Invalid. + INVALID, ///< Invalid. BACKGROUND, ///< Background. - CANVAS, ///< Canvas. - WIDGET, ///< Widget. - MDI, ///< MDI. - POPUP, ///< Popup. - OVERLAY, ///< Overlay. - WINDOW, ///< Window. + CANVAS, ///< Canvas. + WIDGET, ///< Widget. + MDI, ///< MDI. + POPUP, ///< Popup. + OVERLAY, ///< Overlay. + WINDOW, ///< Window. MAX_COUNT }; @@ -350,9 +360,9 @@ enum class WindowEvent enum class TextBoundary : uint32_t { CHARACTER, ///> Only one character is acquired. - WORD, ///> Not supported. - SENTENCE, ///> Not supported. - LINE, ///> Not supported. + WORD, ///> Not supported. + SENTENCE, ///> Not supported. + LINE, ///> Not supported. PARAGRAPH, ///> Not supported. MAX_COUNT }; @@ -434,86 +444,91 @@ enum class ReadingInfoType * @see Dali::Accessibility::Accessible::GetStates * @see Dali::Accessibility::Accessible::GetRoles */ -template < size_t I, typename S > +template class BitSets { - std::array< uint32_t, I > data; + std::array data; - void _set() + void Set() { } - static constexpr bool _accepts() + static constexpr bool Accepts() { return true; } - template < typename T > static constexpr bool _accepts() + template + static constexpr bool Accepts() { - return std::is_enum< T >::value; + return std::is_enum::value; } - template < typename T, typename T2, typename ... ARGS > static constexpr bool _accepts() + template + static constexpr bool Accepts() { - return std::is_enum< T >::value && _accepts< T2, ARGS... >(); + return std::is_enum::value && Accepts(); } - template < typename T, typename ... ARGS > void _set(T t, ARGS ... args) + template + void Set(T t, ARGS... args) { (*this)[t] = true; - _set(args...); + Set(args...); } + public: BitSets() { - for( auto& u : data ) + for(auto& u : data) { u = 0; } } BitSets(const BitSets&) = default; - BitSets(BitSets&&) = default; + BitSets(BitSets&&) = default; - template < typename T, typename ... ARGS, typename std::enable_if< _accepts< T, ARGS... >() >::type * = nullptr >BitSets( T t, ARGS ... args ) + template()>::type* = nullptr> + BitSets(T t, ARGS... args) { - for( auto& u : data ) - u = 0; - _set( t, args... ); + for(auto& u : data) + u = 0; + Set(t, args...); } - explicit BitSets( std::array< uint32_t, I > d ) + explicit BitSets(std::array d) { - for( auto i = 0u; i < I; ++i ) + for(auto i = 0u; i < I; ++i) { data[i] = d[i]; } } - explicit BitSets( std::array< int32_t, I > d ) + explicit BitSets(std::array d) { - for( auto i = 0u; i < I; ++i ) + for(auto i = 0u; i < I; ++i) { - data[i] = static_cast( d[i] ); + data[i] = static_cast(d[i]); } } - BitSets& operator = (const BitSets&) = default; - BitSets& operator = (BitSets&&) = default; + BitSets& operator=(const BitSets&) = default; + BitSets& operator=(BitSets&&) = default; struct reference { - std::array< uint32_t, I >& data; - size_t pos; + std::array& data; + size_t pos; - reference& operator=( reference r ) + reference& operator=(reference r) { - (*this) = static_cast( r ); + (*this) = static_cast(r); return *this; } - reference& operator=( bool v ) + reference& operator=(bool v) { - if( v ) + if(v) { data[pos / 32] |= 1 << (pos & 31); } @@ -526,62 +541,62 @@ public: operator bool() const { - auto i = static_cast( pos ); + auto i = static_cast(pos); return (data[i / 32] & (1 << (i & 31))) != 0; } }; - reference operator[]( S index ) + reference operator[](S index) { - return { data, static_cast( index ) }; + return {data, static_cast(index)}; } - bool operator[]( S index ) const + bool operator[](S index) const { - auto i = static_cast( index ); - return ( data[i / 32] & ( 1 << (i & 31) ) ) != 0; + auto i = static_cast(index); + return (data[i / 32] & (1 << (i & 31))) != 0; } - std::array< uint32_t, I > GetRawData() const + std::array GetRawData() const { return data; } - BitSets operator|( BitSets b ) const + BitSets operator|(BitSets b) const { BitSets r; - for( auto i = 0u; i < I; ++i ) + for(auto i = 0u; i < I; ++i) { r.data[i] = data[i] | b.data[i]; } return r; } - BitSets operator^( BitSets b ) const + BitSets operator^(BitSets b) const { BitSets r; - for( auto i = 0u; i < I; ++i ) + for(auto i = 0u; i < I; ++i) { r.data[i] = data[i] ^ b.data[i]; } return r; } - BitSets operator&( BitSets b ) const + BitSets operator&(BitSets b) const { BitSets r; - for( auto i = 0u; i < I; ++i ) + for(auto i = 0u; i < I; ++i) { r.data[i] = data[i] & b.data[i]; } return r; } - bool operator==( BitSets b ) const + bool operator==(BitSets b) const { - for( auto i = 0u; i < I; ++i ) + for(auto i = 0u; i < I; ++i) { - if( data[i] != b.data[i] ) + if(data[i] != b.data[i]) { return false; } @@ -596,9 +611,9 @@ public: explicit operator bool() const { - for( auto& u : data ) + for(auto& u : data) { - if( u ) + if(u) { return true; } @@ -613,8 +628,8 @@ public: }; using ReadingInfoTypes = BitSets<1, ReadingInfoType>; -using States = BitSets< 2, State >; -using Attributes = std::unordered_map< std::string, std::string >; +using States = BitSets<2, State>; +using Attributes = std::unordered_map; /** * @brief Class representing unique object address on accessibility bus @@ -625,7 +640,7 @@ class DALI_ADAPTOR_API Address public: Address() = default; - Address( std::string bus, std::string path ) + Address(std::string bus, std::string path) : mBus(std::move(bus)), mPath(std::move(path)) { @@ -648,12 +663,12 @@ public: return mPath; } - bool operator == ( const Address& a ) const + bool operator==(const Address& a) const { return mBus == a.mBus && mPath == a.mPath; } - bool operator != ( const Address& a ) const + bool operator!=(const Address& a) const { return !(*this == a); } @@ -692,7 +707,7 @@ struct DALI_ADAPTOR_API Point Point() = default; - Point( int x, int y ) + Point(int x, int y) : x(x), y(y) { @@ -713,7 +728,7 @@ struct DALI_ADAPTOR_API Point */ struct DALI_ADAPTOR_API Size { - int width = 0; + int width = 0; int height = 0; Size() = default; @@ -724,12 +739,12 @@ struct DALI_ADAPTOR_API Size { } - bool operator==( Size p ) const + bool operator==(Size p) const { return width == p.width && height == p.height; } - bool operator!=( Size p ) const + bool operator!=(Size p) const { return !(*this == p); } @@ -738,12 +753,12 @@ struct DALI_ADAPTOR_API Size /** * @brief Helper class used to store data related with Accessibility::Text interface * @see Dali::Accessibility::Text::GetTextAtOffset - * @see Dali::Accessibility::Text::GetSelection + * @see Dali::Accessibility::Text::GetRangeOfSelection */ struct DALI_ADAPTOR_API Range { - int32_t startOffset = 0; - int32_t endOffset = 0; + int32_t startOffset = 0; + int32_t endOffset = 0; std::string content; Range() = default; @@ -785,13 +800,13 @@ struct DALI_ADAPTOR_API GestureInfo { } - Gesture type{}; - int32_t xBeg{}; - int32_t xEnd{}; - int32_t yBeg{}; - int32_t yEnd{}; + Gesture type{}; + int32_t xBeg{}; + int32_t xEnd{}; + int32_t yBeg{}; + int32_t yEnd{}; GestureState state{}; - uint32_t eventTime{}; + uint32_t eventTime{}; }; /** @@ -804,14 +819,14 @@ struct DALI_ADAPTOR_API GestureInfo */ struct DALI_ADAPTOR_API Relation { -Relation(RelationType relationType, std::vector
targets) -: relationType(relationType), - targets(targets) -{ -} + Relation(RelationType relationType, std::vector
targets) + : relationType(relationType), + targets(targets) + { + } -RelationType relationType; -std::vector
targets; + RelationType relationType; + std::vector
targets; }; } // namespace Accessibility