#include "IvImageViewerForm.h"
#include "IvImageViewerPresentationModel.h"
#include "IvResourceManager.h"
+#include "IvSettingPresentationModel.h"
+#include "IvSlideShowPopUp.h"
#include "IvTypes.h"
using namespace Tizen::App;
using namespace Tizen::Ui::Controls;
using namespace Tizen::Ui::Scenes;
-static const unsigned int COLOR_HEADER_CONTORL_PANEL = Color32<0, 0, 0, 100>::Value;
+static const unsigned int COLOR_HEADER_CONTROL_LABEL = Color32<0, 0, 0, 0>::Value;
+static const unsigned int COLOR_HEADER_CONTROL_PANEL = Color32<0, 0, 0, 100>::Value;
static const unsigned int COLOR_HEADER_BUTTON1 = Color32<0, 0, 0, 100>::Value;
+static const unsigned int COLOR_DELETE_BUTTON_NORMAL = Color32<208, 82, 82>::Value;
+static const unsigned int COLOR_DELETE_BUTTON_PRESSED = Color32<194, 71, 71>::Value;
+static const unsigned int COLOR_DELETE_BUTTON_TEXT = Color32<248, 246, 239>::Value;
+static const unsigned int COLOR_GALLERY_BG = Color32<31,31,31>::Value;
-static const Rectangle RECT_CONTORL_BUTTON_PLAY (280, 400, 160, 160);
-static const Rectangle RECT_LANDSCAP_CONTORL_BUTTON_PLAY (560, 216, 160, 160);
-
-static const Rectangle RECT_DETAILS_CONTORL_PANEL (0, 0, 720, 1008);
-static const Rectangle RECT_LANDSCAPE_DETAILS_CONTORL_PANEL (0, 0, 1280, 484);
static const Rectangle RECT_DETAILS_CONTORL_LABEL (20, 0, 200, 48);
-static const int GAP_LABEL_END = 60;
+static const int W_PLAY_BUTTON = 160;
+static const int H_PLAY_BUTTON = 160;
+
static const int GAP_W_POPUP_ITEM = 5;
static const int W_DELETE_POPUP = 600;
static const int H_DELETE_POPUP = 300;
static const int H_RENAME_BUTTON = 64;
static const int W_RENAME_BUTTON = 64;
+static const int GAP_W_END_OF_LABEL = 60;
static const int X_DETAIL_FILEINFO_LABEL = 20;
-static const int W_DETAIL_FILEINFO_LABEL = 420;
static const int H_DETAIL_FILEINFO_LABEL = 50;
static const int H_DETAIL_MAIN_TEXT = 48;
static const int H_DETAIL_SUB_TEXT = 42;
-static const int GAP_H_DETAIL_TEXT = 8;
-static const int W_DETAIL_FILEINFO_VALUE_LABEL = 650;
+static const int GAP_H_DETAIL_TEXT = 26;
static const int H_DETAIL_FILEINFO_VALUE_LABEL = 56;
static const int X_MORE = 55;
-static const int DETAIL_SUB_FONT_SIZE = 42;
-static const int DETAIL_MAIN_FONT_SIZE = 48;
+static const int DETAIL_SUB_FONT_SIZE = 32;
+static const int DETAIL_MAIN_FONT_SIZE = 36;
static const int DETAIL_COUNT_MAX = 9;
ImageViewerForm::ImageViewerForm(void)
- : __initializeDisplayModeCurrent(APPCONTROL_MODE_NORMAL)
- , __pHeader(null)
+ : __shuffelStartIndex(0)
+ , __initializeDisplayModeCurrent(APPCONTROL_MODE_NORMAL)
+ , __pLabel(null)
, __pFooter(null)
, __pScrollPanel(null)
, __pDetail_Label(null)
, __pDetailFooterItem(null)
, __pGallery(null)
, __pTimer(null)
- , __pDecodeBitmap(null)
+ , __pShuffelTimer(null)
, __pContextMenuMore(null)
, __pContextMenuCopy(null)
, __pContextMenuSetAs(null)
, __visible(true)
, __detail(true)
, __startSlide(false)
+ , __shuffle(false)
, __requestId(0)
+ , __pShuffledList(null)
, __pPresentationModel(null)
{
AppLogDebug("ENTER");
-
- __pDetail_FileInfo_Value_Label[0] = null;
- __pDetail_FileInfo_Value_Label[1] = null;
- __pDetail_FileInfo_Value_Label[2] = null;
- __pDetail_FileInfo_Value_Label[3] = null;
- __pDetail_FileInfo_Value_Label[4] = null;
- __pDetail_FileInfo_Value_Label[5] = null;
- __pDetail_FileInfo_Value_Label[6] = null;
- __pDetail_FileInfo_Value_Label[7] = null;
- __pDetail_FileInfo_Value_Label[8] = null;
AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
}
ImageViewerForm::Initialize()
{
AppLogDebug("ENTER");
+
+ result r = Form::Construct(IDL_FORM_IMAGE_VIEWER);
+
__pPresentationModel = ImageViewerPresentationModel::GetInstance();
if (__pPresentationModel->GetFileCount() > 0)
}
}
+ __pPresentationModel->AddFileUpdateListener(this);
+
+ __pSettingPresentationModel = SettingPresentationModel::GetInstance();
+
int startIndex = __pPresentationModel->GetStartIndex();
String filePath = __pPresentationModel->GetFilePathAt(startIndex);
{
__initializeDisplayModeCurrent = APPCONTROL_MODE_WEB_LINK;
}
+ else if (__pPresentationModel->GetType() == APPCONTROL_DATA_MESSAGE)
+ {
+ __initializeDisplayModeCurrent = APPCONTROL_MODE_MESSAGE;
+ }
else if (__pPresentationModel->GetType() == APPCONTROL_DATA_EMAIL)
{
__initializeDisplayModeCurrent = APPCONTROL_MODE_EMAIL;
__initializeDisplayModeCurrent = APPCONTROL_MODE_NORMAL;
}
- result r = Construct(FORM_STYLE_NORMAL | FORM_STYLE_INDICATOR | FORM_STYLE_HEADER | FORM_STYLE_FOOTER);
- if (r == E_SUCCESS)
- {
- SetOrientation(ORIENTATION_AUTOMATIC);
- }
-
if (filePath == EMPTY_SPACE)
{
MessageBox messageBox;
ImageViewerForm::OnInitializing(void)
{
AppLogDebug("ENTER");
+ result r = E_SUCCESS;
SetFormBackEventListener(this);
__pPresentationModel->AddListener(this);
+ __pLabel = dynamic_cast<Label*>(GetControl(L"IDC_LABEL_INFO"));
+
+ if(__pLabel == null)
+ {
+ return E_FAILURE;
+ }
+ __pLabel->SetBackgroundColor(COLOR_HEADER_CONTROL_LABEL);
+ SetControlAlwaysOnTop(*__pLabel,true);
+ int allCount = __pPresentationModel->GetFileCount();
+ int index = 1 ;
+ String displayText;
+ displayText.Append(index);
+ displayText.Append("/");
+ displayText.Append(allCount);
+
+ __pLabel->SetText(displayText);
+
CreateGallery();
InitializeDisplay(__initializeDisplayModeCurrent);
InitializePanelDetail();
InitializePopup();
- if ( __initializeDisplayModeCurrent == APPCONTROL_MODE_NORMAL
- || __initializeDisplayModeCurrent == APPCONTROL_MODE_EMAIL)
+ __pPopUp = new (std::nothrow) SlideShowPopUp();
+
+ if (__pPopUp != null)
+ {
+ __pPopUp->Initialize();
+ __pPopUp->SetEventListner(this);
+ AddControl(*__pPopUp);
+ }
+
+
+ if (__initializeDisplayModeCurrent == APPCONTROL_MODE_NORMAL
+ || __initializeDisplayModeCurrent == APPCONTROL_MODE_MESSAGE
+ || __initializeDisplayModeCurrent == APPCONTROL_MODE_EMAIL)
{
int index = __pPresentationModel->GetStartIndex();
__pGallery->UpdateGallery();
__pTimer->Start(1);
}
- result r = SetActionBarsTranslucent(FORM_ACTION_BAR_INDICATOR, true);
AddOrientationEventListener(*this);
AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
ShowPanelDetail(false);
}
- if (orientationStatus == ORIENTATION_STATUS_PORTRAIT ||
- orientationStatus == ORIENTATION_STATUS_PORTRAIT_REVERSE)
- {
- Rectangle clientRect = GetClientAreaBounds();
- Rectangle rect = GetBounds();
-
- __pGallery->SetBounds(Rectangle(0, -clientRect.y, rect.width, rect.height));
- __pPlayButton->SetBounds(Rectangle(RECT_CONTORL_BUTTON_PLAY.x, RECT_CONTORL_BUTTON_PLAY.y,
- RECT_CONTORL_BUTTON_PLAY.width, RECT_CONTORL_BUTTON_PLAY.height));
-
- Invalidate(true);
- }
- else if (orientationStatus == ORIENTATION_STATUS_LANDSCAPE ||
- orientationStatus == ORIENTATION_STATUS_LANDSCAPE_REVERSE)
- {
- Rectangle clientRect = GetClientAreaBounds();
- Rectangle rect = GetBounds();
+ Rectangle clientRect = GetClientAreaBounds();
+ Rectangle rect = GetBounds();
- __pGallery->SetBounds(Rectangle(0, -clientRect.y, rect.width, rect.height));
- __pPlayButton->SetBounds(Rectangle(RECT_LANDSCAP_CONTORL_BUTTON_PLAY.x, RECT_LANDSCAP_CONTORL_BUTTON_PLAY.y,
- RECT_LANDSCAP_CONTORL_BUTTON_PLAY.width, RECT_LANDSCAP_CONTORL_BUTTON_PLAY.height));
+ __pGallery->SetBounds(Rectangle(0, clientRect.y, rect.width, rect.height));
+ __pPlayButton->SetBounds(Rectangle(clientRect.width / 2 - W_PLAY_BUTTON / 2,
+ clientRect.height / 2 - W_PLAY_BUTTON / 2, W_PLAY_BUTTON, H_PLAY_BUTTON));
- Invalidate(true);
- }
+ Invalidate(true);
AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
}
ImageViewerForm::InitializeDisplay(AppControlMode status)
{
AppLogDebug("ENTER");
- String strItemText;
- String strItemIdxText;
- __pHeader = GetHeader();
- __pHeader->AddActionEventListener(*this);
+ String strItemIdxText;
__pFooter = GetFooter();
__pFooter->AddActionEventListener(*this);
__pFooter->RemoveAllItems();
- GetHeaderString(0, strItemText, strItemIdxText);
+ GetLabelText(0, strItemIdxText);
Rectangle rect = GetClientAreaBounds();
- __pHeader->SetTitleText(strItemText);
- __pHeader->SetDescriptionText(strItemIdxText);
+
if (status == APPCONTROL_MODE_NORMAL)
{
__pPlayButton = new (std::nothrow) Button();
if (__pPlayButton != null)
{
- __pPlayButton->Construct(RECT_CONTORL_BUTTON_PLAY);
+ Rectangle clientRect = GetClientAreaBounds();
+
+ __pPlayButton->Construct(Rectangle(clientRect.width / 2 - W_PLAY_BUTTON / 2,
+ clientRect.height / 2 - W_PLAY_BUTTON / 2, W_PLAY_BUTTON, H_PLAY_BUTTON));
__pPlayButton->SetActionId(ACTION_ID_CONTORL_BUTTON_PLAY);
AddControl(*__pPlayButton);
__pFooter->RemoveButtonAt(BUTTON_POSITION_LEFT);
__pFooter->SetBackButton();
- FooterItem footerItem1;
+ FooterItem footerItem1;
footerItem1.Construct(ACTION_ID_FOOTER_BUTTON_SHARE);
Bitmap* pFooterItemShareNomal =
ResourceManager::GetBitmapN(IDB_IMAGE_VIEWERFORM_FOOTER_ICON_SHARE_NORMAL);
footerItem1.SetIcon(FOOTER_ITEM_STATUS_NORMAL, pFooterItemShareNomal);
- FooterItem footerItem2;
+ FooterItem footerItem2;
footerItem2.Construct(ACTION_ID_FOOTER_BUTTON_DELETE);
Bitmap* pFooterItemDeleteNomal =
ResourceManager::GetBitmapN(IDB_IMAGE_VIEWERFORM_FOOTER_ICON_DELETE_NORMAL);
delete pfooterItem1;
delete pfooterItem2;
}
- else if (status == APPCONTROL_MODE_EMAIL)
+ else if (status == APPCONTROL_MODE_MESSAGE || status == APPCONTROL_MODE_EMAIL)
{
__pPlayButton = new (std::nothrow) Button();
if (__pPlayButton != null)
{
- __pPlayButton->Construct(RECT_CONTORL_BUTTON_PLAY);
+ Rectangle clientRect = GetClientAreaBounds();
+
+ __pPlayButton->Construct(Rectangle(clientRect.width / 2 - W_PLAY_BUTTON / 2,
+ clientRect.height / 2 - W_PLAY_BUTTON / 2, W_PLAY_BUTTON, H_PLAY_BUTTON));
__pPlayButton->SetActionId(ACTION_ID_CONTORL_BUTTON_PLAY);
AddControl(*__pPlayButton);
}
void
-ImageViewerForm::GetHeaderString(int index, String &fileName, String &page)
+ImageViewerForm::GetLabelText(int index, String &page)
{
AppLogDebug("ENTER");
int allCount = __pPresentationModel->GetFileCount();
String pStr = __pPresentationModel->GetFilePathAt(index);
- fileName = __pPresentationModel->GetFileName(pStr);
page.Format(FORMAT_BUFFER_SIZE, L"%d/%d", index + 1, allCount);
AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
}
String strItemIdxText(EMPTY_SPACE);
int countPath = __pPresentationModel->GetFileCount();
String filePath = __pPresentationModel->GetFilePathAt(currentIndex);
- result r = E_SUCCESS;
+
if (filePath.GetLength() == 0)
{
UiApp* pApp = UiApp::GetInstance();
return E_FAILURE;
}
- if (filePath.StartsWith(Environment::GetMediaPath(), 0) == true
- || filePath.StartsWith(Environment::GetExternalStoragePath(), 0) == true)
+ result r = File::Remove(filePath);
+ if (r != E_SUCCESS)
{
- ContentId contentId = __pPresentationModel->GetFileContentId(filePath);
- ContentManager contentManager;
- contentManager.Construct();
- r = contentManager.DeleteContent(contentId);
- if (r != E_SUCCESS)
- {
- r = File::Remove(filePath);
- if (r != E_SUCCESS)
- {
- MessageBox messageBox;
- messageBox.Construct(L"", ResourceManager::GetString(L"IDS_COM_POP_DELETE_FAILED"),
- MSGBOX_STYLE_NONE, 3000);
- int modalResult = 0;
- messageBox.ShowAndWait(modalResult);
- AppLogDebug("EXIT 4(%s)", GetErrorMessage(GetLastResult()));
-
- return r;
- }
- }
+ MessageBox messageBox;
+ messageBox.Construct(L"", ResourceManager::GetString(L"IDS_COM_POP_DELETE_FAILED"),
+ MSGBOX_STYLE_NONE, 3000);
+ int modalResult = 0;
+ messageBox.ShowAndWait(modalResult);
+ AppLogDebug("EXIT 4(%s)", GetErrorMessage(GetLastResult()));
+
+ return r;
}
- else
+
+ if (filePath.StartsWith(Environment::GetMediaPath(), 0) == true
+ || filePath.StartsWith(Environment::GetExternalStoragePath(), 0) == true)
{
- r = File::Remove(filePath);
+ ContentManager::ScanFile(filePath);
}
__pPresentationModel->DeleteFilePathAt(currentIndex);
filePath = __pPresentationModel->GetFilePathAt(currentIndex);
__pPresentationModel->RequestImage(filePath);
- GetHeaderString(__pGallery->GetCurrentItemIndex(), strItemText, strItemIdxText);
- __pHeader->SetTitleText(strItemText);
- __pHeader->SetDescriptionText(strItemIdxText);
+ GetLabelText(__pGallery->GetCurrentItemIndex(), strItemIdxText);
+
+ __pLabel->SetText(strItemIdxText);
if (__visible == true)
{
AppLogDebug("ENTER");
int index = __pGallery->GetCurrentItemIndex();
String filePath = __pPresentationModel->GetFilePathAt(index);
+ filePath.Insert(APPCONTROL_DATA_URI_FILE, 0);
- HashMap* pDataList = new (std::nothrow) HashMap(SingleObjectDeleter);
- pDataList->Construct();
- pDataList->Add(new (std::nothrow) String(APPCONTROL_KEY_TYPE),
- new (std::nothrow) String(APPCONTROL_DATA_VIDEO));
- pDataList->Add(new (std::nothrow) String(APPCONTROL_KEY_PATH), new (std::nothrow) String(filePath));
-
- __pPresentationModel->StartAppControl(APPCONTROL_PROVIDER_ID_VIDEO_PLAYER,
- APPCONTROL_OPERATION_ID_PLAY, pDataList, this);
+ __pPresentationModel->StartAppControl(APPCONTROL_PROVIDER_ID_VIDEO_PLAYER, APPCONTROL_OPERATION_ID_VIEW,
+ new (std::nothrow) String(filePath), new (std::nothrow) String(APPCONTROL_MIME_VIDEO_ALL), null, this);
AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
}
Rectangle rect = GetBounds();
__pGallery = new (std::nothrow) Gallery();
- __pGallery->Construct(Rectangle(0, -clientRect.y, rect.width, rect.height));
+ __pGallery->Construct(Rectangle(0, clientRect.y, rect.width, rect.height));
__pGallery->SetName(L"GalleryControl");
__pGallery->SetItemProvider(*this);
__pGallery->AddGalleryEventListener(*this);
+ __pGallery->SetBackgroundColor(COLOR_GALLERY_BG);
AddControl(*__pGallery);
__pGallery->SetTextOfEmptyGallery(ResourceManager::GetString(L"IDS_COM_BODY_LOADING"));
switch (effect)
{
- case SLIDE_SHOW_TRANSITION_EFFECT_PAGE:
- __pGallery->SetSlideShowAnimation(Controls::GALLERY_ANIMATION_PAGE);
- break;
case SLIDE_SHOW_TRANSITION_EFFECT_DISSOLVE:
__pGallery->SetSlideShowAnimation(Controls::GALLERY_ANIMATION_DISSOLVE);
break;
case SLIDE_SHOW_TRANSITION_EFFECT_ZOOM:
__pGallery->SetSlideShowAnimation(Controls::GALLERY_ANIMATION_ZOOM);
break;
- case SLIDE_SHOW_TRANSITION_EFFECT_SLIDE:
+ case SLIDE_SHOW_TRANSITION_EFFECT_PAGE:
+ __pGallery->SetSlideShowAnimation(Controls::GALLERY_ANIMATION_PAGE);
break;
}
ImageViewerForm::InitializePanelDetail()
{
AppLogDebug("ENTER");
- __pScrollPanel = new (std::nothrow) ScrollPanel();
+ __pScrollPanel = new (std::nothrow) ScrollPanel();
- String arrayId[DETAIL_COUNT_MAX] =
- {
+ String arrayId[DETAIL_COUNT_MAX] =
+ {
L"IDS_COM_BODY_DETAILS_NAME", L"IDS_IV_BODY_FILE_FORMAT", L"IDS_IV_BODY_DATE_CREATED",
L"IDS_COM_BODY_SIZE", L"IDS_IV_BODY_RESOLUTION", L"IDS_COM_BODY_LOCATION",
L"IDS_COM_BODY_LATITUDE", L"IDS_COM_BODY_LONGITUDE", L"IDS_IV_BODY_FILE_LOCATION"
- };
+ };
if (__pScrollPanel == null)
{
return E_INVALID_STATE;
}
- result r = __pScrollPanel->Construct(RECT_DETAILS_CONTORL_PANEL);
+ Rectangle clientRect = GetClientAreaBounds();
+ result r = __pScrollPanel->Construct(Rectangle(0, 0, clientRect.width, clientRect.height - __pLabel->GetHeight()));
if (r != E_SUCCESS)
{
AppLogDebug("EXIT 2(%s)", GetErrorMessage(GetLastResult()));
__pDetail_Label = new (std::nothrow) Label();
__pDetail_Label->Construct(RECT_DETAILS_CONTORL_LABEL, ResourceManager::GetString(L"IDS_COM_BODY_DETAILS"));
__pScrollPanel->AddControl(*__pDetail_Label);
- __pDetail_Label->SetTextVerticalAlignment(ALIGNMENT_MIDDLE);
+ __pDetail_Label->SetTextVerticalAlignment(ALIGNMENT_TOP);
__pDetail_Label->SetTextHorizontalAlignment(ALIGNMENT_LEFT);
__pDetail_Label->SetTextColor(Color::GetColor(COLOR_ID_WHITE));
- __pDetail_Label->SetTextConfig(DETAIL_MAIN_FONT_SIZE, LABEL_TEXT_STYLE_NORMAL);
+ __pDetail_Label->SetTextConfig(DETAIL_MAIN_FONT_SIZE, LABEL_TEXT_STYLE_BOLD);
for (int i = 0; i < DETAIL_COUNT_MAX; ++i)
{
__pDetail_FileInfo_Label[i] = new (std::nothrow) Label();
__pDetail_FileInfo_Label[i]->Construct(
Rectangle(X_DETAIL_FILEINFO_LABEL,
- GAP_H_DETAIL_TEXT * (i + 1) + H_DETAIL_MAIN_TEXT + (H_DETAIL_MAIN_TEXT + H_DETAIL_SUB_TEXT) * i,
- W_DETAIL_FILEINFO_LABEL, H_DETAIL_FILEINFO_LABEL), ResourceManager::GetString(arrayId[i]));
+ GAP_H_DETAIL_TEXT * (i + 1) + H_DETAIL_MAIN_TEXT + (H_DETAIL_MAIN_TEXT + H_DETAIL_SUB_TEXT) * i,
+ clientRect.width - GAP_W_END_OF_LABEL, H_DETAIL_FILEINFO_LABEL), ResourceManager::GetString(arrayId[i]));
__pScrollPanel->AddControl(*__pDetail_FileInfo_Label[i]);
- __pDetail_FileInfo_Label[i]->SetTextVerticalAlignment(ALIGNMENT_MIDDLE);
+ __pDetail_FileInfo_Label[i]->SetTextVerticalAlignment(ALIGNMENT_TOP);
__pDetail_FileInfo_Label[i]->SetTextHorizontalAlignment(ALIGNMENT_LEFT);
__pDetail_FileInfo_Label[i]->SetTextColor(Color::GetColor(COLOR_ID_GREY));
- __pDetail_FileInfo_Label[i]->SetTextConfig(DETAIL_SUB_FONT_SIZE, LABEL_TEXT_STYLE_NORMAL);
+ __pDetail_FileInfo_Label[i]->SetTextConfig(DETAIL_SUB_FONT_SIZE, LABEL_TEXT_STYLE_BOLD);
__pDetail_FileInfo_Value_Label[i] = new (std::nothrow) Label();
- __pDetail_FileInfo_Value_Label[i]->Construct(
- Rectangle(X_DETAIL_FILEINFO_LABEL,
- GAP_H_DETAIL_TEXT * (i + 1) + H_DETAIL_MAIN_TEXT + (H_DETAIL_MAIN_TEXT * i) + H_DETAIL_SUB_TEXT * (i + 1),
- W_DETAIL_FILEINFO_VALUE_LABEL, H_DETAIL_FILEINFO_VALUE_LABEL), L"");
+
+ if (i == DETAIL_COUNT_MAX - 1)
+ {
+ __pDetail_FileInfo_Value_Label[i]->Construct(
+ Rectangle(X_DETAIL_FILEINFO_LABEL,
+ GAP_H_DETAIL_TEXT * (i + 1) + H_DETAIL_MAIN_TEXT + (H_DETAIL_MAIN_TEXT * i) + H_DETAIL_SUB_TEXT * (i + 1),
+ clientRect.width - GAP_W_END_OF_LABEL, H_DETAIL_FILEINFO_VALUE_LABEL * 3), L"");
+ }
+ else
+ {
+ __pDetail_FileInfo_Value_Label[i]->Construct(
+ Rectangle(X_DETAIL_FILEINFO_LABEL,
+ GAP_H_DETAIL_TEXT * (i + 1) + H_DETAIL_MAIN_TEXT + (H_DETAIL_MAIN_TEXT * i) + H_DETAIL_SUB_TEXT * (i + 1),
+ clientRect.width - GAP_W_END_OF_LABEL, H_DETAIL_FILEINFO_VALUE_LABEL), L"");
+ }
+
__pScrollPanel->AddControl(*__pDetail_FileInfo_Value_Label[i]);
- __pDetail_FileInfo_Value_Label[i]->SetTextVerticalAlignment(ALIGNMENT_BOTTOM);
+ __pDetail_FileInfo_Value_Label[i]->SetTextVerticalAlignment(ALIGNMENT_TOP);
__pDetail_FileInfo_Value_Label[i]->SetTextHorizontalAlignment(ALIGNMENT_LEFT);
__pDetail_FileInfo_Value_Label[i]->SetTextColor(Color::GetColor(COLOR_ID_WHITE));
- __pDetail_FileInfo_Value_Label[i]->SetTextConfig(DETAIL_MAIN_FONT_SIZE, LABEL_TEXT_STYLE_NORMAL);
+ __pDetail_FileInfo_Value_Label[i]->SetTextConfig(DETAIL_MAIN_FONT_SIZE, LABEL_TEXT_STYLE_BOLD);
}
- __pScrollPanel->SetBackgroundColor(COLOR_HEADER_CONTORL_PANEL);
+ __pScrollPanel->SetBackgroundColor(COLOR_HEADER_CONTROL_PANEL);
__pScrollPanel->SetShowState(false);
+ __pRenameButton = new (std::nothrow) Button();
+ Rectangle rect = GetBounds();
+ __pRenameButton->Construct(Rectangle(rect.width - W_RENAME_BUTTON - 20, Y_RENAME_BUTTON, W_RENAME_BUTTON, H_RENAME_BUTTON));
+ __pRenameButton->SetActionId(ACTION_ID_PANEL_HEADER_DETAILS_RENAME);
+ __pRenameButton->AddActionEventListener(*this);
+
+ Bitmap* pIcon = ResourceManager::GetBitmapN(IDB_IMAGE_VIEWERFORM_BUTTON_EDIT_NAME);
+ Bitmap* pIconBackground =
+ ResourceManager::GetBitmapN(IDB_IMAGE_VIEWERFORM_BUTTON_EDIT_NAME_NORMAL_BACKGROUND);
+ Bitmap* pIconPressed =
+ ResourceManager::GetBitmapN(IDB_IMAGE_VIEWERFORM_BUTTON_EDIT_NAME_NORMAL_BACKGROUND_PRESS);
+
+ if (pIcon != null && pIconPressed != null && pIconBackground != null)
+ {
+ __pRenameButton->SetNormalBackgroundBitmap(*pIconBackground);
+ __pRenameButton->SetPressedBackgroundBitmap(*pIconPressed);
+ Point iconPosition(0, 0);
+ __pRenameButton->SetNormalBitmap(iconPosition, *pIcon);
+ __pRenameButton->SetPressedBitmap(iconPosition, *pIconPressed);
+ }
+ else
+ {
+ __pRenameButton->SetColor(BUTTON_STATUS_NORMAL, COLOR_HEADER_BUTTON1);
+ __pRenameButton->SetColor(BUTTON_STATUS_PRESSED, COLOR_HEADER_BUTTON1);
+ }
+ delete pIcon;
+ delete pIconPressed;
+ delete pIconBackground;
+
+ __pRenameButton->SetColor(BUTTON_STATUS_NORMAL, COLOR_HEADER_BUTTON1);
+ __pScrollPanel->AddControl(*__pRenameButton);
+
+
AddControl(*__pScrollPanel);
AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
Label* pLabel = new (std::nothrow) Label();
pLabel->Construct(Rectangle(0, 0, popupClientBounds.width, H_DELETE_LABEL),
- ResourceManager::GetString(L"IDS_COM_BODY_DELETE") + L"?");
+ ResourceManager::GetString(L"IDS_COM_POP_DELETE_Q"));
Button* pDeleteButton = new (std::nothrow) Button();
pDeleteButton->Construct(
Rectangle(0, Y_DELETE_BUTTON, popupClientBounds.width / 2 - GAP_W_POPUP_ITEM, H_DELETE_BUTTON),
ResourceManager::GetString(L"IDS_COM_BODY_DELETE"));
+ pDeleteButton->SetColor(BUTTON_STATUS_NORMAL, COLOR_DELETE_BUTTON_NORMAL);
+ pDeleteButton->SetColor(BUTTON_STATUS_PRESSED, COLOR_DELETE_BUTTON_PRESSED);
+ pDeleteButton->SetTextColor(COLOR_DELETE_BUTTON_TEXT);
pDeleteButton->SetActionId(ACTION_ID_DELETE_POPUP_DEL);
pDeleteButton->AddActionEventListener(*this);
__pContextMenuMore = new (std::nothrow) ContextMenu();
- __pContextMenuMore->Construct(Point(X_MORE, GetClientAreaBounds().y + GetClientAreaBounds().height),
- CONTEXT_MENU_STYLE_LIST, CONTEXT_MENU_ANCHOR_DIRECTION_UPWARD);
+ __pContextMenuMore->Construct(Point(X_MORE, GetClientAreaBounds().height),
+ CONTEXT_MENU_STYLE_LIST, CONTEXT_MENU_ANCHOR_DIRECTION_UPWARD);
if (mediaType == IMAGE_VIEWER_MEDIA_TYPE_IMAGE)
{
__pContextMenuMore->AddItem(ResourceManager::GetString(L"IDS_IV_OPT_SET_AS"),
ACTION_ID_CONTEXTMENU_SET_AS);
+ __pContextMenuMore->AddItem(ResourceManager::GetString(L"IDS_IV_BODY_CROP"), ACTION_ID_FOOTER_BUTTON_CROP);
}
if (__pGallery->GetItemCount() > 1)
ACTION_ID_CONTEXTMENU_HOME);
__pContextMenuSetAs->AddItem(ResourceManager::GetString(L"IDS_IV_HEADER_LOCK_SCREEN_WALLPAPER_ABB"),
ACTION_ID_CONTEXTMENU_LOCK);
+ __pContextMenuSetAs->AddItem(ResourceManager::GetString(L"IDS_IV_BODY_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);
GetClientAreaBounds().y + GetClientAreaBounds().height), CONTEXT_MENU_STYLE_LIST,
CONTEXT_MENU_ANCHOR_DIRECTION_UPWARD);
- __pContextMenuShare->AddItem(ResourceManager::GetString(L"IDS_COM_BODY_EMAIL"),ACTION_ID_CONTEXTMENU_EMAIL);
+ __pContextMenuShare->AddItem(ResourceManager::GetString(L"IDS_COM_BODY_MESSAGE"),
+ ACTION_ID_CONTEXTMENU_MESSAGE);
+ __pContextMenuShare->AddItem(ResourceManager::GetString(L"IDS_COM_BODY_EMAIL"), ACTION_ID_CONTEXTMENU_EMAIL);
__pContextMenuShare->AddActionEventListener(*this);
AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
AppLogDebug("ENTER");
Rectangle clientRect = GetClientAreaBounds();
- AppLogDebug("PORTRAIT GetClientAreaBounds(%d %d %d %d)", clientRect.x, clientRect.y, clientRect.width, clientRect.height);
- OrientationStatus currentOrientaton = GetOrientationStatus();
-
- if (currentOrientaton == ORIENTATION_STATUS_LANDSCAPE || currentOrientaton == ORIENTATION_STATUS_LANDSCAPE_REVERSE)
- {
- __pScrollPanel->SetBounds(Rectangle(0, 0, clientRect.width, RECT_LANDSCAPE_DETAILS_CONTORL_PANEL.height));
- }
- else
- {
- __pScrollPanel->SetBounds(0, 0, clientRect.width, RECT_DETAILS_CONTORL_PANEL.height);
- }
-
+ __pScrollPanel->SetBounds(0,__pLabel->GetHeight(), clientRect.width, clientRect.height - __pLabel->GetHeight());
int currentIndex = __pGallery->GetCurrentItemIndex();
String strFilePath = __pPresentationModel->GetFilePathAt(currentIndex);
if (nSize > SINGLE_GIGA_BYTE)
{
- strResult[3].Format(FORMAT_BUFFER_SIZE, L"%lld GB", nSize / SINGLE_GIGA_BYTE);
+ strResult[3].Format(FORMAT_BUFFER_SIZE, L"%lld ", nSize / SINGLE_GIGA_BYTE);
+ strResult[3].Append(ResourceManager::GetString(L"IDS_COM_BODY_GB"));
}
else if (nSize > SINGLE_MEGA_BYTE)
{
- strResult[3].Format(FORMAT_BUFFER_SIZE, L"%lld MB", nSize / SINGLE_MEGA_BYTE);
+ strResult[3].Format(FORMAT_BUFFER_SIZE, L"%lld ", nSize / SINGLE_MEGA_BYTE);
+ strResult[3].Append(ResourceManager::GetString(L"IDS_COM_BODY_MB"));
}
else if (nSize > SINGLE_KILO_BYTE)
{
- strResult[3].Format(FORMAT_BUFFER_SIZE, L"%lld KB", nSize / SINGLE_KILO_BYTE);
+ strResult[3].Format(FORMAT_BUFFER_SIZE, L"%lld ", nSize / SINGLE_KILO_BYTE);
+ strResult[3].Append(ResourceManager::GetString(L"IDS_COM_BODY_KB"));
}
else
{
- strResult[3].Format(FORMAT_BUFFER_SIZE, L"%lld Byte", nSize);
+ strResult[3].Format(FORMAT_BUFFER_SIZE, L"%lld ", nSize);
+ strResult[3].Append(ResourceManager::GetString(L"IDS_COM_BODY_B"));
}
}
else
strResult[6] = ResourceManager::GetString(L"IDS_COM_BODY_UNKNOWN");
strResult[7] = ResourceManager::GetString(L"IDS_COM_BODY_UNKNOWN");
strResult[8] = strFilePath;
+ String fileName = File::GetFileName(strFilePath);
+ strResult[8].Remove(strResult[8].GetLength() - fileName.GetLength(), fileName.GetLength());
+
+ if (strResult[8].StartsWith(Tizen::System::Environment::GetMediaPath(), 0) == true)
+ {
+ strResult[8].Replace(Tizen::System::Environment::GetMediaPath(), MEDIA_ROOT_PHONE, 0);
+ }
if (__initializeDisplayModeCurrent == APPCONTROL_MODE_WEB_LINK)
{
strResult[6].Format(FORMAT_BUFFER_SIZE, L"%f", pImgMeta->GetLatitude());
strResult[7].Format(FORMAT_BUFFER_SIZE, L"%f", pImgMeta->GetLongitude());
}
-
- strResult[8] = imageContentInfo.GetContentPath();
}
delete pImgMeta;
}
{
strResult[5].Format(FORMAT_BUFFER_SIZE, L"%ls", videoContentInfo.GetLocationTag().GetPointer());
}
-
- strResult[8] = videoContentInfo.GetContentPath();
}
}
}
for (int i = 0; i < DETAIL_COUNT_MAX; ++i)
{
- __pDetail_FileInfo_Value_Label[i]->SetBounds(X_DETAIL_FILEINFO_LABEL, GAP_H_DETAIL_TEXT * (i + 1) + H_DETAIL_MAIN_TEXT + (H_DETAIL_MAIN_TEXT * i) + H_DETAIL_SUB_TEXT * (i + 1),
- clientRect.width - GAP_LABEL_END, H_DETAIL_FILEINFO_VALUE_LABEL);
__pDetail_FileInfo_Value_Label[i]->SetText(strResult[i]);
- __pDetail_FileInfo_Value_Label[i]->RequestRedraw();
- }
-
- if (__initializeDisplayModeCurrent == APPCONTROL_MODE_WEB_LINK)
- {
- AppLogDebug("EXIT 1(%s)", GetErrorMessage(GetLastResult()));
- return r;
- }
- if (__pRenameButton == null)
- {
- __pRenameButton = new (std::nothrow) Button();
- Rectangle rect = GetBounds();
- __pRenameButton->Construct(Rectangle(rect.width - W_RENAME_BUTTON, Y_RENAME_BUTTON, W_RENAME_BUTTON, H_RENAME_BUTTON));
- __pRenameButton->SetActionId(ACTION_ID_PANEL_HEADER_DETAILS_RENAME);
-
- Bitmap* pIcon = ResourceManager::GetBitmapN(IDB_IMAGE_VIEWERFORM_BUTTON_EDIT_NAME);
- Bitmap* pIconBackground =
- ResourceManager::GetBitmapN(IDB_IMAGE_VIEWERFORM_BUTTON_EDIT_NAME_NORMAL_BACKGROUND);
- Bitmap* pIconPressed =
- ResourceManager::GetBitmapN(IDB_IMAGE_VIEWERFORM_BUTTON_EDIT_NAME_NORMAL_BACKGROUND_PRESS);
-
- if (pIcon != null && pIconPressed != null && pIconBackground != null)
+ if (i == DETAIL_COUNT_MAX - 1)
{
- __pRenameButton->SetNormalBackgroundBitmap(*pIconBackground);
- __pRenameButton->SetPressedBackgroundBitmap(*pIconPressed);
- Point iconPosition(0, 0);
- __pRenameButton->SetNormalBitmap(iconPosition, *pIcon);
- __pRenameButton->SetPressedBitmap(iconPosition, *pIconPressed);
+ __pDetail_FileInfo_Value_Label[i]->SetBounds(
+ Rectangle(X_DETAIL_FILEINFO_LABEL,
+ GAP_H_DETAIL_TEXT * (i + 1) + H_DETAIL_MAIN_TEXT + (H_DETAIL_MAIN_TEXT * i) + H_DETAIL_SUB_TEXT * (i + 1),
+ clientRect.width - GAP_W_END_OF_LABEL, H_DETAIL_FILEINFO_VALUE_LABEL * 3));
}
else
{
- __pRenameButton->SetColor(BUTTON_STATUS_NORMAL, COLOR_HEADER_BUTTON1);
- __pRenameButton->SetColor(BUTTON_STATUS_PRESSED, COLOR_HEADER_BUTTON1);
+ __pDetail_FileInfo_Value_Label[i]->SetBounds(
+ Rectangle(X_DETAIL_FILEINFO_LABEL,
+ GAP_H_DETAIL_TEXT * (i + 1) + H_DETAIL_MAIN_TEXT + (H_DETAIL_MAIN_TEXT * i) + H_DETAIL_SUB_TEXT * (i + 1),
+ clientRect.width - GAP_W_END_OF_LABEL, H_DETAIL_FILEINFO_VALUE_LABEL));
}
- delete pIcon;
- delete pIconPressed;
- delete pIconBackground;
- __pScrollPanel->AddControl(*__pRenameButton);
- __pRenameButton->SetColor(BUTTON_STATUS_NORMAL, COLOR_HEADER_BUTTON1);
- __pRenameButton->AddActionEventListener(*this);
+ __pDetail_FileInfo_Value_Label[i]->Invalidate(true);
}
- else
+
+ if (__initializeDisplayModeCurrent == APPCONTROL_MODE_WEB_LINK)
{
- Rectangle rect = GetBounds();
- __pRenameButton->SetBounds(Rectangle(rect.width - W_RENAME_BUTTON, Y_RENAME_BUTTON, W_RENAME_BUTTON, H_RENAME_BUTTON));
+ AppLogDebug("EXIT 1(%s)", GetErrorMessage(GetLastResult()));
+ return r;
}
+
+ 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()));
return r;
if (showStatus)
{
SetDetailInfo();
+ __pLabel->SetBackgroundColor(COLOR_HEADER_CONTROL_PANEL);
+ __pLabel->Invalidate(true);
__pScrollPanel->SetShowState(true);
__detail = false;
}
else
{
+ __pLabel->SetBackgroundColor(COLOR_HEADER_CONTROL_LABEL);
+ __pLabel->Invalidate(true);
__pScrollPanel->SetShowState(false);
__detail = true;
}
pFooter->Invalidate(true);
delete pfooterItem;
- pfooterItem = null;
AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
return E_SUCCESS;
AppLogDebug("ENTER : index(%d)", index);
GalleryItem* pGallery = new (std::nothrow) GalleryItem();
- String filePath = __pPresentationModel->GetFilePathAt(index);
- ImageInfo* pImageInfo = __pPresentationModel->GetImageCacheAt(index);
+ int curIndex = index;
+
+ if (__shuffle == true && __pShuffledList != null)
+ {
+ curIndex = __pShuffledList[index];
+ }
+
+ String filePath = __pPresentationModel->GetFilePathAt(curIndex);
+ ImageInfo* pImageInfo = __pPresentationModel->GetImageCacheAt(curIndex);
Bitmap* pBitmap = pImageInfo->GetBitmapN();
+
if (pBitmap == null)
{
pBitmap = GetQuickThumbnailN(filePath);
}
pGallery->Construct(*pBitmap, filePath);
delete pBitmap;
- AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
+ AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
return pGallery;
}
bool
ImageViewerForm::DeleteItem(int index, GalleryItem* pItem)
{
- AppLogDebug("ENTER index(%d)", index);
- ImageInfo* pImageInfo = __pPresentationModel->GetImageCacheAt(index);
+ AppLogDebug("ImageViewerForm::DeleteItem ENTER index(%d)", index);
+ int curIndex = index;
+
+ if(__shuffle == true && __pShuffledList != null)
+ {
+ curIndex = __pShuffledList[index];
+ }
+
+
+ ImageInfo* pImageInfo = __pPresentationModel->GetImageCacheAt(curIndex);
pImageInfo->ClearBitmap();
delete pItem;
AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
void
ImageViewerForm::OnGalleryCurrentItemChanged(Gallery& view, int index)
{
- AppLogDebug("ENTER index(%d)", index);
+ AppLogDebug("ImageViewerForm::OnGalleryCurrentItemChanged index(%d)", index);
String filePath = __pPresentationModel->GetFilePathAt(index);
AppLogDebug("ENTER index(%d) filePath(%ls)", index, filePath.GetPointer());
__pPresentationModel->RequestImage(filePath);
- String strItemText;
String strItemIdxText;
- GetHeaderString(__pGallery->GetCurrentItemIndex(), strItemText, strItemIdxText);
- __pHeader->SetTitleText(strItemText);
- __pHeader->SetDescriptionText(strItemIdxText);
+ GetLabelText(__pGallery->GetCurrentItemIndex(), strItemIdxText);
+ __pLabel->SetText(strItemIdxText);
if (__visible == true)
{
__pPlayButton->SetShowState(false);
}
- SetActionBarsVisible(FORM_ACTION_BAR_INDICATOR | FORM_ACTION_BAR_HEADER | FORM_ACTION_BAR_FOOTER, false);
+ SetActionBarsVisible( FORM_ACTION_BAR_FOOTER, false);
+ __pLabel->SetShowState(false);
__visible = false;
}
else
__pPlayButton->SetShowState(true);
}
- SetActionBarsVisible(FORM_ACTION_BAR_INDICATOR | FORM_ACTION_BAR_HEADER | FORM_ACTION_BAR_FOOTER, true);
+ SetActionBarsVisible(FORM_ACTION_BAR_FOOTER, true);
+ __pLabel->SetShowState(true);
__visible = true;
__pPlayButton->SetPosition(__pPlayButton->GetPosition().x, __pPlayButton->GetPosition().y - 1);
Rectangle clientRect = GetClientAreaBounds();
Rectangle rect = GetBounds();
- __pGallery->SetBounds(Rectangle(0, -clientRect.y, rect.width, rect.height));
+ __pGallery->SetBounds(Rectangle(0, clientRect.y, rect.width, rect.height));
Invalidate(true);
AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
}
PowerManager::KeepScreenOnState(true, false);
if (__visible == true)
{
- SetActionBarsVisible(FORM_ACTION_BAR_INDICATOR | FORM_ACTION_BAR_HEADER | FORM_ACTION_BAR_FOOTER, false);
+ SetActionBarsVisible(FORM_ACTION_BAR_FOOTER, false);
+ __pLabel->SetShowState(false);
int index = __pGallery->GetCurrentItemIndex();
String filePath = __pPresentationModel->GetFilePathAt(index);
void
ImageViewerForm::OnGallerySlideShowStopped(Gallery& gallery)
{
- AppLogDebug("ENTER");
+ AppLogDebug("ImageViewerForm::OnGallerySlideShowStopped");
+
+ int index;
+
+ if(__shuffle == true)
+ {
+
+ if(__pShuffelTimer == null)
+ {
+ __pShuffelTimer = new (std::nothrow) Timer();
+ __pShuffelTimer->Construct(*this);
+ }
+ __pShuffelTimer->Start(1);
+ }
+ else
+ {
+ index = __pGallery->GetCurrentItemIndex();
+ SlideShowStopped(index);
+ }
+
+
+ AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
+}
+
+void
+ImageViewerForm::SlideShowStopped(int index)
+{
+ AppLog("ImageViewerForm::SlideShowStopped");
PowerManager::KeepScreenOnState(false, true);
- int index = __pGallery->GetCurrentItemIndex();
if (__visible == false)
{
- SetActionBarsVisible(FORM_ACTION_BAR_INDICATOR | FORM_ACTION_BAR_HEADER | FORM_ACTION_BAR_FOOTER, true);
-
+ SetActionBarsVisible(FORM_ACTION_BAR_FOOTER, true);
+ __pLabel->SetShowState(true);
String filePath = __pPresentationModel->GetFilePathAt(index);
ContentType contentType = ContentManagerUtil::CheckContentType(filePath);
if (contentType == CONTENT_TYPE_VIDEO)
__visible = true;
}
- String strItemText;
String strItemIdxText;
- GetHeaderString(index, strItemText, strItemIdxText);
- __pHeader->SetTitleText(strItemText);
- __pHeader->SetDescriptionText(strItemIdxText);
+ GetLabelText(index, strItemIdxText);
+ __pLabel->SetText(strItemIdxText);
+
Rectangle clientRect = GetClientAreaBounds();
Rectangle rect = GetBounds();
__pGallery->SetBounds(Rectangle(0, -clientRect.y, rect.width, rect.height));
Invalidate(true);
- AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
}
void
__pTimer = null;
}
+ if(__pShuffelTimer)
+ {
+ __pShuffelTimer->Cancel();
+ delete __pShuffelTimer;
+ __pShuffelTimer = null;
+ }
+
__pPresentationModel->ClearImageRequests();
__pPresentationModel->RemoveListener(*this);
+ __pPresentationModel->RemoveFileUpdateListener(*this);
if (__pContextMenuCopy != null)
{
if (__pContextMenuSetAs != null)
{
- delete __pContextMenuSetAs;
- __pContextMenuSetAs = null;
+ delete __pContextMenuSetAs;
+ __pContextMenuSetAs = null;
}
if (__pDeletePopup != null)
__pContextMenuMore = null;
}
+ if(__pShuffledList != null)
+ {
+ free(__pShuffledList);
+ __pShuffledList = null;
+ }
+
AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
return E_SUCCESS;
__pContextMenuMore->SetShowState(true);
__pContextMenuMore->Show();
}
- break;
+ break;
case ACTION_ID_CONTEXTMENU_SET_AS:
InitializeContextMenuSetAs();
break;
case ACTION_ID_FOOTER_BUTTON_SLIDE:
{
- if (__pPresentationModel->GetFileCount() > 1)
+ if (__pPopUp != null)
{
- __pGallery->UpdateGallery();
- if (__detail == false)
- {
- ShowPanelDetail(false);
- }
- __pGallery->StartSlideShow(true);
+ __pPopUp->SetShowState(true);
+ __pPopUp->Show();
}
+
break;
}
+ case ACTION_ID_FOOTER_BUTTON_CROP:
+ {
+ String filePath;
+ filePath = __pPresentationModel->GetFilePathAt(__pGallery->GetCurrentItemIndex());
+ ImageBuffer imagebuffer;
+ result r = imagebuffer.Construct(filePath);
+ if (r != E_SUCCESS)
+ {
+ return;
+ }
+ int imageWidth = imagebuffer.GetWidth();
+ int imageHeight = imagebuffer.GetHeight();
+ if (imageWidth <= (CROP_RECTANGLE_HEIGHT * 3) || imageHeight <= (CROP_RECTANGLE_HEIGHT * 3))
+ {
+ MessageBox messageBox;
+ String messageText = ResourceManager::GetString(L"IDS_IMGE_POP_IMAGE_IS_TOO_SMALL");
+ messageBox.Construct(L"", messageText, MSGBOX_STYLE_OK, 3000);
+ int modalResult = 0;
+ messageBox.ShowAndWait(modalResult);
+ return;
+ }
+ String cropMode = L"auto";
+ ArrayList* pList = new (std::nothrow) ArrayList(SingleObjectDeleter);
+ pList->Add(new (std::nothrow) String(filePath));
+ pList->Add(new (std::nothrow) String(cropMode));
+ 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;
+ RotateImage(filePath, rotateMode);
+ __pPresentationModel->RequestImage(filePath);
+ 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;
+ RotateImage(filePath, rotateMode);
+ __pPresentationModel->RequestImage(filePath);
+ ContentManager::ScanFile(filePath);
+ }
+ break;
case ACTION_ID_FOOTER_BUTTON_DETAILS:
{
ShowPanelDetail(__detail);
}
case ACTION_ID_CONTEXTMENU_HOME:
{
+ String filePath = __pPresentationModel->GetFilePathAt(__pGallery->GetCurrentItemIndex());
+ String cropMode = "fit-to-screen";
ArrayList* pList = new (std::nothrow) ArrayList(SingleObjectDeleter);
- pList->Add(new (std::nothrow) Integer(__pGallery->GetCurrentItemIndex()));
+ pList->Add(new (std::nothrow) String(filePath));
+ pList->Add(new (std::nothrow) String(cropMode));
pList->Add(new (std::nothrow) Integer(SET_AT_TYPE_HOME_SCREEN_WALLPAPER));
- __pPresentationModel->SetSetterIndex(__pGallery->GetCurrentItemIndex());
- pSceneManager->GoForward(ForwardSceneTransition(IDSCN_IMAGE_SETTER), pList);
+ pSceneManager->GoForward(ForwardSceneTransition(IDSCN_IMAGE_CROP), pList);
break;
}
case ACTION_ID_CONTEXTMENU_LOCK:
{
+ String filePath = __pPresentationModel->GetFilePathAt(__pGallery->GetCurrentItemIndex());
+ String cropMode = "fit-to-screen";
ArrayList* pList = new (std::nothrow) ArrayList(SingleObjectDeleter);
- pList->Add(new (std::nothrow) Integer(__pGallery->GetCurrentItemIndex()));
+ pList->Add(new (std::nothrow) String(filePath));
+ pList->Add(new (std::nothrow) String(cropMode));
pList->Add(new (std::nothrow) Integer(SET_AT_TYPE_LOCK_SCREEN_WALLPAPER));
- __pPresentationModel->SetSetterIndex(__pGallery->GetCurrentItemIndex());
- pSceneManager->GoForward(ForwardSceneTransition(IDSCN_IMAGE_SETTER), pList);
+ pSceneManager->GoForward(ForwardSceneTransition(IDSCN_IMAGE_CROP), pList);
break;
}
case ACTION_ID_CONTEXTMENU_CALLER:
pDataList->Construct();
pDataList->Add(new (std::nothrow) String(APPCONTROL_KEY_SELECTION_MODE),
new (std::nothrow) String(APPCONTROL_DATA_SINGLE));
- pDataList->Add(new (std::nothrow) String(APPCONTROL_KEY_RETURN_TYPE),
- new (std::nothrow) String(APPCONTROL_DATA_CONTACT_ID));
+ pDataList->Add(new (std::nothrow) String(APPCONTROL_KEY_SOCIAL_ITEM_TYPE),
+ new (std::nothrow) String(APPCONTROL_DATA_PERSON));
+ pDataList->Add(new (std::nothrow) String(APPCONTROL_KEY_SOCIAL_RESULT_TYPE),
+ new (std::nothrow) String(APPCONTROL_DATA_ITEM_ID));
__pPresentationModel->StartAppControl(APPCONTROL_PROVIDER_ID_CONTACTS,
- APPCONTROL_OPERATION_ID_PICK, pDataList, this);
+ APPCONTROL_OPERATION_ID_SOCIAL_PICK, null, null, pDataList, this);
+ break;
+ }
+
+ case ACTION_ID_CONTEXTMENU_HOME_AND_LOCK:
+ {
+ String filePath = __pPresentationModel->GetFilePathAt(__pGallery->GetCurrentItemIndex());
+ String cropMode = "fit-to-screen";
+ ArrayList* pList = new (std::nothrow) ArrayList(SingleObjectDeleter);
+ pList->Add(new (std::nothrow) String(filePath));
+ pList->Add(new (std::nothrow) String(cropMode));
+ pList->Add(new (std::nothrow) Integer(SET_AT_TYPE_HOME_AND_LOCK_SCREEN_WALLPAPER));
+ pSceneManager->GoForward(ForwardSceneTransition(IDSCN_IMAGE_CROP), pList);
break;
}
+
case ACTION_ID_CONTEXTMENU_EMAIL:
{
OnRequestEmailAction();
break;
}
+ case ACTION_ID_CONTEXTMENU_MESSAGE:
+ {
+ OnRequestMessagesAction();
+ break;
+ }
case ACTION_ID_CONTEXTMENU_COPY:
{
int currentIndex = __pGallery->GetCurrentItemIndex();
}
void
+ImageViewerForm::RotateImage(String& filePath, RotateMode rotateMode)
+{
+ result r = E_SUCCESS;
+ ImageBuffer rotateBuffer;
+ ImageBuffer* pRotatedBuffer = null;
+ ImageFormat imageFormat;
+ Image img;
+ r = img.Construct();
+
+ if (r == E_SUCCESS)
+ {
+ imageFormat = img.GetImageFormat(filePath);
+ }
+
+ r = rotateBuffer.Construct(filePath);
+ if (r == E_SUCCESS)
+ {
+ if (rotateMode == ROTATE_MODE_RIGHT)
+ {
+ pRotatedBuffer = rotateBuffer.RotateN(IMAGE_ROTATION_90);
+ }
+ else
+ {
+ pRotatedBuffer = rotateBuffer.RotateN(IMAGE_ROTATION_270);
+ }
+ }
+
+ if (pRotatedBuffer != null)
+ {
+ r = pRotatedBuffer->EncodeToFile(filePath, imageFormat, true, 100);
+ delete pRotatedBuffer;
+ }
+ return;
+}
+
+void
ImageViewerForm::OnFormBackRequested(Form& source)
{
AppLogDebug("ENTER");
void
ImageViewerForm::OnSceneActivatedN(const SceneId& previousSceneId,
- const SceneId& currentSceneId, IList* pArgs)
+ const SceneId& currentSceneId, IList* pArgs)
{
AppLogDebug("ENTER");
- OrientationStatus status = GetOrientationStatus();
- if (status == ORIENTATION_STATUS_PORTRAIT ||
- status == ORIENTATION_STATUS_PORTRAIT_REVERSE)
- {
- AppLogDebug("ORIENTATION_STATUS : PORTRAIT");
- Rectangle clientRect = GetClientAreaBounds();
- Rectangle rect = GetBounds();
- __pGallery->SetBounds(Rectangle(0, -clientRect.y, rect.width, rect.height));
- __pPlayButton->SetBounds(RECT_CONTORL_BUTTON_PLAY);
- __pScrollPanel->SetBounds(RECT_DETAILS_CONTORL_PANEL);
- }
- else if (status == ORIENTATION_STATUS_LANDSCAPE ||
- status == ORIENTATION_STATUS_LANDSCAPE_REVERSE)
- {
- AppLogDebug("ORIENTATION_STATUS : LANDSCAPE");
- Rectangle clientRect = GetClientAreaBounds();
- Rectangle rect = GetBounds();
- __pGallery->SetBounds(Rectangle(0, -clientRect.y, rect.width, rect.height));
- __pPlayButton->SetBounds(RECT_LANDSCAP_CONTORL_BUTTON_PLAY);
- __pScrollPanel->SetBounds(RECT_LANDSCAPE_DETAILS_CONTORL_PANEL);
- }
+
+ Rectangle clientRect = GetClientAreaBounds();
+ Rectangle rect = GetBounds();
+
+ __pGallery->SetBounds(Rectangle(0, clientRect.y, rect.width, rect.height));
+ __pScrollPanel->SetBounds(Rectangle(0, __pLabel->GetHeight(), clientRect.width, clientRect.height - __pLabel->GetHeight()));
+ __pPlayButton->SetBounds(Rectangle(clientRect.width / 2 - 80, clientRect.height / 2 - 80, 160, 160));
if (previousSceneId == IDSCN_IMAGE_NAME_EDITOR && currentSceneId == IDSCN_IMAGE_VIEWER)
{
SetDetailInfo();
- String strItemText(EMPTY_SPACE);
String strItemIdxText(EMPTY_SPACE);
- GetHeaderString(__pGallery->GetCurrentItemIndex(), strItemText, strItemIdxText);
- __pHeader->SetTitleText(strItemText);
- __pHeader->SetDescriptionText(strItemIdxText);
+ GetLabelText(__pGallery->GetCurrentItemIndex(), strItemIdxText);
+ __pLabel->SetText(strItemIdxText);
Invalidate(true);
}
+ if (previousSceneId == IDSCN_IMAGE_CROP && pArgs != null)
+ {
+ String filePath;
+ filePath = *(static_cast<String*>(pArgs->GetAt(0)));
+ delete pArgs;
+ int count = __pPresentationModel->GetFileCount();
+ __pPresentationModel->AddImageCache(filePath);
+ __pGallery->UpdateGallery();
+ __pGallery->SetCurrentItemIndex(count);
+ __pPresentationModel->RequestImage(filePath);
+ }
+
if (__pGallery->GetCurrentItemIndex() < 0)
{
SetFooterItemState(false);
void
ImageViewerForm::OnSceneDeactivated(const SceneId& currentSceneId,
- const SceneId& nextSceneId)
+ const SceneId& nextSceneId)
{
AppLogDebug("ENTER");
AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
AppLogDebug("ENTER");
if (appId == APPCONTROL_PROVIDER_ID_CONTACTS
- && operationId == APPCONTROL_OPERATION_ID_PICK
- && appControlResult == APP_CTRL_RESULT_SUCCEEDED)
+ && operationId == APPCONTROL_OPERATION_ID_SOCIAL_PICK
+ && appControlResult == APP_CTRL_RESULT_SUCCEEDED)
{
- const String* pReturnType =
- static_cast<const String*>(pExtraData->GetValue(String(APPCONTROL_KEY_RETURN_TYPE)));
- if (pReturnType != null && pReturnType->CompareTo(APPCONTROL_DATA_CONTACT_ID) == 0)
+ const ArrayList* pResultList =
+ static_cast<const ArrayList*>(pExtraData->GetValue(String(APPCONTROL_KEY_SOCIAL_ITEM_ID)));
+ const String* pContactId = null;
+
+ if (pResultList != null)
{
- const String* pContactId =
- static_cast<const String*>(pExtraData->GetValue(String(APPCONTROL_KEY_VALUE)));
- SceneManager* pSceneManager = SceneManager::GetInstance();
- long long lresult = 0;
- if (pContactId != null && pContactId->GetLength() > 0)
- {
- LongLong::Parse(*pContactId, lresult);
- }
+ pContactId = static_cast<const String*>(pResultList->GetAt(0));
+ }
+
+ long long lresult = 0;
+ if (pContactId != null && pContactId->GetLength() > 0)
+ {
+ LongLong::Parse(*pContactId, lresult);
+ String filePath = __pPresentationModel->GetFilePathAt(__pGallery->GetCurrentItemIndex());
+ String cropMode = "fit-to-screen";
ArrayList* pList = new (std::nothrow) ArrayList(SingleObjectDeleter);
- pList->Add(new (std::nothrow) Integer(__pGallery->GetCurrentItemIndex()));
+ pList->Add(new (std::nothrow) String(filePath));
+ pList->Add(new (std::nothrow) String(cropMode));
pList->Add(new (std::nothrow) Integer(SET_AT_TYPE_CALLER_IMAGE));
pList->Add(new (std::nothrow) LongLong(lresult));
- __pPresentationModel->SetSetterIndex(__pGallery->GetCurrentItemIndex());
- pSceneManager->GoForward(ForwardSceneTransition(IDSCN_IMAGE_SETTER), pList);
+ SceneManager* pSceneManager = SceneManager::GetInstance();
+ pSceneManager->GoForward(ForwardSceneTransition(IDSCN_IMAGE_CROP), pList);
}
}
pCanvas->Clear();
__pGallery->SetShowState(true);
delete pCanvas;
- pCanvas = null;
}
AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
}
void
ImageViewerForm::OnTimerExpired(Timer &timer)
{
- AppLogDebug("ENTER");
+ AppLog("ImageViewerForm::OnTimerExpired");
+
+ if(timer.Equals(*__pShuffelTimer) == true)
+ {
+ AppLog("OnTimerExpired __pShuffelTimer");
+ int curItemIndex = __pGallery->GetCurrentItemIndex();
+ int index = __pShuffledList[curItemIndex];
+
+ __shuffle = false;
+
+ __pGallery->UpdateGallery();
+
+ AppLog("ImageViewerForm::OnGallerySlideShowStopped index = %d, shuffelIndex = %d", curItemIndex, index);
+
+ __pGallery->SetCurrentItemIndex(index);
+ __pGallery->Draw();
+
+ SlideShowStopped(index);
+ return;
+ }
+
+ int repeatValue = 0;
+ int shuffleValue = 0;
+
if (__pPresentationModel->GetFileCount() > 1)
{
- __pGallery->StartSlideShow(true);
+ __pSettingPresentationModel->GetValue(SECTION_NAME_IMAGE_VIEWER,
+ ENTRY_NAME_IMAGE_VIEWER_REPEAT_VALUE, repeatValue);
+
+ __pSettingPresentationModel->GetValue(SECTION_NAME_IMAGE_VIEWER,
+ ENTRY_NAME_IMAGE_VIEWER_SHUFFLE_VALUE, shuffleValue);
+
+ if (shuffleValue != 0)
+ {
+ __shuffelStartIndex = __pGallery->GetCurrentItemIndex();
+ CreateShuffledList(__pPresentationModel->GetFileCount());
+ __shuffle = true;
+ }
+ else
+ {
+ __shuffelStartIndex = 0;
+ __shuffle = false;
+ }
+
+ if ( repeatValue == 0)
+ {
+ __pGallery->StartSlideShow(false);
+ }
+ else
+ {
+ __pGallery->StartSlideShow(true);
+ }
}
AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
}
void
+ImageViewerForm::CreateShuffledList(int count)
+{
+ AppLogDebug("ImageViewerForm::CreateShuffledList ENTER");
+ if(__pShuffledList == null)
+ {
+ __pShuffledList = new (std::nothrow) int[count];
+ for(int i = 0; i < count; i++)
+ {
+ __pShuffledList[i] = i;
+ }
+ }
+ for(int i = count - 1; i > 1; i--)
+ {
+ int randomNum = Math::Rand() % (i+1);
+ int t = __pShuffledList[randomNum];
+ __pShuffledList[randomNum] = __pShuffledList[i];
+ __pShuffledList[i] = t;
+ }
+
+ for(int i = 0; i < count; i++)
+ {
+ AppLogDebug("ShuffeldList i = %d & Val = %d", i, __pShuffledList[i]);
+ }
+
+ AppLogDebug("ImageViewerForm::CreateShuffledList EXIT");
+}
+
+void
ImageViewerForm::OnContentTransferInProgress(RequestId requestId, int totalReceivedSize)
{
AppLogDebug("ENTER");
pImage->DecodeUrl(uri, BITMAP_PIXEL_FORMAT_RGB565, 720, 1280, reqId, *this, 5000);
delete pImage;
- pImage = null;
AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
}
AppLogDebug("ImageViewerForm::OnImageDecodeUrlReceived [%s]", GetErrorMessage(r));
}
- delete pImage;
- pImage = null;
- AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
+ delete pImage;
+ AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
}
void
if (__pPresentationModel->GetFileCount() <= 0)
{
AppLogDebug("EXIT 1(%s)", GetErrorMessage(GetLastResult()));
-
return;
}
- String combineText = EMPTY_SPACE;
-
String filePath = __pPresentationModel->GetFilePathAt(currentIndex);
- if (filePath.EndsWith(CONTENT_EXT_PNG)
- || filePath.EndsWith(CONTENT_EXT_BMP)
- || filePath.EndsWith(CONTENT_EXT_JPG)
- || filePath.EndsWith(CONTENT_EXT_GIF)
- || filePath.EndsWith(CONTENT_EXT_TIF)
- || filePath.EndsWith(CONTENT_EXT_MP4)
- || filePath.EndsWith(CONTENT_EXT_3GP)
- || filePath.EndsWith(CONTENT_EXT_AVI)
- || filePath.EndsWith(CONTENT_EXT_RM)
- || filePath.EndsWith(CONTENT_EXT_WMV)
- || filePath.EndsWith(CONTENT_EXT_ASF))
- {
- if (combineText.CompareTo(EMPTY_SPACE) != 0)
- {
- combineText.Append(L";");
- }
+ HashMap* pDataList = new (std::nothrow) HashMap(SingleObjectDeleter);
+ pDataList->Construct();
+
+ ArrayList* pList = new (std::nothrow) ArrayList(SingleObjectDeleter);
+ pList->Add(new (std::nothrow) String(filePath));
+
+ pDataList->Add(new (std::nothrow) String(APPCONTROL_KEY_PATH), pList);
+
+ __pPresentationModel->StartAppControl(APPCONTROL_PROVIDER_ID_EMAIL, APPCONTROL_OPERATION_ID_COMPOSE,
+ new (std::nothrow) String(APPCONTROL_URI_MAIL_TO), null, pDataList, this);
+ AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
+}
- combineText.Append(filePath);
+void
+ImageViewerForm::OnRequestMessagesAction(void)
+{
+ AppLogDebug("ENTER");
+ int currentIndex = __pGallery->GetCurrentItemIndex();
+
+ if (__pPresentationModel->GetFileCount() <= 0)
+ {
+ AppLogDebug("EXIT 1(%s)", GetErrorMessage(GetLastResult()));
+ return;
}
+ String filePath = __pPresentationModel->GetFilePathAt(currentIndex);
+
HashMap* pDataList = new (std::nothrow) HashMap(SingleObjectDeleter);
pDataList->Construct();
- pDataList->Add(new (std::nothrow) String(APPCONTROL_KEY_ATTACHMENTS),
- new (std::nothrow) String(combineText));
+ ArrayList* pList = new (std::nothrow) ArrayList(SingleObjectDeleter);
+ pList->Add(new (std::nothrow) String(filePath));
+ pDataList->Add(new (std::nothrow) String(APPCONTROL_KEY_PATH), pList);
+ pDataList->Add(new (std::nothrow) String(APPCONTROL_KEY_MESSAGE_TYPE), new (std::nothrow) String(APPCONTROL_DATA_MMS));
- __pPresentationModel->StartAppControl(APPCONTROL_PROVIDER_ID_EMAIL,
- APPCONTROL_OPERATION_ID_COMPOSE, pDataList, this);
+ __pPresentationModel->StartAppControl(APPCONTROL_PROVIDER_ID_MESSAGES, APPCONTROL_OPERATION_ID_COMPOSE, null,
+ null, pDataList, this);
AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
}
if (pBitmap != null)
{
ImageViewerMediaType mediaType = CommonUtil::GetMediaType(filePath);
+
if (mediaType == IMAGE_VIEWER_MEDIA_TYPE_IMAGE)
{
- ImageMetadata* pImgMeta = ContentManagerUtil::GetImageMetaN(filePath);
-
- if (pImgMeta != null)
- {
- Dimension srcDim(pImgMeta->GetWidth(), pImgMeta->GetHeight());
- pBitmap->Scale(srcDim);
- delete pImgMeta;
- }
- else
+ ImageBuffer* imageBuffer = new (std::nothrow) ImageBuffer();
+ result r = imageBuffer->Construct(filePath);
+ if (r == E_SUCCESS)
{
- ImageBuffer* imageBuffer = new (std::nothrow) ImageBuffer();
- result r = imageBuffer->Construct(filePath);
- if (r == E_SUCCESS)
+ if (imageBuffer->GetExifOrientation() == EXIF_ORIENTATION_RIGHT_TOP
+ || imageBuffer->GetExifOrientation() == EXIF_ORIENTATION_LEFT_BOTTOM)
+ {
+ Dimension srcDim(imageBuffer->GetHeight(), imageBuffer->GetWidth());
+ pBitmap->Scale(srcDim);
+ }
+ else
{
Dimension srcDim(imageBuffer->GetWidth(), imageBuffer->GetHeight());
pBitmap->Scale(srcDim);
- delete imageBuffer;
}
+
+ delete imageBuffer;
}
}
else if (mediaType == IMAGE_VIEWER_MEDIA_TYPE_VIDEO)
{
Canvas mainCanvas;
mainCanvas.Construct(DUMMY_IMAGE_RECTANGLE);
- mainCanvas.FillRectangle(Color::GetColor(COLOR_ID_WHITE), DUMMY_IMAGE_RECTANGLE);
+ mainCanvas.FillRectangle(Color::GetColor(COLOR_ID_BLACK), DUMMY_IMAGE_RECTANGLE);
pBitmap = new (std::nothrow) Bitmap();
pBitmap->Construct(mainCanvas, DUMMY_IMAGE_RECTANGLE);
}
AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
return pBitmap;
}
+
+void ImageViewerForm::OnFormFileEventOccuered(const int index, const unsigned long eventId)
+{
+ AppLogDebug(" ENTER");
+
+ int currentIndex = __pGallery->GetCurrentItemIndex();
+ int fileCount = __pPresentationModel->GetFileCount();
+
+ if (fileCount == 0 && eventId == IV_FILE_DELETE)
+ {
+ UiApp* pApp = UiApp::GetInstance();
+ pApp->Terminate();
+ AppLogDebug("EXIT 2(%s)", GetErrorMessage(GetLastResult()));
+ }
+
+ if (fileCount <= currentIndex && eventId == IV_FILE_DELETE)
+ {
+ currentIndex = fileCount - 1;
+ }
+ else if (eventId == IV_FILE_CREATE)
+ {
+ currentIndex = index;
+ }
+
+
+ String strItemIdxText(EMPTY_SPACE);
+ __pGallery->SetCurrentItemIndex(currentIndex);
+ __pGallery->UpdateGallery();
+ String filePath = __pPresentationModel->GetFilePathAt(currentIndex);
+ __pPresentationModel->RequestImage(filePath);
+
+ GetLabelText(currentIndex,strItemIdxText);
+ __pLabel->SetText(strItemIdxText);
+
+ if (__visible == true)
+ {
+ ImageViewerMediaType mediaType = CommonUtil::GetMediaType(filePath);
+
+ if (mediaType == IMAGE_VIEWER_MEDIA_TYPE_IMAGE)
+ {
+ __pPlayButton->SetShowState(false);
+ }
+ else
+ {
+ __pPlayButton->SetShowState(true);
+ }
+ }
+ if (__detail == false)
+ {
+ __pScrollPanel->SetShowState(false);
+ __detail = true;
+ }
+
+ Invalidate(true);
+ AppLogDebug("EXIT");
+}
+
+void
+ImageViewerForm::OnSlideSettingPopUpItemSelected(int index)
+{
+ if ( __pPopUp != NULL)
+ {
+ __pPopUp->SetShowState(false);
+ }
+
+ if (index == 0) // start slide show
+ {
+ int repeatValue = 0;
+ int interval = 0 ;
+ int transitioneffect = 0;
+
+ if (__pPresentationModel->GetFileCount() > 1)
+ {
+ int shuffleValue;
+ __pSettingPresentationModel->GetValue(SECTION_NAME_IMAGE_VIEWER,
+ ENTRY_NAME_IMAGE_VIEWER_SLIDESHOW_INTERVAL, interval);
+
+ interval = interval * 1000;
+ AppLogDebug("The slide interval is %d", interval);
+ __pGallery->SetSlideShowViewDuration(interval);
+
+
+ __pGallery->UpdateGallery();
+
+ if (__detail == false)
+ {
+ ShowPanelDetail(false);
+ }
+
+ __pSettingPresentationModel->GetValue(SECTION_NAME_IMAGE_VIEWER,
+ ENTRY_NAME_IMAGE_VIEWER_REPEAT_VALUE, repeatValue);
+
+ __pSettingPresentationModel->GetValue(SECTION_NAME_IMAGE_VIEWER,
+ ENTRY_NAME_IMAGE_VIEWER_SHUFFLE_VALUE, shuffleValue);
+
+ __pSettingPresentationModel->GetValue(SECTION_NAME_IMAGE_VIEWER,
+ ENTRY_NAME_IMAGE_VIEWER_SLIDESHOW_TRANSITION_EFFECT, transitioneffect);
+
+ if (transitioneffect == 1)
+ {
+ __pGallery->SetSlideShowAnimation(GALLERY_ANIMATION_DISSOLVE);
+ }
+ else if (transitioneffect == 2)
+ {
+ __pGallery->SetSlideShowAnimation(GALLERY_ANIMATION_ZOOM);
+ }
+ else
+ {
+ __pGallery->SetSlideShowAnimation(GALLERY_ANIMATION_PAGE);
+ }
+
+ if (shuffleValue != 0)
+ {
+ __shuffelStartIndex = __pGallery->GetCurrentItemIndex();
+ CreateShuffledList(__pPresentationModel->GetFileCount());
+ __shuffle = true;
+ }
+ else
+ {
+ __shuffelStartIndex = 0;
+ __shuffle = false;
+ }
+
+ if (repeatValue == 0)
+ {
+ __pGallery->StartSlideShow(false);
+ }
+ else
+ {
+ __pGallery->StartSlideShow(true);
+ }
+ }
+ }
+ else if (index == 1) // launch settings
+ {
+ __pPresentationModel->StartAppControl(APPCONTROL_PROVIDER_ID_GALLERY,
+ APPCONTROL_OPERATION_ID_CONFIGURE, null, null, null, this);
+ }
+}