Merge screen reader sources from devel/osp/master
authorBumseung Cho <bumseung.cho@samsung.com>
Tue, 21 May 2013 09:02:54 +0000 (18:02 +0900)
committerBumseung Cho <bumseung.cho@samsung.com>
Tue, 21 May 2013 09:03:04 +0000 (18:03 +0900)
Change-Id: I7f857e13bb7c56cf9e28b74e9ea1d909a69088c9
Signed-off-by: Bumseung Cho <bumseung.cho@samsung.com>
res/common/usr/share/osp/bitmaps/480x800/TTS_focus.#.png [changed mode: 0644->0755]
res/common/usr/share/osp/bitmaps/720x1280/TTS_focus.#.png [changed mode: 0644->0755]
src/ui/FUi_AccessibilityElement.cpp
src/ui/FUi_AccessibilityElementImpl.cpp
src/ui/FUi_AccessibilityManager.cpp
src/ui/FUi_AccessibilitySystemSettingLoader.cpp
src/ui/controls/FUiCtrl_Toolbar.cpp
src/ui/inc/FUiCtrl_Toolbar.h
src/ui/inc/FUi_AccessibilityElement.h
src/ui/inc/FUi_AccessibilityElementImpl.h
src/ui/inc/FUi_ResourceConfigMacro.h

old mode 100644 (file)
new mode 100755 (executable)
index 575f34c..fbc2569
Binary files a/res/common/usr/share/osp/bitmaps/480x800/TTS_focus.#.png and b/res/common/usr/share/osp/bitmaps/480x800/TTS_focus.#.png differ
old mode 100644 (file)
new mode 100755 (executable)
index 575f34c..fbc2569
Binary files a/res/common/usr/share/osp/bitmaps/720x1280/TTS_focus.#.png and b/res/common/usr/share/osp/bitmaps/720x1280/TTS_focus.#.png differ
index 17e9469..e378062 100644 (file)
@@ -146,13 +146,6 @@ _AccessibilityElement::SetStatus(const String& status)
        __updateContents = true;
 }
 void
-_AccessibilityElement::SetTrait(AccessibilityTraits trait)
-{
-       __trait = trait;
-       __traitString = (_traitString[__trait]);
-       __updateContents = true;
-}
-void
 _AccessibilityElement::SetTrait(const Tizen::Base::String& trait)
 {
        __traitString = trait;
@@ -199,11 +192,6 @@ _AccessibilityElement::GetStatus(void) const
 {
        return __status;
 }
-AccessibilityTraits
-_AccessibilityElement::GetTrait(void) const
-{
-       return __trait;
-}
 String
 _AccessibilityElement::GetTraitString(void) const
 {
index 8033b39..f642822 100644 (file)
@@ -106,12 +106,6 @@ _AccessibilityElementImpl::SetStatus(const Tizen::Base::String& status)
        return __pCore->SetStatus(status);
 }
 void
-_AccessibilityElementImpl::SetTrait(AccessibilityTraits trait)
-{
-       SysTryReturn(NID_UI, __pCore, , E_SYSTEM, "[E_SYSTEM] System Error.");
-       return __pCore->SetTrait(trait);
-}
-void
 _AccessibilityElementImpl::SetTrait(const Tizen::Base::String& trait)
 {
        SysTryReturn(NID_UI, __pCore, , E_SYSTEM, "[E_SYSTEM] System Error.");
@@ -178,12 +172,6 @@ _AccessibilityElementImpl::GetStatus(void) const
        SysTryReturn(NID_UI, __pCore, L"", E_SYSTEM, "[E_SYSTEM] System Error.");
        return __pCore->GetStatus();
 }
-AccessibilityTraits
-_AccessibilityElementImpl::GetTrait(void) const
-{
-       SysTryReturn(NID_UI, __pCore, ACCESSIBILITY_TRAITS_NONE, E_SYSTEM, "[E_SYSTEM] System Error.");
-       return __pCore->GetTrait();
-}
 Tizen::Base::String
 _AccessibilityElementImpl::GetTraitString(void) const
 {
index f7fb09b..86973e8 100644 (file)
@@ -521,6 +521,7 @@ _AccessibilityManager::ShowPopup(const String& content)
        }
 
        pFrame = UiApp::GetInstance()->GetAppFrame()->GetFrame();
+
        if (pFrame != null)
        {
                int accesibilityVisualElementLevel = 3000;
@@ -1861,20 +1862,15 @@ _AccessibilityManager::ProcessGesture(_AccessibilityGestureType type, const Floa
                        }
                        _Control* pControl = null;
                        Point pt((int)point.x, (int)point.y);
-                       _TouchManager* pTouchManager = _TouchManager::GetInstance();
-                       _Control* pCapturedControl = pTouchManager->GetCapturedControl();
-                       if (pCapturedControl)
+                       _Window* pWindow = _ControlManager::GetInstance()->GetTopVisibleWindow();
+                       if (!(pWindow->IsLayoutChangable()))
                        {
-                               if(pCapturedControl->GetAbsoluteBounds().Contains(pt))
-                               {
-                                       pControl = pCapturedControl;
-                               }
+                               Rectangle topWindowAbsBounds = pWindow->GetAbsoluteBounds();
+                               pt.x = pt.x + topWindowAbsBounds.x;
+                               pt.y = pt.y + topWindowAbsBounds.y;
                        }
-                       else
-                       {
-                               pControl = _ControlManager::GetInstance()->GetTopmostTouchedControl(pt);
-                       }
-                       if (pControl == null)
+                       pControl = _ControlManager::GetInstance()->GetTopmostTouchedControl(pt);
+                       if (!(pControl->GetAbsoluteBounds().Contains(pt)))
                        {
                                return false;
                        }
index b9d89bc..29ededf 100644 (file)
@@ -66,7 +66,10 @@ _AccessibilitySystemSettingLoader::IsAccessibilityActivated(void)
 bool
 _AccessibilitySystemSettingLoader::IsScreenReaderActivated(void)
 {
-       return GetEcoreEvasMgr()->GetEcoreEvas()->IsAccessibilityScreenReaderActivated();
+//     return GetEcoreEvasMgr()->GetEcoreEvas()->IsAccessibilityScreenReaderActivated();
+       bool enable = false;
+       _SettingInfoImpl::GetValue(L"http://tizen.org/setting/speech.tts.screen", enable);
+       return enable;
 }
 
 float
index 83ae6be..3657650 100644 (file)
@@ -46,13 +46,42 @@ class FooterItemAccessibilityListener
        : public _IAccessibilityListener
 {
 public:
-       FooterItemAccessibilityListener(void){}
+       FooterItemAccessibilityListener(const Tizen::Ui::Controls::_Toolbar* toolbar)
+       :__pToolbar(null)
+       {
+               __pToolbar = const_cast<Tizen::Ui::Controls::_Toolbar*>(toolbar);
+       }
        virtual ~FooterItemAccessibilityListener(void){}
        virtual bool OnAccessibilityFocusMovedNext(const _AccessibilityContainer& control, const _AccessibilityElement& element){return true;}
        virtual bool OnAccessibilityFocusMovedPrevious(const _AccessibilityContainer& control, const _AccessibilityElement& element){return true;}
        virtual bool OnAccessibilityReadingElement(const _AccessibilityContainer& control, const _AccessibilityElement& element){return true;}
        virtual bool OnAccessibilityReadElement(const _AccessibilityContainer& control, const _AccessibilityElement& element){return true;}
-       virtual bool OnAccessibilityFocusIn(const _AccessibilityContainer& control, const _AccessibilityElement& element){return true;}
+       virtual bool OnAccessibilityFocusIn(const _AccessibilityContainer& control, const _AccessibilityElement& element)
+       {
+               FloatRectangle rect = element.GetAbsoluteBounds();
+               Dimension screen = _ResourceManager::GetInstance()->GetLogicalScreenSizen();
+               int screenW = _ControlManager::GetInstance()->GetOrientation() == _CONTROL_ORIENTATION_PORTRAIT ? screen.width : screen.height;
+               if(rect.x < 0.0f)
+               {
+                       __pToolbar->GetPresenter()->AdjustItemPositionX(-(rect.x));
+                       __pToolbar->Invalidate(true);
+               }
+               else if(rect.x + rect.width > screenW)
+               {
+                       float adjustX = 0.0f;
+                       if(rect.x + rect.width > screenW)
+                       {
+                               adjustX = -(rect.x + rect.width - screenW);
+                       }
+                       else
+                       {
+                               adjustX = -rect.x;
+                       }
+                       __pToolbar->GetPresenter()->AdjustItemPositionX(adjustX);
+                       __pToolbar->Invalidate(true);
+               }
+               return true;
+       }
        virtual bool OnAccessibilityFocusOut(const _AccessibilityContainer& control, const _AccessibilityElement& element){return true;}
        virtual bool OnAccessibilityValueIncreased(const _AccessibilityContainer& control, const _AccessibilityElement& element){return true;}
        virtual bool OnAccessibilityValueDecreased(const _AccessibilityContainer& control, const _AccessibilityElement& element){return true;}
@@ -61,8 +90,9 @@ public:
                _AccessibilityManager::GetInstance()->RequestAutoReading(_ACCESSIBILITY_AUTO_READING_MODE_FIRST_ITEM_OF_CONTENTS);
                return true;
        }
+private:
+       Tizen::Ui::Controls::_Toolbar* __pToolbar;
 };
-FooterItemAccessibilityListener footerItemAccessibilityListener;
 }
 
 namespace Tizen { namespace Ui { namespace Controls
@@ -92,6 +122,7 @@ _Toolbar::_Toolbar(void)
        , __titleTextArea(FloatRectangle(0.0f, 0.0f, 0.0f, 0.0f))
        , __itemArea(FloatRectangle(0.0f, 0.0f, 0.0f, 0.0f))
        , __pTitleTextElement(null)
+       , __pAccessibilityListener(null)
 {
        _AccessibilityContainer* pContainer = null;
 
@@ -149,6 +180,7 @@ _Toolbar::_Toolbar(void)
                __isButtonBgColorSetByUser[i] = false;
                __isButtonTextColorSetByUser[i] = false;
        }
+       __pAccessibilityListener = new (std::nothrow) FooterItemAccessibilityListener(this);
 }
 
 _Toolbar::~_Toolbar(void)
@@ -234,6 +266,11 @@ _Toolbar::~_Toolbar(void)
                __pTitleTextElement = null;
        }
 
+       if(__pAccessibilityListener)
+       {
+               delete __pAccessibilityListener;
+               __pAccessibilityListener = null;
+       }
        ClearLastResult();
 }
 
@@ -2892,7 +2929,7 @@ _Toolbar::AddAccessibilityElement(_Button* pButton)
                                || style == TOOLBAR_TAB)
                        {
                                pElement->SetHint(L"Double tap to move to contents");
-                               pButton->GetAccessibilityContainer()->AddListener(footerItemAccessibilityListener);
+                               pButton->GetAccessibilityContainer()->AddListener(*__pAccessibilityListener);
                        }
                }
        }
@@ -3106,6 +3143,12 @@ _Toolbar::SetPresenter(const _ToolbarPresenter& toolbarPresenter)
        return E_SUCCESS;
 }
 
+_ToolbarPresenter*
+_Toolbar::GetPresenter(void) const
+{
+       return __pToolbarPresenter;
+}
+
 result
 _Toolbar::ApplyUserGUI(ButtonType buttonType, _Button* pButton)
 {
index 3dee846..5920fc4 100644 (file)
@@ -43,6 +43,7 @@ class _TouchLongPressGestureDetector;
 namespace Tizen { namespace Ui
 {
 class _AccessibilityElement;
+class _IAccessibilityListener;
 }} // Tizen::Ui
 
 namespace Tizen { namespace Ui { namespace Controls
@@ -384,6 +385,8 @@ public:
 
        result SetTransBackButton(bool transparent);
 
+       _ToolbarPresenter* GetPresenter(void) const;
+
 protected:
        result SetPresenter(const _ToolbarPresenter& toolbarPresenter);
 
@@ -505,6 +508,8 @@ private:
 
        Tizen::Ui::_AccessibilityElement* __pTitleTextElement;
 
+       _IAccessibilityListener* __pAccessibilityListener;
+
        static const float SENSITIVE = 0.08f;
 };
 
index fe14fd0..8b02e59 100644 (file)
@@ -55,8 +55,6 @@ public:
        Tizen::Base::String GetHint(void) const;
        void SetStatus(const Tizen::Base::String& guide);
        Tizen::Base::String GetStatus(void) const;
-       void SetTrait(AccessibilityTraits trait);
-       AccessibilityTraits GetTrait(void) const;
        void SetTrait(const Tizen::Base::String& trait);
        Tizen::Base::String GetTraitString(void) const;
        void SetValue(const Tizen::Base::String& value);
index 16ab5fe..b1332e8 100644 (file)
@@ -55,7 +55,6 @@ public:
        void SetLabel(const Tizen::Base::String& label);
        void SetHint(const Tizen::Base::String& hint);
        void SetStatus(const Tizen::Base::String& status);
-       void SetTrait(AccessibilityTraits trait);
        void SetTrait(const Tizen::Base::String& trait);
        void SetValue(const Tizen::Base::String& value);  //variant gogogo
 
@@ -69,7 +68,6 @@ public:
        Tizen::Base::String GetLabel(void) const;
        Tizen::Base::String GetHint(void) const;
        Tizen::Base::String GetStatus(void) const;
-       AccessibilityTraits GetTrait(void) const;
        Tizen::Base::String GetTraitString(void) const;
        Tizen::Base::String GetValue(void) const;  //variant gogogo
 
index 2b8e9d3..1e9b594 100644 (file)
 
 namespace
 {
-const int __BASIC__ = 1;
-const int __ACCESSIBILITY__ = 2;
-const int __BUTTON__ = 3;
-const int __CHECKBUTTON__ = 4;
-const int __COLORPICKER__ = 5;
-const int __CONTEXTMENU__ = 6;
-const int __DATETIMEBAR__ = 7;
-const int __DATETIMEPICKER__ = 8;
-const int __EDIT__ = 9;
-const int __EDITDATE__ = 10;
-const int __EDITTIME__ = 11;
-const int __FASTSCROLL__ = 12;
-const int __FOOTER__ = 13;
-const int __FORM__ = 14;
-const int __GALLERY__ = 15;
-const int __GROUPCONTAINER__ = 16;
-const int __HEADER__ = 17;
-const int __ICONLIST__ = 18;
-const int __INPUTPAD__ = 19;
-const int __LABEL__ = 20;
-const int __LIST__ = 21;
-const int __LISTVIEW__ = 22;
-const int __APPWIDGET__ = 23;
-const int __MESSAGEBOX__ = 24;
-const int __OPTIONMENU__ = 25;
-const int __OVERLAYPANEL__ = 26;
-const int __PANEL__ = 27;
-const int __POPUP__ = 28;
-const int __PROGRESS__ = 29;
-const int __RADIOGROUP__ = 30;
-const int __SCROLL__ = 31;
-const int __SEARCHBAR__ = 32;
-const int __SLIDER__ =33;
-const int __SPLITPANEL__ = 34;
-const int __TABBAR__ = 35;
-const int __TAB__ = 36;
-const int __TABLEVIEW__ = 37;
-const int __TOKENEDIT__ = 38;
-const int __FOCUSUI__ = 39;
+struct TypeDefined
+{
+static const int __BASIC__ = 1;
+static const int __ACCESSIBILITY__ = 2;
+static const int __BUTTON__ = 3;
+static const int __CHECKBUTTON__ = 4;
+static const int __COLORPICKER__ = 5;
+static const int __CONTEXTMENU__ = 6;
+static const int __DATETIMEBAR__ = 7;
+static const int __DATETIMEPICKER__ = 8;
+static const int __EDIT__ = 9;
+static const int __EDITDATE__ = 10;
+static const int __EDITTIME__ = 11;
+static const int __FASTSCROLL__ = 12;
+static const int __FOOTER__ = 13;
+static const int __FORM__ = 14;
+static const int __GALLERY__ = 15;
+static const int __GROUPCONTAINER__ = 16;
+static const int __HEADER__ = 17;
+static const int __ICONLIST__ = 18;
+static const int __INPUTPAD__ = 19;
+static const int __LABEL__ = 20;
+static const int __LIST__ = 21;
+static const int __LISTVIEW__ = 22;
+static const int __APPWIDGET__ = 23;
+static const int __MESSAGEBOX__ = 24;
+static const int __OPTIONMENU__ = 25;
+static const int __OVERLAYPANEL__ = 26;
+static const int __PANEL__ = 27;
+static const int __POPUP__ = 28;
+static const int __PROGRESS__ = 29;
+static const int __RADIOGROUP__ = 30;
+static const int __SCROLL__ = 31;
+static const int __SEARCHBAR__ = 32;
+static const int __SLIDER__ =33;
+static const int __SPLITPANEL__ = 34;
+static const int __TABBAR__ = 35;
+static const int __TAB__ = 36;
+static const int __TABLEVIEW__ = 37;
+static const int __TOKENEDIT__ = 38;
+static const int __FOCUSUI__ = 39;
 
-       struct _TYPE_RESOURCE
+       struct TypeResource
        {
                static const int _COLOR_ = 0x00010000;
                static const int _IMAGE_ = 0x00020000;
@@ -88,6 +90,7 @@ const int __FOCUSUI__ = 39;
                static const int _FIXED_VALUE_ = 0x00050000;
                static const int _ANIMATION_ = 0x00060000;
        };
+};
 }
 
 #define DECLARE_UI_CONFIG(x) \
@@ -275,16 +278,16 @@ const int __FOCUSUI__ = 39;
                                AddConfig(table, mode, GetAPIVersion());\
                                return true;\
                        };\
-                       static const int _VALUE_ = __##x##__ << 24;
+                       static const int _VALUE_ = TypeDefined::__##x##__ << 24;
 
 #define DECLARE_END_UI_CONFIG(X) };}}}
 
-#define DECLARE_COLOR_CONFIG(id,value) static const int id##_COLOR = _VALUE_ + _TYPE_RESOURCE::_COLOR_ + value;
-#define DECLARE_IMAGE_CONFIG(id,value) static const int id##_IMAGE = _VALUE_ + _TYPE_RESOURCE::_IMAGE_ + value;
-#define DECLARE_SHAPE_CONFIG(id,value) static const int id##_SHAPE = _VALUE_ + _TYPE_RESOURCE::_SHAPE_ + value;
-#define DECLARE_DIMENSION_CONFIG(id,value) static const int id##_DIMENSION = _VALUE_ + _TYPE_RESOURCE::_DIMENSION_ + value;
-#define DECLARE_FIXED_VALUE_CONFIG(id,value) static const int id##_FIXED_VALUE = _VALUE_ + _TYPE_RESOURCE::_FIXED_VALUE_ + value;
-#define DECLARE_ANIMATION_CONFIG(id,value) static const int id##_ANIMATION = _VALUE_ + _TYPE_RESOURCE::_ANIMATION_ + value;
+#define DECLARE_COLOR_CONFIG(id,value) static const int id##_COLOR = _VALUE_ + TypeDefined::TypeResource::_COLOR_ + value;
+#define DECLARE_IMAGE_CONFIG(id,value) static const int id##_IMAGE = _VALUE_ + TypeDefined::TypeResource::_IMAGE_ + value;
+#define DECLARE_SHAPE_CONFIG(id,value) static const int id##_SHAPE = _VALUE_ + TypeDefined::TypeResource::_SHAPE_ + value;
+#define DECLARE_DIMENSION_CONFIG(id,value) static const int id##_DIMENSION = _VALUE_ + TypeDefined::TypeResource::_DIMENSION_ + value;
+#define DECLARE_FIXED_VALUE_CONFIG(id,value) static const int id##_FIXED_VALUE = _VALUE_ + TypeDefined::TypeResource::_FIXED_VALUE_ + value;
+#define DECLARE_ANIMATION_CONFIG(id,value) static const int id##_ANIMATION = _VALUE_ + TypeDefined::TypeResource::_ANIMATION_ + value;
 
 
 #define START_UI_CONFIG(control)\