INSIDE_BOTTOM_RIGHT_RECTANGLE,
};
+class ImageViewerPresentationModel;
+
class ImageCropForm
: public Tizen::Ui::Controls::Form
, public::Tizen::Ui::IActionEventListener
{
public:
ImageCropForm(void);
-
~ImageCropForm(void);
bool Initialize(void);
TouchLocation __pointLocation;
Tizen::Graphics::Point __touchStart;
Tizen::Media::ImageFormat __imageFormat;
+ ImageViewerPresentationModel* __pPresentationModel;
};
#endif /* _IV_IMAGE_CROP_H_ */
class ImageViewerPresentationModel;
class SettingPresentationModel;
-
class ImageViewerForm
: public BaseForm
, public Tizen::App::IAppControlResponseListener
extern const wchar_t* APPCONTROL_OPERATION_ID_COMPOSE;
extern const wchar_t* APPCONTROL_OPERATION_ID_MAIN;
extern const wchar_t* APPCONTROL_OPERATION_ID_CONFIGURE;
+extern const wchar_t* APPCONTROL_OPERATION_ID_IMAGE_CROP;
extern const wchar_t* APPCONTROL_KEY_TYPE;
extern const wchar_t* APPCONTROL_KEY_PATH;
, __pCanvas(null)
, __pCurrentBitmap(null)
, __pRectangleBitmap(null)
+ , __pointLocation(OUTSIDE_CROPBOX)
+ , __pPresentationModel(null)
{
- __pointLocation = OUTSIDE_CROPBOX;
}
ImageCropForm::~ImageCropForm(void)
if (__pCanvas != null)
{
delete __pCanvas;
- __pCanvas = null;
}
}
{
Form::Construct(IDL_FORM_IMAGE_CROP);
Form::SetFormStyle(FORM_STYLE_NORMAL | FORM_STYLE_INDICATOR);
+
+ __pPresentationModel = ImageViewerPresentationModel::GetInstance();
+
return true;
}
void
ImageCropForm::OnSceneActivatedN(const SceneId& previousSceneId, const SceneId& currentSceneId, IList* pArgs)
{
- AppLogDebug("ENTER");
- String* pFilePath = null;
+ AppLogDebug("ENTER pArgs(%x)", pArgs);
+ String filePath;
if (pArgs != null)
{
- pFilePath = static_cast<String*>(pArgs->GetAt(0));
+ filePath = *(static_cast<String*>(pArgs->GetAt(0)));
delete pArgs;
}
else
{
- return;
+ filePath = __pPresentationModel->GetFilePathAt(0);
}
- if (pFilePath != null)
+
+ if (filePath.IsEmpty() == false)
{
- __sourceFilePath.Append(*pFilePath);
- result r = __imageBuffer.Construct(pFilePath->GetPointer());
+ __sourceFilePath.Append(filePath);
+ result r = __imageBuffer.Construct(__sourceFilePath.GetPointer());
if (r == E_SUCCESS)
{
__imageWidth = __imageBuffer.GetWidth();
}
__pCanvas = GetCanvasN();
__pCanvas->SetForegroundColor(CROP_BOX_RECTANGLE_COLOR);
-
}
{
pSceneManager->GoForward(ForwardSceneTransition(IDSCN_IMAGE_VIEWER), null);
}
+ else if (operationID.CompareTo(APPCONTROL_OPERATION_ID_IMAGE_CROP) == 0)
+ {
+ pSceneManager->GoForward(ForwardSceneTransition(IDSCN_IMAGE_CROP), null);
+ }
else
{
pImageViewerApp->Terminate();
const wchar_t* APPCONTROL_OPERATION_ID_COMPOSE = L"http://tizen.org/appcontrol/operation/compose";
const wchar_t* APPCONTROL_OPERATION_ID_MAIN = L"http://tizen.org/appcontrol/operation/main";
const wchar_t* APPCONTROL_OPERATION_ID_CONFIGURE = L"http://tizen.org/appcontrol/operation/configure";
+const wchar_t* APPCONTROL_OPERATION_ID_IMAGE_CROP = L"http://tizen.org/appcontrol/operation/image/crop";
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";