#include "FUi_ResourceManager.h"
#include "FUi_UiTouchEvent.h"
#include "FUi_TouchTapGestureDetector.h"
-#include "FUi_AccessibilityContainer.h"
-#include "FUi_AccessibilityElement.h"
#include "FUiCtrl_SplitPanel.h"
#include "FUiCtrl_SplitPanelPresenter.h"
, __pSplitPanelEvent(null)
, __dividerTapCount(0)
, __isFocusModeEnabled(false)
- , __pAccessibilityElement(null)
, __pDividerVisualElement(null)
{
for (int i=0; i < _SPLIT_PANEL_DIVIDER_STATE; i++)
pSplitPanel->SetBackgroundColor(Color(0,0,0,0));
- if (pSplitPanel->GetAccessibilityContainer())
- {
- pSplitPanel->GetAccessibilityContainer()->Activate(true);
- }
-
return pSplitPanel;
CATCH:
__pTapGesture = null;
}
- if (__pAccessibilityElement)
- {
- __pAccessibilityElement->Activate(false);
- __pAccessibilityElement = null;
- }
-
if (__pDividerVisualElement)
{
GetVisualElement()->DetachChild(*__pDividerVisualElement);
return __dividerTapCount;
}
-result
-_SplitPanel::OnAttachedToMainTree(void)
-{
- String hintText = L"";
- FloatRectangle dividerRect(0.0f, 0.0f, 0.0f, 0.0f);
- _AccessibilityContainer* pContainer = null;
-
- if (likely(!(_AccessibilityManager::IsActivated())))
- {
- return E_SUCCESS;
- }
-
- pContainer = GetAccessibilityContainer();
-
- if (pContainer)
- {
- if (__pDividerVisualElement)
- {
- dividerRect = __pSplitPanelPresenter->GetDividerRectangle();
-
- if (GetDividerStyle() == SPLIT_PANEL_DIVIDER_STYLE_FIXED)
- {
- hintText = String(L"Drag scroll Fixed");
- }
- else
- {
- hintText = String(L"Drag scroll, double tap and move to adjust split area");
- }
-
- __pAccessibilityElement = new (std::nothrow) _AccessibilityElement(true);
- SysTryReturn(NID_UI_CTRL, __pAccessibilityElement, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
-
- __pAccessibilityElement->SetBounds(_CoordinateSystemUtils::ConvertToInteger(dividerRect));
- __pAccessibilityElement->SetTrait(ACCESSIBILITY_TRAITS_NONE);
- __pAccessibilityElement->SetHint(hintText);
- __pAccessibilityElement->SetLabel(L"");
- __pAccessibilityElement->SetName(L"SplitPanelDivider");
-
- pContainer->AddElement(*__pAccessibilityElement);
- pContainer->AddListener(*this);
- }
- }
-
- return E_SUCCESS;
-}
-
VisualElement*
_SplitPanel::GetDividerVisualElement(void)
{
if (__pDividerVisualElement)
{
__pDividerVisualElement->SetBounds(bounds);
-
- if (likely(_AccessibilityManager::IsActivated()) && __pAccessibilityElement)
- {
- __pAccessibilityElement->SetBounds(_CoordinateSystemUtils::ConvertToInteger(bounds));
- }
}
return;
}
-bool
-_SplitPanel::OnAccessibilityValueIncreased(const _AccessibilityContainer& control, const _AccessibilityElement& element)
-{
- SetDividerPosition(GetDividerPosition() + ACCESSIBILITY_DIVIDER_POSITION_OFFSET);
-
- Invalidate();
- return true;
-}
-
-bool
-_SplitPanel::OnAccessibilityValueDecreased(const _AccessibilityContainer& control, const _AccessibilityElement& element)
-{
-
- SetDividerPosition(GetDividerPosition() - ACCESSIBILITY_DIVIDER_POSITION_OFFSET);
-
- Invalidate();
- return true;
-}
-
}}} // Tizen::Ui::Controls
#include "FUiCtrl_SplitPanelPresenter.h"
#include "FUi_ITouchTapGestureEventListener.h"
#include "FUiAnim_VisualElement.h"
-#include "FUi_IAccessibilityListener.h"
-
-namespace Tizen { namespace Ui
-{
- class _AccessibilityElement;
-}} // Tizen::Ui
namespace Tizen { namespace Ui { namespace Controls
{
, virtual public Tizen::Ui::_IUiEventListener
, virtual public Tizen::Ui::_IUiEventPreviewer
, virtual public Tizen::Ui::_ITouchGestureEventListener
- , public Tizen::Ui::_IAccessibilityListener
{
public:
virtual ~_SplitPanel(void);
virtual bool OnTapGestureDetected(_TouchTapGestureDetector& gesture);
virtual bool OnTapGestureCanceled(_TouchTapGestureDetector& gesture);
- // accessibility listener
- virtual bool OnAccessibilityFocusMovedNext(const Tizen::Ui::_AccessibilityContainer& control, const Tizen::Ui::_AccessibilityElement& element){return true;}
- virtual bool OnAccessibilityFocusMovedPrevious(const Tizen::Ui::_AccessibilityContainer& control, const Tizen::Ui::_AccessibilityElement& element){return true;}
- virtual bool OnAccessibilityReadingElement(const Tizen::Ui::_AccessibilityContainer& control, const Tizen::Ui::_AccessibilityElement& element){return true;}
- virtual bool OnAccessibilityReadElement(const Tizen::Ui::_AccessibilityContainer& control, const Tizen::Ui::_AccessibilityElement& element){return true;}
- virtual bool OnAccessibilityFocusIn(const Tizen::Ui::_AccessibilityContainer& control, const Tizen::Ui::_AccessibilityElement& element){return true;}
- virtual bool OnAccessibilityFocusOut(const Tizen::Ui::_AccessibilityContainer& control, const Tizen::Ui::_AccessibilityElement& element){return true;}
- virtual bool OnAccessibilityActionPerformed(const Tizen::Ui::_AccessibilityContainer& control, const Tizen::Ui::_AccessibilityElement& element){return true;}
- virtual bool OnAccessibilityValueIncreased(const Tizen::Ui::_AccessibilityContainer& control, const Tizen::Ui::_AccessibilityElement& element);
- virtual bool OnAccessibilityValueDecreased(const Tizen::Ui::_AccessibilityContainer& control, const Tizen::Ui::_AccessibilityElement& element);
-
//key listners
virtual bool OnKeyPressed(const _Control& source, const _KeyInfo& keyInfo);
virtual bool OnKeyReleased(const _Control& source, const _KeyInfo& keyInfo);
void SetTapCount(int count);
int GetTapCount(void) const;
- result OnAttachedToMainTree(void);
-
Tizen::Ui::Animations::VisualElement* GetDividerVisualElement(void);
void SetDividerVisualElementBounds(Tizen::Graphics::FloatRectangle& bounds);
_SplitPanel& operator =(const _SplitPanel& rhs);
private:
- static const float ACCESSIBILITY_DIVIDER_POSITION_OFFSET = 5.0f;
-
_SplitPanelPresenter* __pSplitPanelPresenter;
_TouchTapGestureDetector* __pTapGesture;
int __dividerTapCount;
bool __isFocusModeEnabled;
- Tizen::Ui::_AccessibilityElement* __pAccessibilityElement;
-
Tizen::Ui::Animations::VisualElement* __pDividerVisualElement;
}; // _SplitPanel