void SetFrameEnabled(bool enabled);
+ void SendAppControlResult(const Tizen::App::AppCtrlResult appControlResult,
+ const Tizen::Base::Collection::IMap* pExtraData);
+
private:
RequestId __requestId;
Tizen::Base::String __operationId;
extern const wchar_t* APPCONTROL_KEY_TYPE;
extern const wchar_t* APPCONTROL_KEY_PATH;
+extern const wchar_t* APPCONTROL_KEY_SELECTED;
extern const wchar_t* APPCONTROL_KEY_INDEX;
extern const wchar_t* APPCONTROL_KEY_SELECTION_MODE;
extern const wchar_t* APPCONTROL_KEY_SOCIAL_ITEM_TYPE;
, __pRectangleBitmap(null)
, __pointLocation(OUTSIDE_CROPBOX)
, __pPresentationModel(null)
+ , __statusValue(-1)
+ , __formHeight(0)
+ , __formWidth(0)
{
}
switch(actionId)
{
case IDA_BUTTON_CANCEL:
- pSceneManager->GoBackward(BackwardSceneTransition());
- break;
+ {
+ ImageViewerApp* pApp = dynamic_cast<ImageViewerApp*>(UiApp::GetInstance());
+
+ if (pApp->GetAppControlOperationId() == APPCONTROL_OPERATION_ID_IMAGE_CROP)
+ {
+ if (pApp != null)
+ {
+ pApp->SendAppControlResult(APP_CTRL_RESULT_CANCELED, null);
+ pApp->Terminate();
+ }
+ }
+ else
+ {
+ pSceneManager->GoBackward(BackwardSceneTransition());
+ }
+ }
+ break;
+
case IDA_BUTTON_SAVE:
{
if (__cropMode == APPCONTROL_DATA_AUTO)
}
ArrayList* pList = new (std::nothrow) ArrayList(SingleObjectDeleter);
pList->Add(new (std::nothrow) String(destFilePath));
- pSceneManager->GoBackward(BackwardSceneTransition(), pList);
+ ImageViewerApp* pApp = dynamic_cast<ImageViewerApp*>(UiApp::GetInstance());
+
+ if (pApp->GetAppControlOperationId() == APPCONTROL_OPERATION_ID_IMAGE_CROP)
+ {
+ HashMap* pMap = new (std::nothrow) HashMap(SingleObjectDeleter);
+ pMap->Construct();
+ pMap->Add(new (std::nothrow) String(APPCONTROL_KEY_SELECTED), pList);
+
+ if (pApp != null)
+ {
+ pApp->SendAppControlResult(APP_CTRL_RESULT_SUCCEEDED, pMap);
+ pApp->Terminate();
+ }
+ }
+ else
+ {
+ pSceneManager->GoBackward(BackwardSceneTransition(), pList);
+ }
}
- else if(__cropMode == APPCONTROL_DATA_FIT_TO_SCREEN)
+ else if (__cropMode == APPCONTROL_DATA_FIT_TO_SCREEN)
{
ImageBuffer* pCropBuffer = null;
result r = E_SUCCESS;
pCropBuffer = __imageBuffer.CropN(((__cropBox.x - __imageBox.x) * __imageWidth) / __imageBox.width, ((__cropBox.y - __imageBox.y) * __imageHeight) / __imageBox.height,
(__cropBox.width * __imageWidth) / __imageBox.width, (__cropBox.height * __imageHeight) / __imageBox.height);
+
if (__statusValue == SET_AT_TYPE_HOME_SCREEN_WALLPAPER)
{
String destPath = App::GetInstance()->GetAppDataPath() + TEMP_FILE_PATH_HOME_SCREEN_WALLPAPER;
delete pContact;
delete pAddressbook;
delete pCropBuffer;
+
ArrayList* pList = new (std::nothrow) ArrayList(SingleObjectDeleter);
pList->Add(new (std::nothrow) String(destFilePath));
pSceneManager->GoBackward(BackwardSceneTransition(), pList);
+
AppLogDebug("EXIT(%s)1", GetErrorMessage(GetLastResult()));
return;
}
__formHeight = Form::GetBounds().height;
__formWidth = Form::GetBounds().width;
}
- else if(GetOrientationStatus() == ORIENTATION_STATUS_LANDSCAPE || GetOrientationStatus() == ORIENTATION_STATUS_LANDSCAPE_REVERSE)
+ else if (GetOrientationStatus() == ORIENTATION_STATUS_LANDSCAPE || GetOrientationStatus() == ORIENTATION_STATUS_LANDSCAPE_REVERSE)
{
__formHeight = Form::GetBounds().width;
__formWidth = Form::GetBounds().height;
pMainFrame->SetEnabled(enabled);
}
}
+
+void
+ImageViewerApp::SendAppControlResult(const AppCtrlResult appControlResult, const IMap* pExtraData)
+{
+ AppLogDebug("ENTER");
+ AppControlProviderManager* pAppManager = AppControlProviderManager::GetInstance();
+ pAppManager->SendAppControlResult(__requestId, appControlResult, pExtraData);
+ AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
+}
__pLabel = dynamic_cast<Label*>(GetControl(L"IDC_LABEL_INFO"));
- if(__pLabel == null)
+ if (__pLabel == null)
{
return E_FAILURE;
}
AppLogDebug("ImageViewerForm::DeleteItem ENTER index(%d)", index);
int curIndex = index;
- if(__shuffle == true && __pShuffledList != null)
+ if (__shuffle == true && __pShuffledList != null)
{
curIndex = __pShuffledList[index];
}
int index;
- if(__shuffle == true)
+ if (__shuffle == true)
{
- if(__pShuffelTimer == null)
+ if (__pShuffelTimer == null)
{
__pShuffelTimer = new (std::nothrow) Timer();
__pShuffelTimer->Construct(*this);
__pTimer = null;
}
- if(__pShuffelTimer)
+ if (__pShuffelTimer)
{
__pShuffelTimer->Cancel();
delete __pShuffelTimer;
__pContextMenuMore = null;
}
- if(__pShuffledList != null)
+ if (__pShuffledList != null)
{
free(__pShuffledList);
__pShuffledList = null;
__pGallery->UpdateGallery();
__pGallery->SetCurrentItemIndex(count);
__pPresentationModel->RequestImage(filePath);
+ ShowPanelDetail(__detail);
}
if (__pGallery->GetCurrentItemIndex() < 0)
{
AppLog("ImageViewerForm::OnTimerExpired");
- if(timer.Equals(*__pShuffelTimer) == true)
+ if (timer.Equals(*__pShuffelTimer) == true)
{
AppLog("OnTimerExpired __pShuffelTimer");
int curItemIndex = __pGallery->GetCurrentItemIndex();
ImageViewerForm::CreateShuffledList(int count)
{
AppLogDebug("ENTER");
- if(__pShuffledList == null)
+ if (__pShuffledList == null)
{
__pShuffledList = new (std::nothrow) int[count];
for(int i = 0; i < count; ++i)
const wchar_t* APPCONTROL_KEY_TYPE = L"http://tizen.org/appcontrol/data/type";
const wchar_t* APPCONTROL_KEY_PATH = L"http://tizen.org/appcontrol/data/path";
+const wchar_t* APPCONTROL_KEY_SELECTED = L"http://tizen.org/appcontrol/data/selected";
const wchar_t* APPCONTROL_KEY_INDEX = L"http://tizen.org/appcontrol/data/index";
const wchar_t* APPCONTROL_KEY_SELECTION_MODE = L"http://tizen.org/appcontrol/data/selection_mode";
const wchar_t* APPCONTROL_KEY_SOCIAL_ITEM_TYPE = L"http://tizen.org/appcontrol/data/social/item_type";