N_SE-45614
authorAbhismita Ghosh <g.abhismita@samsung.com>
Thu, 11 Jul 2013 04:15:17 +0000 (13:15 +0900)
committerAbhismita Ghosh <g.abhismita@samsung.com>
Thu, 11 Jul 2013 04:15:17 +0000 (13:15 +0900)
Change-Id: Ie3c7254a2a022faffc88498eba34068dcbe36512

src/VpVideoPlayerForm.cpp

index 35d849f..5ada52a 100644 (file)
@@ -126,6 +126,14 @@ VideoPlayerForm::Initialize(void)
        AppLogDebug("Initialize");
 
        Construct(L"IDL_MAIN_FORM");
+       AccessibilityElement* pAccessibilityElement = new AccessibilityElement();
+       pAccessibilityElement->Construct(GetBounds(), L"IDL_MAIN_FORM");
+
+       AccessibilityContainer* pContainer = GetAccessibilityContainer();
+       if (pContainer != null)
+       {
+               pContainer->AddElement(*pAccessibilityElement);
+       }
 }
 
 result
@@ -135,6 +143,8 @@ VideoPlayerForm::SetScreenMode(const ScreenMode mode, bool destroyOverlay)
 
        Rectangle clientRect = GetClientAreaBounds();
 
+       AccessibilityContainer* pContainer = null;
+
        RecordingRotation recRotation = RECORDING_ROTATION_NONE;
        VideoFrameExtractor extractor;
        r = extractor.Construct(__pVideoPlayerPresentationModel->GetMediaPathName(), MEDIA_PIXEL_FORMAT_RGB565LE);
@@ -193,6 +203,15 @@ VideoPlayerForm::SetScreenMode(const ScreenMode mode, bool destroyOverlay)
                                TryCatch(r == E_SUCCESS, , "AddControl(__pOverlayPanel) failed:%s", GetErrorMessage(r));
 
                                __pOverlayPanel->AddTouchEventListener(*this);
+
+                               AccessibilityElement* pAccessibilityElement = new AccessibilityElement();
+                               r = pAccessibilityElement->Construct(GetBounds(), L"Overlay Panel");
+
+                               pContainer = __pOverlayPanel->GetAccessibilityContainer();
+                               if (pContainer != null)
+                               {
+                                       pContainer->AddElement(*pAccessibilityElement);
+                               }
                        }
                        else
                        {
@@ -229,6 +248,15 @@ VideoPlayerForm::SetScreenMode(const ScreenMode mode, bool destroyOverlay)
                                TryCatch(r == E_SUCCESS, , "AddControl(__pOverlayPanel) failed:%s", GetErrorMessage(r));
 
                                __pOverlayPanel->AddTouchEventListener(*this);
+
+                               AccessibilityElement* pAccessibilityElement = new AccessibilityElement();
+                               r = pAccessibilityElement->Construct(GetBounds(), L"Overlay Panel");
+
+                               pContainer = __pOverlayPanel->GetAccessibilityContainer();
+                               if (pContainer != null)
+                               {
+                                       pContainer->AddElement(*pAccessibilityElement);
+                               }
                        }
                        else
                        {
@@ -295,6 +323,15 @@ VideoPlayerForm::SetScreenMode(const ScreenMode mode, bool destroyOverlay)
                                TryCatch(r == E_SUCCESS, , "AddControl(__pOverlayPanel) failed:%s", GetErrorMessage(r));
 
                                __pOverlayPanel->AddTouchEventListener(*this);
+
+                               AccessibilityElement* pAccessibilityElement = new AccessibilityElement();
+                               r = pAccessibilityElement->Construct(GetBounds(), L"Overlay Panel");
+
+                               pContainer = __pOverlayPanel->GetAccessibilityContainer();
+                               if (pContainer != null)
+                               {
+                                       pContainer->AddElement(*pAccessibilityElement);
+                               }
                        }
                        else
                        {
@@ -313,8 +350,12 @@ VideoPlayerForm::SetScreenMode(const ScreenMode mode, bool destroyOverlay)
        return r;
 
 CATCH:
-       RemoveControl(__pOverlayPanel);
-       __pOverlayPanel = null;
+       if (__pOverlayPanel != null)
+       {
+               RemoveControl(__pOverlayPanel);
+               __pOverlayPanel = null;
+       }
+
        __screenMode = SCREEN_MODE_NORMAL;
 
        return r;
@@ -510,13 +551,20 @@ VideoPlayerForm::OnTerminating(void)
 {
        AppLogDebug("OnTerminating");
 
+       AccessibilityContainer* pContainer = null;
+
        DeleteTimer();
        DestroyPresentationModelInstance();
 
        __pVideoPlayerPresentationModel = null;
 
-       RemoveControl(__pOverlayPanel);
-       __pOverlayPanel = null;
+       if (__pOverlayPanel != null)
+       {
+               pContainer = __pOverlayPanel->GetAccessibilityContainer();
+               pContainer->RemoveAllElements();
+               RemoveControl(__pOverlayPanel);
+               __pOverlayPanel = null;
+       }
 
        delete __pSoundPathPopup;
        __pSoundPathPopup = null;
@@ -524,6 +572,9 @@ VideoPlayerForm::OnTerminating(void)
        delete __pShareContextMenu;
        __pShareContextMenu = null;
 
+       pContainer = GetAccessibilityContainer();
+       pContainer->RemoveAllElements();
+
        return E_SUCCESS;
 }
 
@@ -1467,6 +1518,10 @@ VideoPlayerForm::OnOrientationChanged(const Control& source, OrientationStatus o
 {
        AppLogDebug("OnOrientationChanged");
 
+       AccessibilityContainer* pContainer = GetAccessibilityContainer();
+       AccessibilityElement* pAccessibilityElement = pContainer->GetElement(L"IDL_MAIN_FORM");
+       pAccessibilityElement->SetBounds(GetBounds());
+
        SetScreenMode(__screenMode, false);
 
        switch (orientationStatus)