NABI issue 40682
authorravi.n2 <ravi.n2@samsung.com>
Fri, 7 Jun 2013 13:05:11 +0000 (18:35 +0530)
committerravi.n2 <ravi.n2@samsung.com>
Fri, 7 Jun 2013 13:05:11 +0000 (18:35 +0530)
Change-Id: I00150ff9a42070ee2bac40ff8e3d8a449f7caea9

inc/CmCameraApp.h
src/CmCameraApp.cpp
src/CmCameraForm.cpp
src/CmCameraPresentationModel.cpp

index 97aef99..9680385 100644 (file)
@@ -71,6 +71,7 @@ public:
        virtual void OnBatteryLevelChanged(Tizen::System::BatteryLevel batteryLevel);
        virtual void OnChargingStateChanged(bool charging);
        virtual void OnLowMemory (void);
+       bool GetAppControlSwitch(void);
 
 private:
        void OnRequestAppControlTest(void);
index 95c6ef3..f967926 100644 (file)
@@ -356,6 +356,7 @@ CameraApp::OnAppControlRequestReceived(RequestId reqId, const Tizen::Base::Strin
                                                                                        const Tizen::Base::String* pMimeType, const Tizen::Base::Collection::IMap* pExtraData)
 {
        AppLogDebug("ENTER");
+       result r = E_SUCCESS;
        __operationId = operationId;
        AppLogDebug("operationId : %ls", operationId.GetPointer());
 
@@ -373,7 +374,6 @@ CameraApp::OnAppControlRequestReceived(RequestId reqId, const Tizen::Base::Strin
 
        if (pExtraData != null)
        {
-               result r = E_SUCCESS;
                HashMap* pArguments = new (std::nothrow) HashMap(SingleObjectDeleter);
 
                r = pArguments->Construct();
@@ -409,8 +409,17 @@ CameraApp::OnAppControlRequestReceived(RequestId reqId, const Tizen::Base::Strin
        }
        else 
        {
+               AppLogDebug("No switch parameter specified");
                if (operationId.CompareTo(APPCONTROL_OPERATION_ID_CREATECONTENT) == 0)
                {
+                       HashMap* pArguments = new (std::nothrow) HashMap(SingleObjectDeleter);
+
+                       pArguments->Construct();
+                       pArguments->Add(new (std::nothrow) String(ALLOW_SWITCH), new (std::nothrow) String(ALLOW_SWITCH_TRUE));
+                       __pArguments = pArguments;
+
+                       AppLogDebug("HashMap::Construct() result[%s]", GetErrorMessage(r));
+
                        OnRequestAppControlTest();
                }
                else
@@ -499,20 +508,11 @@ result
 CameraApp::OnRequestAppControl(void)
 {
        AppLogDebug("ENTER");
-       const String* pKeyValue = static_cast<const String*>(GetAppControlArguments()->GetValue(String(ALLOW_SWITCH)));
        result r = E_SUCCESS;
 
-       if (pKeyValue == null)
-       {
-               AppLogDebug("To launch AppControl, the pKeyValue should be input.");
-               return E_FAILURE;
-       }
-       else
+       if (GetMimeType() == MIME_TYPE_IMAGE_JPG || GetMimeType() == MIME_TYPE_IMAGE_3GP)
        {
-               AppLogDebug("allow_switch:%ls", pKeyValue->GetPointer());
-               if (GetMimeType() == MIME_TYPE_IMAGE_JPG || GetMimeType() == MIME_TYPE_IMAGE_3GP)
-               {
-                       __appLaunchType = APP_LAUNCH_TYPE_REQUESET;
+               __appLaunchType = APP_LAUNCH_TYPE_REQUESET;
 
                        r = CameraPresentationModel::GetInstance()->SetValue(CURRENT_MODE, CameraPresentationModel::CAMERA_MODE_SNAPSHOT);
                        AppLogDebug("SetValue Reg Fail[%s]", GetErrorMessage(r));
@@ -541,7 +541,7 @@ CameraApp::OnRequestAppControl(void)
                        return E_SUCCESS;
                }
        }
-}
+
 void
 CameraApp::OnLowMemory (void)
 {
@@ -549,3 +549,23 @@ CameraApp::OnLowMemory (void)
        AppLogDebug("Exit");
 }
 
+bool
+CameraApp::GetAppControlSwitch(void)
+{
+       AppLogDebug("Enter");
+       const String* pKeyValue;
+       bool switchEnabled = false;
+
+       pKeyValue = static_cast<const String*>(GetAppControlArguments()->GetValue(String(ALLOW_SWITCH)));
+
+       if (pKeyValue != null)
+       {
+               if (pKeyValue->CompareTo(ALLOW_SWITCH_TRUE) == 0)
+               {
+                       switchEnabled = true;
+               }
+       }
+
+       return switchEnabled;
+       AppLogDebug("Exit");
+}
index cf2489a..03c9721 100644 (file)
@@ -9995,6 +9995,7 @@ CameraForm::DrawScreenOverlayHelp(void)
        result r = E_SUCCESS;
        int overlayHelpEnable = 0;
        String ovelayHelpStr = L"";
+       bool checkAppControlSwitch = false;
        //AppResource* pAppResource = null;
 
        TryCatch(__pHelpGoToGallery != null, r = E_FAILURE, "__pHelpGoToGallery is null");
@@ -10051,13 +10052,26 @@ CameraForm::DrawScreenOverlayHelp(void)
                __pHelpQuickSettingText->SetTextConfig(FONT_SIZE_SCREEN_OVERLAY_HELP, LABEL_TEXT_STYLE_NORMAL);
                __pHelpQuickSettingText->SetShowState(true);
 
-               __pHelpRecordVideo->SetShowState(true);
-               //pAppResource->GetString(L"IDS_HELP_CAPTURE_IMAGE", ovelayHelpStr);
-               ovelayHelpStr = L"Capture image";
-               __pHelpRecordVideoText->SetText(ovelayHelpStr);
-               __pHelpRecordVideoText->SetTextColor(COLOR_SCREEN_OVERLAY_HELP_TEXT);
-               __pHelpRecordVideoText->SetTextConfig(FONT_SIZE_SCREEN_OVERLAY_HELP, LABEL_TEXT_STYLE_NORMAL);
-               __pHelpRecordVideoText->SetShowState(true);
+
+               if (GetAppLaunchType() == APP_LAUNCH_TYPE_REQUESET)
+               {
+                       checkAppControlSwitch = (static_cast<CameraApp*>(UiApp::GetInstance()))->GetAppControlSwitch();
+               }
+               else
+               {
+                       checkAppControlSwitch = true;
+               }
+
+               if (checkAppControlSwitch)
+               {
+                       __pHelpRecordVideo->SetShowState(true);
+                       //pAppResource->GetString(L"IDS_HELP_CAPTURE_IMAGE", ovelayHelpStr);
+                       ovelayHelpStr = L"Capture image";
+                       __pHelpRecordVideoText->SetText(ovelayHelpStr);
+                       __pHelpRecordVideoText->SetTextColor(COLOR_SCREEN_OVERLAY_HELP_TEXT);
+                       __pHelpRecordVideoText->SetTextConfig(FONT_SIZE_SCREEN_OVERLAY_HELP, LABEL_TEXT_STYLE_NORMAL);
+                       __pHelpRecordVideoText->SetShowState(true);
+               }
 
                __pHelpShutter->SetShowState(true);
                //pAppResource->GetString(L"IDS_HELP_SHUTTER", ovelayHelpStr);
index c2297d9..ba15ff1 100644 (file)
@@ -3255,6 +3255,8 @@ result
 CameraPresentationModel::GetValue(const Tizen::Base::String& entryName, int& value) const
 {
        AppLogDebug("ENTER");
+       AppLogDebug("entry name is %ls",entryName.GetPointer());
+       AppLogDebug("entry value is %d",value);
        result r = E_SUCCESS;
        int mode = 0;
        String strSectionName = SECTION_CAMERA;