, APPCONTROL_MODE_EMAIL
};
+ enum RotateMode
+ {
+ ROTATE_MODE_RIGHT = 0
+ , ROTATE_MODE_LEFT
+ };
+
void InitializeDisplay(AppControlMode status);
void InitShowGallery(void);
void CreateGallery(void);
long long GetFileSize(Tizen::Base::String filePath);
void GetHeaderString(int index, Tizen::Base::String& fileName, Tizen::Base::String& page);
void DownloadFile(void);
+ void RotateImage(Tizen::Base::String& filePath, RotateMode rotateMode);
void CallVideoPlayer(void);
result DeleteImageFile(void);
void RequestDecodeUrl(void);
int GetSetterIndex(void) const;
void SetSetterIndex(const int index);
+ void SetImageRotateStatus(bool value);
+
int GetDurationOfSlideShow(void) const;
SlideShowTransitionEffect GetTransitionEffectOfSlideShow(void) const;
void LoadSettingValue();
int GetImageCacheIndex(const Tizen::Base::String &path);
+ bool GetImageRotateStatus(void) const;
private:
static ImageViewerPresentationModel* __pPresentationModelInstance;
SlideShowTransitionEffect __transitionEffectOfSlideShow;
Tizen::Io::FileEventManager* __pFileEventManager;
SettingPresentationModel* __pSettingPresentationModel;
+ bool __isImageRotated;
};
#endif /* _IV_VIEWER_PRESENTATION_MODEL_H_ */
SET_AT_TYPE_HOME_SCREEN_WALLPAPER = 1
, SET_AT_TYPE_CALLER_IMAGE
, SET_AT_TYPE_LOCK_SCREEN_WALLPAPER
+ , SET_AT_TYPE_HOME_AND_LOCK_SCREEN_WALLPAPER
};
enum ActionID
{
ACTION_ID_FORM_IMAGE = 101
, ACTION_ID_BUTTON_EDITFIELD_CANCEL = 201
- , ACTION_ID_BUTTON_EDITFIELD_DONE = 202
+ , ACTION_ID_BUTTON_EDITFIELD_SAVE = 202
, ACTION_ID_CONTEXTMENU_CALLER = 301
, ACTION_ID_CONTEXTMENU_COPY = 302
, ACTION_ID_CONTEXTMENU_EMAIL = 303
, ACTION_ID_FOOTER_BUTTON_SHARE = 408
, ACTION_ID_FOOTER_BUTTON_SAVE = 409
, ACTION_ID_FOOTER_BUTTON_CROP = 412
+ , ACTION_ID_FOOTER_BUTTON_ROTATE_LEFT = 413
+ , ACTION_ID_FOOTER_BUTTON_ROTATE_RIGHT = 414
, ACTION_ID_FOOTER_MORE = 501
, ACTION_ID_PANEL_HEADER_DETAILS_RENAME = 601
+ , ACTION_ID_CONTEXTMENU_HOME_AND_LOCK = 602
};
enum SlideShowTransitionEffect
This XML file was automatically generated by UiBuilder - do not modify by hand.
-->
<!DOCTYPE Scene SYSTEM "UIForm.dtd">
-<Scene Bversion="2.0.0.201302250945" Dversion="20120315">
+<Scene Bversion="2.0.0.201303280947" Dversion="20120315">
<LogicalCoordinate>720</LogicalCoordinate>
<Form id="IDL_FORM_NAME_EDITOR">
- <property backgroundColor="" backgroundColorOpacity="100" orientation="Automatic" softKey0NormalIcon="" softKey0PressedIcon="" softKey0Text="" softKey1NormalIcon="" softKey1PressedIcon="" softKey1Text="" title="" titleAlign="ALIGN_CENTER" titleIcon="" translucentFooter="false" translucentHeader="false" translucentIndicator="false"/>
- <layout mode="Portrait" style="FORM_STYLE_INDICATOR|FORM_STYLE_HEADER" type="LAYOUT_RELATIVE"/>
- <layout mode="Landscape" style="FORM_STYLE_INDICATOR|FORM_STYLE_HEADER" type="LAYOUT_RELATIVE"/>
+ <property backgroundColor="" backgroundColorOpacity="100" notificationTrayOpenEnabled="false" orientation="Automatic" softKey0NormalIcon="" softKey0PressedIcon="" softKey0Text="" softKey1NormalIcon="" softKey1PressedIcon="" softKey1Text="" title="" titleAlign="ALIGN_CENTER" titleIcon="" translucentFooter="false" translucentHeader="false" translucentIndicator="false"/>
+ <layout mode="Portrait" style="FORM_STYLE_INDICATOR|FORM_STYLE_HEADER|FORM_STYLE_FOOTER" type="LAYOUT_RELATIVE"/>
+ <layout mode="Landscape" style="FORM_STYLE_INDICATOR|FORM_STYLE_HEADER|FORM_STYLE_FOOTER" type="LAYOUT_RELATIVE"/>
</Form>
+ <Footer>
+ <property backgroundBitmapPath="" color="" colorOpacity="100" disabledButtonColor="" disabledButtonColorOpacity="100" disabledButtonTextColor="" disabledItemColor="" disabledItemColorOpacity="100" disabledItemTextColor="" footerStyle="FOOTER_STYLE_BUTTON_ICON_TEXT" highlightedButtonColor="" highlightedButtonColorOpacity="100" highlightedButtonTextColor="" highlightedItemColor="" highlightedItemColorOpacity="100" highlightedItemTextColor="" normalButtonColor="" normalButtonColorOpacity="100" normalButtonTextColor="" normalItemColor="" normalItemColorOpacity="100" normalItemTextColor="" pressedButtonColor="" pressedButtonColorOpacity="100" pressedButtonTextColor="" pressedItemColor="" pressedItemColorOpacity="100" pressedItemTextColor="" selectedItemColor="" selectedItemColorOpacity="100" selectedItemTextColor="" showBackButton="false"/>
+ <itemSet/>
+ </Footer>
<Header>
- <property backgroundBitmapPath="" color="" colorOpacity="100" descriptionText="" descriptionTextColor="" disabledButtonColor="" disabledButtonColorOpacity="100" disabledButtonTextColor="" disabledItemColor="" disabledItemColorOpacity="100" disabledItemTextColor="" headerStyle="HEADER_STYLE_TITLE" highlightedButtonColor="" highlightedButtonColorOpacity="100" highlightedButtonTextColor="" highlightedItemColor="" highlightedItemColorOpacity="100" highlightedItemTextColor="" normalButtonColor="" normalButtonColorOpacity="100" normalButtonTextColor="" normalItemColor="" normalItemColorOpacity="100" normalItemTextColor="" pressedButtonColor="" pressedButtonColorOpacity="100" pressedButtonTextColor="" pressedItemColor="" pressedItemColorOpacity="100" pressedItemTextColor="" selectedItemColor="" selectedItemColorOpacity="100" selectedItemTextColor="" titleIconPath="" titleText="" titleTextColor=""/>
+ <property accessibilityHint="" backgroundBitmapPath="" color="" colorOpacity="100" descriptionText="" descriptionTextColor="" disabledButtonColor="" disabledButtonColorOpacity="100" disabledButtonTextColor="" disabledItemColor="" disabledItemColorOpacity="100" disabledItemTextColor="" headerStyle="HEADER_STYLE_TITLE" highlightedButtonColor="" highlightedButtonColorOpacity="100" highlightedButtonTextColor="" highlightedItemColor="" highlightedItemColorOpacity="100" highlightedItemTextColor="" normalButtonColor="" normalButtonColorOpacity="100" normalButtonTextColor="" normalItemColor="" normalItemColorOpacity="100" normalItemTextColor="" pressedButtonColor="" pressedButtonColorOpacity="100" pressedButtonTextColor="" pressedItemColor="" pressedItemColorOpacity="100" pressedItemTextColor="" selectedItemColor="" selectedItemColorOpacity="100" selectedItemTextColor="" titleIconPath="" titleText="" titleTextColor=""/>
<itemSet/>
</Header>
<EditField id="IDC_EDITFIELD_NAME" parent="IDL_FORM_NAME_EDITOR">
- <property commandButtonVisible="true" disabledBGBitmapPath="" disabledColor="" disabledColorOpacity="100" disabledTextColor="" ellipsisPosition="ELLIPSIS_POSITION_END" enableClear="true" groupStyle="GROUP_STYLE_NONE" guideText="" guideTextColor="" highlightedBGBitmapPath="" highlightedColor="" highlightedColorOpacity="100" highlightedTextColor="" horizontalMargin="16" inputStyle="INPUT_STYLE_OVERLAY" keypadAction="KEYPAD_ACTION_ENTER" keypadEnabled="true" limitLength="255" linkTextColor="" lowerCaseMode="false" normalBGBitmapPath="" normalColor="" normalColorOpacity="100" normalTextColor="" pressedBGBitmapPath="" pressedColor="" pressedColorOpacity="100" text="" textHorizontalAlignment="ALIGNMENT_LEFT" textSize="45" titleStyle="EDIT_FIELD_TITLE_STYLE_NONE" titleText="" titleTextColor="" verticalMargin="12" viewMode="false"/>
- <layout bottomRelation="" bottomRelationType="" centerHorizontal="false" centerVertical="false" height="100" horizontalFitPolicy="FIT_POLICY_FIXED" leftRelation="IDL_FORM_NAME_EDITOR" leftRelationType="RECT_EDGE_RELATION_LEFT_TO_LEFT" marginBottom="0" marginLeft="0" marginRight="0" marginTop="0" mode="Portrait" rightRelation="IDL_FORM_NAME_EDITOR" rightRelationType="RECT_EDGE_RELATION_RIGHT_TO_RIGHT" style="EDIT_FIELD_STYLE_NORMAL" topRelation="IDL_FORM_NAME_EDITOR" topRelationType="RECT_EDGE_RELATION_TOP_TO_TOP" verticalFitPolicy="FIT_POLICY_FIXED" width="720" x="0" y="0"/>
- <layout bottomRelation="" bottomRelationType="" centerHorizontal="false" centerVertical="false" height="120" horizontalFitPolicy="FIT_POLICY_FIXED" leftRelation="IDL_FORM_NAME_EDITOR" leftRelationType="RECT_EDGE_RELATION_LEFT_TO_LEFT" marginBottom="0" marginLeft="0" marginRight="0" marginTop="0" mode="Landscape" rightRelation="IDL_FORM_NAME_EDITOR" rightRelationType="RECT_EDGE_RELATION_RIGHT_TO_RIGHT" style="EDIT_FIELD_STYLE_NORMAL" topRelation="IDL_FORM_NAME_EDITOR" topRelationType="RECT_EDGE_RELATION_TOP_TO_TOP" verticalFitPolicy="FIT_POLICY_FIXED" width="1280" x="0" y="0"/>
+ <property accessibilityHint="" commandButtonVisible="true" disabledBGBitmapPath="" disabledColor="" disabledColorOpacity="100" disabledTextColor="" ellipsisPosition="ELLIPSIS_POSITION_END" enableClear="true" groupStyle="GROUP_STYLE_NONE" guideText="" guideTextColor="" highlightedBGBitmapPath="" highlightedColor="" highlightedColorOpacity="100" highlightedTextColor="" horizontalMargin="16.0" inputStyle="INPUT_STYLE_OVERLAY" keypadAction="KEYPAD_ACTION_ENTER" keypadEnabled="true" limitLength="255" linkTextColor="" lowerCaseMode="false" normalBGBitmapPath="" normalColor="" normalColorOpacity="100" normalTextColor="" pressedBGBitmapPath="" pressedColor="" pressedColorOpacity="100" text="" textHorizontalAlignment="ALIGNMENT_LEFT" textSize="45.0" titleStyle="EDIT_FIELD_TITLE_STYLE_NONE" titleText="" titleTextColor="" verticalMargin="12.0" viewMode="false"/>
+ <layout bottomRelation="" bottomRelationType="" centerHorizontal="false" centerVertical="false" height="100.0" horizontalFitPolicy="FIT_POLICY_FIXED" leftRelation="IDL_FORM_NAME_EDITOR" leftRelationType="RECT_EDGE_RELATION_LEFT_TO_LEFT" marginBottom="0.0" marginLeft="0.0" marginRight="0.0" marginTop="0.0" mode="Portrait" rightRelation="IDL_FORM_NAME_EDITOR" rightRelationType="RECT_EDGE_RELATION_RIGHT_TO_RIGHT" style="EDIT_FIELD_STYLE_NORMAL" topRelation="IDL_FORM_NAME_EDITOR" topRelationType="RECT_EDGE_RELATION_TOP_TO_TOP" verticalFitPolicy="FIT_POLICY_FIXED" width="720.0" x="0.0" y="0.0"/>
+ <layout bottomRelation="" bottomRelationType="" centerHorizontal="false" centerVertical="false" height="120.0" horizontalFitPolicy="FIT_POLICY_FIXED" leftRelation="IDL_FORM_NAME_EDITOR" leftRelationType="RECT_EDGE_RELATION_LEFT_TO_LEFT" marginBottom="0.0" marginLeft="0.0" marginRight="0.0" marginTop="0.0" mode="Landscape" rightRelation="IDL_FORM_NAME_EDITOR" rightRelationType="RECT_EDGE_RELATION_RIGHT_TO_RIGHT" style="EDIT_FIELD_STYLE_NORMAL" topRelation="IDL_FORM_NAME_EDITOR" topRelationType="RECT_EDGE_RELATION_TOP_TO_TOP" verticalFitPolicy="FIT_POLICY_FIXED" width="1280.0" x="0.0" y="0.0"/>
</EditField>
</Scene>
using namespace Tizen::App;
using namespace Tizen::Base;
using namespace Tizen::Base::Collection;
+using namespace Tizen::Content;
using namespace Tizen::Graphics;
using namespace Tizen::Io;
using namespace Tizen::Media;
if (pFilePath != null)
{
__sourceFilePath.Append(*pFilePath);
- __imageBuffer.GetImageInfo(pFilePath->GetPointer(), __imageFormat, __imageWidth, __imageHeight);
- __imageBuffer.Construct(pFilePath->GetPointer());
- __pCurrentBitmap = __imageBuffer.GetBitmapN(BITMAP_PIXEL_FORMAT_RGB565, BUFFER_SCALING_AUTO);
+ result r = __imageBuffer.Construct(pFilePath->GetPointer());
+ if (r == E_SUCCESS)
+ {
+ __imageWidth = __imageBuffer.GetWidth();
+ __imageHeight = __imageBuffer.GetHeight();
+ __pCurrentBitmap = __imageBuffer.GetBitmapN(BITMAP_PIXEL_FORMAT_RGB565, BUFFER_SCALING_AUTO);
+ }
+ Image img;
+ __imageFormat = img.GetImageFormat(__sourceFilePath);
}
SetValue();
AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
pCropBuffer->EncodeToFile(destFilePath, __imageFormat, true, 100);
delete pCropBuffer;
}
+ ContentManager contentManager;
+ contentManager.Construct();
+ //contentManager.ScanDirectory(Tizen::System::Environment::GetMediaPath(), true, )
+ ArrayList* pList = new (std::nothrow) ArrayList(SingleObjectDeleter);
+ pList->Add(new (std::nothrow) String(destFilePath));
+ AppLog("Manish %ls", destFilePath.GetPointer());
pSceneManager->GoBackward(BackwardSceneTransition());
AppLog("Exit");
}
//
/**
- * @file GlImageInfo.cpp
+ * @file IvImageInfo.cpp
* @brief This is the implementation file for ImageInfo class.
*/
static const int FILE_MAX_LENGTH = 255;
ImageNameEditorForm::ImageNameEditorForm()
-: __currentIndex(0)
-, __modalMsgBoxResult(0)
-, __pNameEditField(null)
-, __pMessageBox(null)
-, __pPresentationModel(null)
+ : __currentIndex(0)
+ , __modalMsgBoxResult(0)
+ , __pNameEditField(null)
+ , __pMessageBox(null)
+ , __pPresentationModel(null)
{
AppLogDebug("ENTER");
AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
AddOrientationEventListener(*this);
Header* pHeader = GetHeader();
pHeader->SetTitleText(ResourceManager::GetString(L"IDS_COM_BODY_CHANGE_NAME"));
+ pHeader->SetStyle(HEADER_STYLE_TITLE);
+ pHeader->SetTitleText(L"Rename");
- pHeader->SetStyle(HEADER_STYLE_BUTTON);
- HeaderItem doneItem;
- HeaderItem cancelItem;
- doneItem.Construct(ACTION_ID_BUTTON_EDITFIELD_DONE);
- doneItem.SetText(ResourceManager::GetString(L"IDS_COM_SK_DONE"));
- cancelItem.Construct(ACTION_ID_BUTTON_EDITFIELD_CANCEL);
- cancelItem.SetText(ResourceManager::GetString(L"IDS_COM_SK_CANCEL"));
- pHeader->SetStyle(HEADER_STYLE_BUTTON);
- pHeader->AddItem(doneItem);
- pHeader->AddItem(cancelItem);
- pHeader->AddActionEventListener(*this);
+ SetFormBackEventListener(this);
+
+ GetFooter()->SetBackButtonEnabled(true);
+ GetFooter()->SetBackButton();
+
+ FooterItem itemSave;
+ itemSave.Construct(ACTION_ID_BUTTON_EDITFIELD_SAVE);
+ itemSave.SetText(L"Save");
+
+ GetFooter()->AddItem(itemSave);
+ GetFooter()->AddActionEventListener(*this);
+ GetFooter()->Invalidate(true);
+
+
+ SetActionBarsVisible(FORM_ACTION_BAR_FOOTER, true);
__pNameEditField = static_cast< EditField* >(GetControl(L"IDC_EDITFIELD_NAME"));
switch (actionId)
{
- case ACTION_ID_BUTTON_EDITFIELD_DONE:
+ case ACTION_ID_BUTTON_EDITFIELD_SAVE:
+
inputString = __nameEditFieldText;
+
if (__nameEditFieldPreText == __nameEditFieldText)
{
String msg = ResourceManager::GetString(L"IDS_MEDIABR_POP_SAME_NAME_ALREADY_IN_USE");
return;
}
if (originalFilePath.StartsWith(Environment::GetMediaPath(), 0) == true
- || originalFilePath.StartsWith(Environment::GetExternalStoragePath(), 0) == true)
+ || originalFilePath.StartsWith(Environment::GetExternalStoragePath(), 0) == true)
{
ImageViewerMediaType mediaType = CommonUtil::GetMediaType(originalFilePath);
if (mediaType == IMAGE_VIEWER_MEDIA_TYPE_IMAGE)
pSceneManager->GoBackward(BackwardSceneTransition());
}
break;
- case ACTION_ID_BUTTON_EDITFIELD_CANCEL:
- __pNameEditField->SetText(__nameEditFieldPreText);
- pSceneManager->GoBackward(BackwardSceneTransition());
- break;
+
default:
break;
}
}
void
-ImageNameEditorForm::OnFormBackRequested(Form& source)
-{
- AppLogDebug("ENTER");
- SceneManager* pSceneManager = SceneManager::GetInstance();
- pSceneManager->GoForward(ForwardSceneTransition(IDSCN_IMAGE_VIEWER));
- AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
-}
-
-void
ImageNameEditorForm::OnTextValueChangeCanceled (const Control &source)
{
AppLogDebug("ENTER");
inputString.Trim();
- Header* header = GetHeader();
- HeaderItemStatus itemStatus;
- header->GetItemStatus(0, itemStatus);
+ FooterItemStatus itemStatus;
+ GetFooter()->GetItemStatus(0, itemStatus);
if (inputString.GetLength() == 0)
{
- if (itemStatus != HEADER_ITEM_STATUS_DISABLED)
+ if (itemStatus != FOOTER_ITEM_STATUS_DISABLED)
{
- header->SetItemEnabled(0, false);
- header->RequestRedraw(true);
+ GetFooter()->SetItemEnabled(0, false);
}
}
else
{
- if (itemStatus == HEADER_ITEM_STATUS_DISABLED)
+ if (itemStatus == FOOTER_ITEM_STATUS_DISABLED)
{
- header->SetItemEnabled(0, true);
- header->RequestRedraw(true);
+ GetFooter()->SetItemEnabled(0, true);
}
}
+ GetFooter()->Invalidate(true);
AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
}
__nameEditFieldTempText = __nameEditFieldText;
__pNameEditField->ShowKeypad();
- Header* header = GetHeader();
- HeaderItemStatus itemStatus;
- header->GetItemStatus(0, itemStatus);
- filePath.Trim();
- if (filePath.GetLength() == 0)
- {
- if (itemStatus != HEADER_ITEM_STATUS_DISABLED)
- {
- header->SetItemEnabled(0, false);
- header->RequestRedraw(true);
- }
- }
- else
- {
- if (itemStatus == HEADER_ITEM_STATUS_DISABLED)
- {
- header->SetItemEnabled(0, true);
- header->RequestRedraw(true);
- }
- }
+ AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
}
- AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
}
void
return;
}
+
+void
+ImageNameEditorForm::OnFormBackRequested(Tizen::Ui::Controls::Form& source)
+{
+ __pNameEditField->SetText(__nameEditFieldPreText);
+ SceneManager* pSceneManager = SceneManager::GetInstance();
+ pSceneManager->GoBackward(BackwardSceneTransition());
+
+}
delete pContact;
delete pAddressbook;
}
+ else if (status == SET_AT_TYPE_HOME_AND_LOCK_SCREEN_WALLPAPER )
+ {
+ Image image;
+ result r = image.Construct();
+ if (r == E_SUCCESS)
+ {
+ String destPath = App::GetInstance()->GetAppRootPath() + TEMP_FILE_PATH_LOCK_SCREEN_WALLPAPER;
+ r = image.EncodeToFile(*__pCurrentBitmap, IMG_FORMAT_JPG, destPath, true);
+ if (r == E_SUCCESS)
+ {
+ r = SettingInfo::SetValue(SETTING_VALUE_LOCK_SCREEN_WALLPAPER, destPath);
+ }
+ else if (r == E_OVERFLOW)
+ {
+ MessageBox messageBox;
+ messageBox.Construct(L"", L"File size is too big", MSGBOX_STYLE_NONE, 3000);
+ int modalResult = 0;
+ messageBox.ShowAndWait(modalResult);
+ }
+
+ String destPathHome = App::GetInstance()->GetAppRootPath() + TEMP_FILE_PATH_HOME_SCREEN_WALLPAPER;
+ r = image.EncodeToFile(*__pCurrentBitmap, IMG_FORMAT_JPG, destPathHome, true);
+ if (r == E_SUCCESS)
+ {
+ r = SettingInfo::SetValue(SETTING_VALUE_HOME_SCREEN_WALLPAPER, destPathHome);
+ }
+ else if (r == E_OVERFLOW)
+ {
+ MessageBox messageBox;
+ messageBox.Construct(L"", L"File size is too big", MSGBOX_STYLE_NONE, 3000);
+ int modalResult = 0;
+ messageBox.ShowAndWait(modalResult);
+ }
+
+ }
+ }
pSceneManager->GoForward(ForwardSceneTransition(IDSCN_IMAGE_VIEWER));
break;
case ID_BUTTON_CANCEL:
ACTION_ID_CONTEXTMENU_HOME);
__pContextMenuSetAs->AddItem(ResourceManager::GetString(L"IDS_IV_HEADER_LOCK_SCREEN_WALLPAPER_ABB"),
ACTION_ID_CONTEXTMENU_LOCK);
+ __pContextMenuSetAs->AddItem(L"Home and lock screens", ACTION_ID_CONTEXTMENU_HOME_AND_LOCK);
__pContextMenuSetAs->AddItem(ResourceManager::GetString(L"IDS_IV_BODY_CALLER_IMAGE"),
ACTION_ID_CONTEXTMENU_CALLER);
__pContextMenuSetAs->AddActionEventListener(*this);
return r;
}
- Rectangle rect = GetBounds();
- __pRenameButton->SetBounds(Rectangle(rect.width - W_RENAME_BUTTON - 20, Y_RENAME_BUTTON, W_RENAME_BUTTON, H_RENAME_BUTTON));
+ Rectangle rect = GetBounds();
+ __pRenameButton->SetBounds(Rectangle(rect.width - W_RENAME_BUTTON - 20, Y_RENAME_BUTTON, W_RENAME_BUTTON, H_RENAME_BUTTON));
AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
pSceneManager->GoForward(ForwardSceneTransition(IDSCN_IMAGE_CROP), pList);
}
break;
+ case ACTION_ID_FOOTER_BUTTON_ROTATE_RIGHT:
+ {
+ int currentIndex = __pGallery->GetCurrentItemIndex();
+ String filePath = __pPresentationModel->GetFilePathAt(currentIndex);
+ RotateMode rotateMode = ROTATE_MODE_RIGHT;
+ __pPresentationModel->SetImageRotateStatus(true);
+ RotateImage(filePath, rotateMode);
+ __pPresentationModel->RequestImage(filePath);
+ //Invalidate(true);
+ ContentManager contentManager;
+ contentManager.Construct();
+ contentManager.ScanFile(filePath);
+ }
+ break;
+ case ACTION_ID_FOOTER_BUTTON_ROTATE_LEFT:
+ {
+ int currentIndex = __pGallery->GetCurrentItemIndex();
+ String filePath = __pPresentationModel->GetFilePathAt(currentIndex);
+ RotateMode rotateMode = ROTATE_MODE_LEFT;
+ __pPresentationModel->SetImageRotateStatus(true);
+ RotateImage(filePath, rotateMode);
+ __pPresentationModel->RequestImage(filePath);
+ //Invalidate(true);
+ ContentManager contentManager;
+ contentManager.Construct();
+ contentManager.ScanFile(filePath);
+ }
+ break;
case ACTION_ID_FOOTER_BUTTON_DETAILS:
{
ShowPanelDetail(__detail);
APPCONTROL_OPERATION_ID_PICK, null, pDataList, this);
break;
}
+
+ case ACTION_ID_CONTEXTMENU_HOME_AND_LOCK:
+ {
+ ArrayList* pList = new (std::nothrow) ArrayList(SingleObjectDeleter);
+ pList->Add(new (std::nothrow) Integer(__pGallery->GetCurrentItemIndex()));
+ pList->Add(new (std::nothrow) Integer(SET_AT_TYPE_HOME_AND_LOCK_SCREEN_WALLPAPER));
+ __pPresentationModel->SetSetterIndex(__pGallery->GetCurrentItemIndex());
+ pSceneManager->GoForward(ForwardSceneTransition(IDSCN_IMAGE_SETTER), pList);
+ break;
+ break;
+ }
+
case ACTION_ID_CONTEXTMENU_EMAIL:
{
OnRequestEmailAction();
}
void
+ImageViewerForm::RotateImage(String& filePath, RotateMode rotateMode)
+{
+ result r = E_SUCCESS;
+ ImageBuffer* pRotatedBuffer = null;
+ ImageBuffer* pRotatedBuffer1 = null;
+ ImageFormat imageFormat;
+ int width = 0;
+ int height = 0;
+ pRotatedBuffer = new (std::nothrow) ImageBuffer();
+ r = pRotatedBuffer->Construct(filePath);
+ pRotatedBuffer->GetImageInfo(filePath, imageFormat, width, height);
+ if (r == E_SUCCESS)
+ {
+ if (rotateMode == ROTATE_MODE_RIGHT)
+ {
+ pRotatedBuffer1 = pRotatedBuffer->RotateN(IMAGE_ROTATION_90);
+ }
+ else
+ {
+ pRotatedBuffer1 = pRotatedBuffer->RotateN(IMAGE_ROTATION_270);
+ }
+ }
+ TryCatch(pRotatedBuffer1 != null, r = GetLastResult(), "RotateN failed:%s", GetErrorMessage(GetLastResult()));
+ pRotatedBuffer1->EncodeToFile(filePath, imageFormat, true, 100);
+ delete pRotatedBuffer1;
+ delete pRotatedBuffer;
+ return;
+
+CATCH:
+ if (pRotatedBuffer != null) //this buffer is no longer used
+ {
+ delete pRotatedBuffer;
+ }
+ if (pRotatedBuffer1 != null) //this buffer is no longer used
+ {
+ delete pRotatedBuffer1;
+ }
+ return;
+}
+
+void
ImageViewerForm::OnFormBackRequested(Form& source)
{
AppLogDebug("ENTER");
, __transitionEffectOfSlideShow(SLIDE_SHOW_TRANSITION_EFFECT_SLIDE)
, __pFileEventManager(null)
, __pSettingPresentationModel(null)
+ , __isImageRotated(false)
{
AppLogDebug("ENTER");
AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
return -1;
}
+void ImageViewerPresentationModel::SetImageRotateStatus(bool value)
+{
+ __isImageRotated = true;
+}
+
+bool ImageViewerPresentationModel::GetImageRotateStatus(void) const
+{
+ return __isImageRotated;
+}
+
void ImageViewerPresentationModel::OnFileEventOccured (const unsigned long events, const String &path, const unsigned int eventId)
{
AppLogDebug("Enter");
AppLogDebug("event delete is %d", eventDelete);
//AppLogDebug(" event move is %d", eventMoveSelf);
int index = GetImageCacheIndex(path);
- if (index != -1 && eventDelete)
+ if (index != -1 && eventDelete && GetImageRotateStatus() == false)
{
AppLogDebug("event index is %d, removing the index", index);
__pImageCaches->RemoveAt(index, true);