#include <FApp.h>
#include <FBase.h>
#include <FContent.h>
+#include <FCntIContentScanListener.h>
#include <FGraphics.h>
#include <FIo.h>
#include <FUi.h>
#include "GlTypes.h"
class AlbumInfo;
+class IAlbumRenameEventListener;
class AlbumListPresentationModel
: public Tizen::Base::Object
, public IThumbnailEventListener
+ , public Tizen::Content::IContentScanListener
{
public:
static AlbumListPresentationModel* GetInstance(void);
AppControlMediaType GetAppControlMediaType(void) const;
AppControlSelectionMode GetAppControlSelectionMode(void) const;
+ result RenameAlbum(const Tizen::Base::String&, const Tizen::Base::String&, IAlbumRenameEventListener*);
+
virtual void OnThumbnailReceivedN(Tizen::Base::Runtime::IEventArg& eventArg);
+ //From IContentScanListener
+ virtual void OnContentScanCompleted (RequestId reqId, const Tizen::Base::String &scanPath, result r);
+
private:
AlbumListPresentationModel(void);
virtual ~AlbumListPresentationModel(void);
static ThumbnailEvent* __pThumbnailEvent;
static Tizen::Base::Collection::ArrayList* __pPresentationModelListener;
-
static Tizen::Base::Collection::IList* __pAlbumInfoList;
+ IAlbumRenameEventListener* __pAlbumListener;
+ RequestId __reqId;
+
AppControlMode __appControlMode;
AppControlMediaType __appControlMediaType;
AppControlSelectionMode __appControlSelectionMode;
#include <FSystem.h>
#include <FUi.h>
-
+#include "GlAlbumRenameEventListener.h"
#include "GlBaseForm.h"
#include "GlFileOpInvalidateListener.h"
#include "GlTypes.h"
class AlbumListPresentationModel;
class FileListPresentationModel;
class FileMoveTimer;
+class ProgressAnimation;
class AlbumNameEditorForm
: public BaseForm
, public Tizen::Ui::Controls::IFormBackEventListener
, public Tizen::Ui::Scenes::ISceneEventListener
, public IFileOpInvalidateListener
+ , public IAlbumRenameEventListener
{
public:
AlbumNameEditorForm();
void OnFileOpInvalidate(enum FileActionMode __actionId);
void OnFileOpComplete(enum FileActionMode __actionId, enum FileActionCompleteRes);
+ //From IAlbumRenameEventListener
+ void OnAlbumRenameComplete( void );
+
+private:
+ void OnCreateAlbum(void);
+ void OnRenameAlbum(const Tizen::Base::String& );
+
private:
Tizen::Ui::Controls::EditField* __pNameEditField;
Tizen::Base::String __nameEditFieldText;
Tizen::Base::Collection::IList* __pMoveIndexList;
FileMoveTimer* __pFileMove;
+ ProgressAnimation* __pProgressAnim;
};
#endif /* _GL_ALBUM_NAME_EDITOR_FORM_H_ */
--- /dev/null
+//
+// Copyright (c) 2012 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Flora License, Version 1.0 (the License);
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://floralicense.org/license/
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an AS IS BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+/**
+ * @file GlAlbumRenameEventListener.h
+ * @brief This is the header file for GlAlbumRenameEventListener class.
+ */
+
+#ifndef _GL_ALBUM_RENAME_LISTENER_H_
+#define _GL_ALBUM_RENAME_LISTENER_H_
+
+class IAlbumRenameEventListener
+{
+public:
+ virtual ~IAlbumRenameEventListener(void) {}
+ virtual void OnAlbumRenameComplete( void ) = 0;
+
+};
+
+#endif /* _GL_ALBUM_RENAME_LISTENER_H_ */
--- /dev/null
+//
+// Copyright (c) 2012 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Flora License, Version 1.0 (the License);
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://floralicense.org/license/
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an AS IS BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+/**
+ * @file GlProgressAnimation.h
+ * @brief This is the header file for GlProgressAnimation class.
+ */
+
+#ifndef _GLPROGRESSANIMATION_H_
+#define _GLPROGRESSANIMATION_H_
+
+#include <FBase.h>
+#include <FUi.h>
+#include <FMedia.h>
+#include <FApp.h>
+#include <FGraphics.h>
+
+class ProgressAnimation
+ : public Tizen::Ui::Controls::Panel
+{
+public:
+ ProgressAnimation(void);
+ virtual ~ProgressAnimation(void);
+
+ result Construct(Tizen::Graphics::Rectangle rect);
+
+ void AnimationStart(void);
+ void AnimationStop(void);
+
+private:
+ static const int DURATION = 500;
+ static const int PROGRESS_COUNT = 30;
+
+ Tizen::Ui::Controls::Animation* __pAnimation;
+ Tizen::Base::Collection::ArrayList* __pAnimationFrameList;
+
+};
+
+#endif // _GLPROGRESSANIMATION_H_
COMPLETE_SYS_FAILURE
};
+enum AlbumAction
+{
+ ALBUM_CREATE,
+ ALBUM_RENAME
+};
+
extern const wchar_t* IDL_FORM_ALBUM_LIST;
extern const wchar_t* IDL_FORM_ALBUM_LIST_EDITOR;
extern const wchar_t* IDL_FORM_FILE_LIST;
extern const wchar_t* IDB_ALBUM_ICON_DOWNLOAD;
extern const wchar_t* IDB_ALBUM_ICON_CAMERA;
+extern const wchar_t* IDB_BUTTON_CIRCLE_BACKGROUND;
+extern const wchar_t* IDB_BUTTON_RENAME;
+extern const wchar_t* IDB_CONTROLBAR_CAMERA;
+extern const wchar_t* IDB_CONTROLBAR_DELETE;
+extern const wchar_t* IDB_CONTROLBAR_DELETE_DIM;
+extern const wchar_t* IDB_CONTROLBAR_MORE;
+extern const wchar_t* IDB_CONTROLBAR_MORE_DISABLED;
+extern const wchar_t* IDB_CONTROLBAR_SHARE;
+extern const wchar_t* IDB_CONTROLBAR_SHARE_DIM;
+extern const wchar_t* IDB_LISTVIEW_EMPTY;
+extern const wchar_t* IDB_MAIN_FOLDER_BACKGROUND;
+extern const wchar_t* IDB_VIDEOTHUMBNAIL_BG;
+extern const wchar_t* IDB_VIDEOTHUMBNAIL_BOOKMARK;
+extern const wchar_t* IDB_VIDEOTHUMBNAIL_FAVORITE;
+extern const wchar_t* IDB_VIDEOTHUMBNAIL_PLAY;
+extern const wchar_t* IDB_BUTTON_MOVE_SELECTION;
+extern const wchar_t* IDB_NO_CONTENTS_BROKEN;
+extern const wchar_t* IDB_LIST_EXPAND_CLOSED;
+extern const wchar_t* IDB_LIST_EXPAND_CLOSED_PRESS;
+extern const wchar_t* IDB_LIST_EXPAND_OPENED;
+extern const wchar_t* IDB_LIST_EXPAND_OPENED_PRESS;
+extern const wchar_t* IDB_ALBUM_EDIT_RENAME_BG;
+extern const wchar_t* IDB_ALBUM_EDIT_RENAME;
+
+extern const wchar_t* IDB_ALBUM_RENAME_PROGRESS1;
+extern const wchar_t* IDB_ALBUM_RENAME_PROGRESS2;
+extern const wchar_t* IDB_ALBUM_RENAME_PROGRESS3;
+extern const wchar_t* IDB_ALBUM_RENAME_PROGRESS4;
+extern const wchar_t* IDB_ALBUM_RENAME_PROGRESS5;
+extern const wchar_t* IDB_ALBUM_RENAME_PROGRESS6;
+extern const wchar_t* IDB_ALBUM_RENAME_PROGRESS7;
+extern const wchar_t* IDB_ALBUM_RENAME_PROGRESS8;
+extern const wchar_t* IDB_ALBUM_RENAME_PROGRESS9;
+extern const wchar_t* IDB_ALBUM_RENAME_PROGRESS10;
+
+extern const wchar_t* IDB_ALBUM_RENAME_PROGRESS11;
+extern const wchar_t* IDB_ALBUM_RENAME_PROGRESS12;
+extern const wchar_t* IDB_ALBUM_RENAME_PROGRESS13;
+extern const wchar_t* IDB_ALBUM_RENAME_PROGRESS14;
+extern const wchar_t* IDB_ALBUM_RENAME_PROGRESS15;
+extern const wchar_t* IDB_ALBUM_RENAME_PROGRESS16;
+extern const wchar_t* IDB_ALBUM_RENAME_PROGRESS17;
+extern const wchar_t* IDB_ALBUM_RENAME_PROGRESS18;
+extern const wchar_t* IDB_ALBUM_RENAME_PROGRESS19;
+extern const wchar_t* IDB_ALBUM_RENAME_PROGRESS20;
+
+extern const wchar_t* IDB_ALBUM_RENAME_PROGRESS21;
+extern const wchar_t* IDB_ALBUM_RENAME_PROGRESS22;
+extern const wchar_t* IDB_ALBUM_RENAME_PROGRESS23;
+extern const wchar_t* IDB_ALBUM_RENAME_PROGRESS24;
+extern const wchar_t* IDB_ALBUM_RENAME_PROGRESS25;
+extern const wchar_t* IDB_ALBUM_RENAME_PROGRESS26;
+extern const wchar_t* IDB_ALBUM_RENAME_PROGRESS27;
+extern const wchar_t* IDB_ALBUM_RENAME_PROGRESS28;
+extern const wchar_t* IDB_ALBUM_RENAME_PROGRESS29;
+extern const wchar_t* IDB_ALBUM_RENAME_PROGRESS30;
static const unsigned int CUSTOM_COLOR_GREY = Tizen::Graphics::Color32<124,124,124>::Value;
static const unsigned int CUSTOM_COLOR_TRANSPARENT = Tizen::Graphics::Color32<0,0,0>::Value;
static const unsigned int CUSTOM_COLOR_SETTINGS_LISTITEM_BACKGROUND = Tizen::Graphics::Color32<248, 246, 239>::Value;
static const unsigned int CUSTOM_COLOR_SETTINGS_LISTITEM_RADIO_BACKGROUND = Tizen::Graphics::Color32<220, 218, 211>::Value;
static const unsigned int CUSTOM_COLOR_SETTINGS_GROUPTITLE = Tizen::Graphics::Color32<59, 115, 182>::Value;
+static const int ALBUM_FIRST_ELEMENT = 0;
+
#endif /* _GL_TYPES_H_ */
static const Color COLOR_FOLDER_BITMAP_DIM(Color::GetColor(COLOR_ID_BLACK));
static const int ALPHA_FOLDER_BITMAP_DIM = 70;
+static const int IDA_ALBUM_EDIT = 503 ;
+
AlbumListEditorForm::AlbumListEditorForm()
- : __checkedCount(0)
- , __pSelectCountLabel(null)
- , __pEditorFolderIconList(null)
- , __pShareContextMenu(null)
- , __pDeletePopup(null)
- , __pPresentationModel(null)
+: __checkedCount(0)
+, __pSelectCountLabel(null)
+, __pEditorFolderIconList(null)
+, __pShareContextMenu(null)
+, __pDeletePopup(null)
+, __pPresentationModel(null)
{
AppLogDebug("ENTER");
__overlayMsg = false;
{
AppLogDebug("ENTER : index(%d)", index);
Bitmap* pBitmap = null;
- IconListViewItem* pIconListview = new IconListViewItem();
+ Canvas* pEditAlbumCanvas = null;
+ Bitmap* pEditAlbumBitmap = null;
+ Bitmap* pBitmapRenameBg = null;
+ Bitmap* pBitmapRename = null;
+ int canvasWidth = 64;
+ int canvasHeight = 64;
+
+ IconListViewItem* pIconListviewItem = new IconListViewItem();
IList* pAlbumInfoList = __pPresentationModel->GetAlbumInfoList();
AlbumInfo* pAlbumInfo = static_cast<AlbumInfo*>(pAlbumInfoList->GetAt(index));
canvas.FillRectangle(dimColor, canvas.GetBounds());
Bitmap* pSelectedBitmap = new (std::nothrow) Bitmap();
pSelectedBitmap->Construct(canvas, canvas.GetBounds());
- pIconListview->Construct(*pBitmap, null, pSelectedBitmap);
+ pIconListviewItem->Construct(*pBitmap, null, pSelectedBitmap);
delete pSelectedBitmap;
}
}
else
{
- pIconListview->Construct(*pBitmap);
+ pIconListviewItem->Construct(*pBitmap);
}
if (pBitmap != null)
{
delete pBitmap;
}
+
+ pBitmapRenameBg = ResourceManager::GetBitmapN(IDB_ALBUM_EDIT_RENAME_BG);
+ pBitmapRename = ResourceManager::GetBitmapN(IDB_ALBUM_EDIT_RENAME);
+
+ if ( pBitmapRenameBg != null && pBitmapRename != null)
+ {
+
+ pEditAlbumCanvas = new (std::nothrow) Canvas();
+ pEditAlbumCanvas->Construct(Rectangle(0,0,canvasWidth,canvasHeight));
+ pEditAlbumCanvas->DrawBitmap(Point(0,0),*pBitmapRenameBg);
+ pEditAlbumCanvas->DrawBitmap(Point(0,0),*pBitmapRename);
+
+
+ pEditAlbumBitmap = new (std::nothrow) Bitmap();
+
+ if ( pEditAlbumBitmap != NULL)
+ {
+ pEditAlbumBitmap->Construct(*pEditAlbumCanvas,Rectangle(0,0,canvasWidth,canvasHeight));
+ delete pEditAlbumCanvas;
+ }
+
+ pIconListviewItem->SetOverlayBitmap(IDA_ALBUM_EDIT, pEditAlbumBitmap, ALIGNMENT_RIGHT, ALIGNMENT_TOP);
+ }
+
+
AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
- return pIconListview;
+ return pIconListviewItem;
}
void
{
if (status == ICON_LIST_VIEW_ITEM_CHECKED)
{
- --__checkedCount;
+ ++__checkedCount;
}
else if (status == ICON_LIST_VIEW_ITEM_UNCHECKED)
{
- ++__checkedCount;
+ --__checkedCount;
}
String tempString;
AppLogDebug("ENTER");
SceneManager* pSceneManager = SceneManager::GetInstance();
- if (overlayBitmapId == ACTION_ID_EDITE_FOLDER)
- {
- ArrayList* pSelectedIndex = new (std::nothrow) ArrayList(SingleObjectDeleter);
- pSelectedIndex->Construct();
- pSelectedIndex->Add(new (std::nothrow) Integer(index));
+ ArrayList* pSelectedIndex = new (std::nothrow) ArrayList(SingleObjectDeleter);
+ pSelectedIndex->Construct();
+ //Adding the Action Type
+ pSelectedIndex->Add(new (std::nothrow) Integer(ALBUM_RENAME));
+ pSelectedIndex->Add(new (std::nothrow) Integer(index));
- pSceneManager->GoForward(ForwardSceneTransition(IDSCN_ALBUM_NAME_EDITOR), pSelectedIndex);
- }
+ pSceneManager->GoForward(ForwardSceneTransition(IDSCN_ALBUM_NAME_EDITOR), pSelectedIndex);
AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
}
{
__pAlbumViewIconList->UpdateList();
}
+
+ Invalidate(true);
AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
}
#include "GlAlbumInfo.h"
#include "GlAlbumListPresentationModel.h"
+#include "GlAlbumRenameEventListener.h"
#include "GlGalleryApp.h"
#include "GlThumbnailEvent.h"
#include "GlThumbnailEventArg.h"
IList* AlbumListPresentationModel::__pAlbumInfoList = null;
AlbumListPresentationModel::AlbumListPresentationModel(void)
-: __pFolderBackgroundBitmap(null)
-, __appControlMode(APP_CONTROL_MODE_MAIN)
-, __appControlMediaType(APPCONTROL_MEDIA_TYPE_IMAGE)
-, __appControlSelectionMode(APPCONTROL_SELECTION_MODE_SINGLE)
+ : __pFolderBackgroundBitmap(null)
+ , __appControlMode(APP_CONTROL_MODE_MAIN)
+ , __appControlMediaType(APPCONTROL_MEDIA_TYPE_IMAGE)
+ , __pAlbumListener(null)
+ , __appControlSelectionMode(APPCONTROL_SELECTION_MODE_SINGLE)
{
AppLogDebug("ENTER");
AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
}
+result
+AlbumListPresentationModel::RenameAlbum(const String& orgPath, const String& newPath,
+ IAlbumRenameEventListener* pAlbumListener)
+{
+ AppLogDebug("ENTER");
+ result r = Directory::Rename(orgPath, newPath);
+ if (IsFailed(r))
+ {
+ AppLogDebug("Album Rename failed(%s)", GetErrorMessage(r));
+ }
+ else
+ {
+ __pAlbumListener = pAlbumListener;
+ r = ContentManager::ScanDirectory(Tizen::System::Environment::GetMediaPath(), true, this, __reqId);
+ AppLogDebug("Content scan failed (%s)", GetErrorMessage(r));
+ }
+ AppLogDebug("EXIT");
+ return r;
+}
+
+void AlbumListPresentationModel::OnContentScanCompleted (RequestId reqId, const Tizen::Base::String &scanPath, result r)
+{
+ AppLogDebug("ENTER");
+ if ( __pAlbumListener && __reqId == reqId )
+ {
+ InitializeAlbumInfoList(CONTENT_TYPE_ALL);
+ __pAlbumListener->OnAlbumRenameComplete();
+ }
+ AppLogDebug("EXIT");
+
+}
+
void
AlbumListPresentationModel::DrawPartialImage(Canvas& canvas, AlbumInfo* pAlbumInfo, const Rectangle& rectNew)
{
#include "GlAlbumNameEditorForm.h"
#include "GlAlbumListPresentationModel.h"
#include "GlFileListPresentationModel.h"
+#include "GlProgressAnimation.h"
#include "GlResourceManager.h"
#include "GlTypes.h"
#include "GlFileMoveTimer.h"
static const unsigned int COLOR_NAME_EDIT_FIELD = Color32<255, 255, 255>::Value;
static const int ALBUM_MAX_LENGTH = 255;
+
AlbumNameEditorForm::AlbumNameEditorForm()
: __pNameEditField(null)
, __folderIndex(0)
, __pFilePresentationModel(null)
, __pMoveIndexList(null)
,__pFileMove(null)
+,__pProgressAnim(null)
{
AppLogDebug("ENTER");
__overlayMsg = false;
AppLogDebug("ENTER");
AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
__pFilePresentationModel = FileListPresentationModel::GetInstance();
+
+
+ __pNameEditField = new (std::nothrow) EditField();
+ __pNameEditField->Construct(RECT_NAME_EDIT_FIELD, EDIT_FIELD_STYLE_NORMAL, INPUT_STYLE_OVERLAY,
+ EDIT_FIELD_TITLE_STYLE_NONE, true, ALBUM_MAX_LENGTH);
+ __pNameEditField->AddTextEventListener(*this);
+ __pNameEditField->SetColor(EDIT_STATUS_NORMAL, COLOR_NAME_EDIT_FIELD);
+ __pNameEditField->SetOverlayKeypadCommandButtonVisible(false);
+
+ AddControl(*__pNameEditField);
+ __pNameEditField->AddActionEventListener(*this);
+
return E_SUCCESS;
}
}
void
+AlbumNameEditorForm::OnRenameAlbum(const String& strOri)
+{
+ AppLogDebug("Rename Album");
+ String path;
+ path.Append(Tizen::System::Environment::GetMediaPath());
+ path.Append(__nameEditFieldText);
+
+ //Rename
+ result r = __pPresentationModel->RenameAlbum(strOri, path, this);
+ if (IsFailed(r))
+ {
+ AppLogDebug("Unable to rename Album %s", GetErrorMessage(r));
+ if (__pMessageBox == null)
+ {
+ __pMessageBox = new (std::nothrow) MessageBox();
+ __pMessageBox->Construct(L"", L"Unable to rename", MSGBOX_STYLE_NONE, 3000);
+ int modalResult = 0;
+ __overlayMsg = true;
+ __pMessageBox->ShowAndWait(modalResult);
+ __overlayMsg = false;
+ delete __pMessageBox;
+ __pMessageBox = null;
+ SceneManager* pSceneManager = SceneManager::GetInstance();
+ pSceneManager->GoBackward(BackwardSceneTransition(__callerSceneId));
+ }
+ }
+ else
+ {
+ //Add a popup here..
+ Rectangle clientRect= GetClientAreaBounds();
+ Rectangle rect(0,0,clientRect.width,clientRect.height);
+ __pProgressAnim = new (std::nothrow) ProgressAnimation;
+ __pProgressAnim->Construct(rect);
+ AddControl(*__pProgressAnim);
+ __pProgressAnim->SetShowState(true);
+ __pProgressAnim->AnimationStart();
+ __pProgressAnim->Draw();
+ __overlayMsg = true;
+ }
+
+}
+
+void
+AlbumNameEditorForm::OnCreateAlbum(void)
+{
+ String path;
+ __pNameEditField->HideKeypad();
+ __pNameEditField->RequestRedraw();
+ path.Append(Tizen::System::Environment::GetMediaPath());
+ path.Append(__nameEditFieldText);
+
+ if (__previousSceneId != IDSCN_ALL_LIST_EDITOR && __previousSceneId != IDSCN_ALL_LIST_SELECTION)
+ {
+ Directory::Create( path, true);
+ }
+
+ __nameEditFieldPreText = __nameEditFieldText;
+
+ if (path.IsEmpty())
+ {
+ AppLogDebug("EXIT 1(%s)", GetErrorMessage(GetLastResult()));
+ delete __pMoveIndexList;
+ __pMoveIndexList = null;
+ return ;
+ }
+
+ if (__pMoveIndexList == null || __pMoveIndexList->GetCount() <= 0)
+ {
+ AppLogDebug("EXIT 2(%s)", GetErrorMessage(GetLastResult()));
+ delete __pMoveIndexList;
+ __pMoveIndexList = null;
+ return ;
+ }
+
+ delete __pFileMove;
+ GetMoveFileIndexList(path, __pMoveIndexList, __pFilePresentationModel);
+ __pFileMove = new FileMoveTimer(path, __pMoveIndexList,
+ __pFilePresentationModel,
+ this );
+ result r = __pFileMove->StartTimer();
+
+ if (IsFailed(r))
+ {
+ delete __pFileMove;
+ __pFileMove = null;
+ __pNameEditField->SetText(__nameEditFieldPreText);
+ __pNameEditField->HideKeypad();
+ __pNameEditField->Draw();
+ AppLogDebug("MoveToContentFileList content failed (%s)", GetErrorMessage(r));
+ SceneManager* pSceneManager = SceneManager::GetInstance();
+ pSceneManager->GoBackward(BackwardSceneTransition(__callerSceneId));
+ }
+ else
+ {
+ AppLogDebug("MoveToContentFileList content in progress");
+ __overlayMsg = true;
+ }
+}
+
+void AlbumNameEditorForm::OnAlbumRenameComplete( void )
+{
+ //Hide popup here..
+ __pProgressAnim->AnimationStop();
+ __pProgressAnim->SetShowState(false);
+ RemoveControl(*__pProgressAnim);
+ __overlayMsg = false;
+ SceneManager* pSceneManager = SceneManager::GetInstance();
+ pSceneManager->GoForward(ForwardSceneTransition(IDSCN_ALBUM_LIST));
+}
+
+
+void
AlbumNameEditorForm::OnActionPerformed(const Control& source, int actionId)
{
AppLogDebug("ENTER");
{
case ACTION_ID_BUTTON_CREATE_NAME_DONE:
{
- __pNameEditField->HideKeypad();
- __pNameEditField->RequestRedraw();
- pPath.Append(Tizen::System::Environment::GetMediaPath());
- pPath.Append(__nameEditFieldText);
-
- if (__previousSceneId != IDSCN_ALL_LIST_EDITOR && __previousSceneId != IDSCN_ALL_LIST_SELECTION)
+ if (__albumNameEditorMode == ALBUM_NAME_EDITOR_MODE_CREATE)
{
- Directory::Create( pPath, true);
+ //Create new Album
+ OnCreateAlbum();
}
-
- __nameEditFieldPreText = __nameEditFieldText;
- ArrayList argsList;
- argsList.Construct();
- argsList.Add(new (std::nothrow) String(pPath));
-
-
- if (pPath.IsEmpty())
+ else if (__albumNameEditorMode == ALBUM_NAME_EDITOR_MODE_RENAME)
{
- AppLogDebug("EXIT 1(%s)", GetErrorMessage(GetLastResult()));
- delete __pMoveIndexList;
- __pMoveIndexList = null;
- return ;
+ //Rename a album
+ OnRenameAlbum(strOri);
}
-
- if (__pMoveIndexList == null || __pMoveIndexList->GetCount() <= 0)
- {
- AppLogDebug("EXIT 2(%s)", GetErrorMessage(GetLastResult()));
- delete __pMoveIndexList;
- __pMoveIndexList = null;
- return ;
- }
-
- delete __pFileMove;
- GetMoveFileIndexList(pPath, __pMoveIndexList, __pFilePresentationModel);
- __pFileMove = new FileMoveTimer(pPath, __pMoveIndexList,
- __pFilePresentationModel,
- this );
- result r = __pFileMove->StartTimer();
-
- if (IsFailed(r))
- {
- delete __pFileMove;
- __pFileMove = null;
- __pNameEditField->SetText(__nameEditFieldPreText);
- __pNameEditField->HideKeypad();
- __pNameEditField->Draw();
- pSceneManager->GoBackward(BackwardSceneTransition(__callerSceneId));
- }
- else
- {
- __overlayMsg = true;
- }
-
- AppLogDebug("MoveToContentFileList content failed (%s)", GetErrorMessage(r));
-
break;
}
case ACTION_ID_BUTTON_CREATE_NAME_CANCEL:
__pPresentationModel = AlbumListPresentationModel::GetInstance();
__previousSceneId = previousSceneId;
+ if (pArgs != null)
+ {
+ Integer* albumTypePtr = static_cast<Integer*>(pArgs->GetAt(ALBUM_FIRST_ELEMENT));
+ if (albumTypePtr->ToInt() == ALBUM_CREATE)
+ {
+ AppLogDebug("ALBUM_NAME_EDITOR_MODE_CREATE");
+ __albumNameEditorMode = ALBUM_NAME_EDITOR_MODE_CREATE;
+ }
+ else if (albumTypePtr->ToInt() == ALBUM_RENAME)
+ {
+ AppLogDebug("ALBUM_NAME_EDITOR_MODE_RENAME");
+ __albumNameEditorMode = ALBUM_NAME_EDITOR_MODE_RENAME;
+ }
+ pArgs->RemoveAt(ALBUM_FIRST_ELEMENT, true);
+ }
+
if (previousSceneId == IDSCN_ALBUM_LIST_EDITOR)
{
if (pArgs != null)
AppLogDebug("[MOVE] previousSceneId = IDSCN_ALL_LIST_SELECTION");
}
- __albumNameEditorMode = ALBUM_NAME_EDITOR_MODE_CREATE;
__callerSceneId = previousSceneId;
}
else
{
- __albumNameEditorMode = ALBUM_NAME_EDITOR_MODE_RENAME;
__callerSceneId = EMPTY_SPACE;
}
pHeader->AddActionEventListener(*this);
pHeader->SetItemEnabled(0, false);
- __pNameEditField = new (std::nothrow) EditField();
- __pNameEditField->Construct(RECT_NAME_EDIT_FIELD, EDIT_FIELD_STYLE_NORMAL, INPUT_STYLE_OVERLAY,
- EDIT_FIELD_TITLE_STYLE_NONE, true, ALBUM_MAX_LENGTH);
- __pNameEditField->AddTextEventListener(*this);
- __pNameEditField->SetColor(EDIT_STATUS_NORMAL, COLOR_NAME_EDIT_FIELD);
-
- AddControl(*__pNameEditField);
- __pNameEditField->AddActionEventListener(*this);
-
__nameEditFieldText = EMPTY_SPACE;
__nameEditFieldPreText = EMPTY_SPACE;
__pNameEditField->SetText(__nameEditFieldText);
__nameEditFieldTempText = __nameEditFieldText;
- __pNameEditField->SetOverlayKeypadCommandButtonVisible(false);
+
__pNameEditField->SetFocus();
}
pHeader->AddItem(cancelItem);
pHeader->AddActionEventListener(*this);
- __pNameEditField = new (std::nothrow) EditField();
- __pNameEditField->Construct(RECT_NAME_EDIT_FIELD, EDIT_FIELD_STYLE_NORMAL, INPUT_STYLE_OVERLAY,
- EDIT_FIELD_TITLE_STYLE_NONE, true, ALBUM_MAX_LENGTH);
- __pNameEditField->AddTextEventListener(*this);
- __pNameEditField->SetColor(EDIT_STATUS_NORMAL, COLOR_NAME_EDIT_FIELD);
-
- AddControl(*__pNameEditField);
- __pNameEditField->AddActionEventListener(*this);
String strName;
IList* pAlbumInfoList = __pPresentationModel->GetAlbumInfoList();
__pNameEditField->SetOverlayKeypadCommandButtonVisible(false);
__pNameEditField->SetFocus();
- }
- if (__albumNameEditorMode == ALBUM_NAME_EDITOR_MODE_CREATE)
- {
- __nameEditFieldText = EMPTY_SPACE;
- __nameEditFieldPreText = EMPTY_SPACE;
- __pNameEditField->SetText(__nameEditFieldText);
- }
- else
- {
- IList* pAlbumInfoList = __pPresentationModel->GetAlbumInfoList();
- AlbumInfo* pAlbumInfo = static_cast<AlbumInfo*>(pAlbumInfoList->GetAt(__folderIndex));
- if (pAlbumInfo != null)
- {
- String strName;
- strName = pAlbumInfo->GetAlbumName();
-
- __nameEditFieldText = strName;
- __nameEditFieldPreText = strName;
- __pNameEditField->SetText(__nameEditFieldText);
- }
}
if (pArgs != NULL)
{
AllListEditorPanel* pListEditorPanel = dynamic_cast<AllListEditorPanel*>(pSceneManager->GetCurrentScene()->GetPanel());
IList* pList = pListEditorPanel->GetItemCheckedIndexListN();
-
+ pList->InsertAt(new (std::nothrow) Integer(ALBUM_CREATE), ALBUM_FIRST_ELEMENT);
pSceneManager->GoForward(ForwardSceneTransition(IDSCN_ALBUM_NAME_EDITOR), pList);
}
break;
AllListSelectionPanel* pSelectionPanel = dynamic_cast<AllListSelectionPanel*>
(pSceneManager->GetCurrentScene()->GetPanel());
IList* pList = pSelectionPanel->GetItemCheckedIndexListN();
+ pList->InsertAt(new (std::nothrow) Integer(ALBUM_CREATE), ALBUM_FIRST_ELEMENT);
pSceneManager->GoForward(ForwardSceneTransition(IDSCN_ALBUM_NAME_EDITOR), pList);
}
break;
--- /dev/null
+//
+// Copyright (c) 2012 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Flora License, Version 1.0 (the License);
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://floralicense.org/license/
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an AS IS BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+/**
+ * @file GlProgressAnimation.cpp
+ * @brief This is the implementation file for GlProgressAnimation class.
+ */
+
+#include "GlProgressAnimation.h"
+#include "GlTypes.h"
+
+using namespace Tizen::App;
+using namespace Tizen::Base;
+using namespace Tizen::Base::Collection;
+using namespace Tizen::Media;
+using namespace Tizen::Ui;
+using namespace Tizen::Ui::Controls;
+using namespace Tizen::Graphics;
+
+ProgressAnimation::ProgressAnimation(void)
+ : __pAnimation(null)
+ , __pAnimationFrameList(null)
+{
+
+}
+
+
+ProgressAnimation::~ProgressAnimation(void)
+{
+ if(__pAnimationFrameList != null)
+ {
+ __pAnimationFrameList->RemoveAll(true);
+ delete __pAnimationFrameList;
+ __pAnimationFrameList = null;
+ }
+}
+
+result
+ProgressAnimation::Construct(Tizen::Graphics::Rectangle rect)
+{
+ result r = E_SUCCESS;
+ Panel::Construct(rect);
+
+ // Create Bitmap
+ AppResource *pAppResource = Application::GetInstance()->GetAppResource();
+ if (pAppResource != null)
+ {
+ Bitmap *pBitmap0 = pAppResource->GetBitmapN(IDB_ALBUM_RENAME_PROGRESS1);
+ Bitmap *pBitmap1 = pAppResource->GetBitmapN(IDB_ALBUM_RENAME_PROGRESS2);
+ Bitmap *pBitmap2 = pAppResource->GetBitmapN(IDB_ALBUM_RENAME_PROGRESS3);
+ Bitmap *pBitmap3 = pAppResource->GetBitmapN(IDB_ALBUM_RENAME_PROGRESS4);
+ Bitmap *pBitmap4 = pAppResource->GetBitmapN(IDB_ALBUM_RENAME_PROGRESS5);
+ Bitmap *pBitmap5 = pAppResource->GetBitmapN(IDB_ALBUM_RENAME_PROGRESS6);
+ Bitmap *pBitmap6 = pAppResource->GetBitmapN(IDB_ALBUM_RENAME_PROGRESS7);
+ Bitmap *pBitmap7 = pAppResource->GetBitmapN(IDB_ALBUM_RENAME_PROGRESS8);
+ Bitmap *pBitmap8 = pAppResource->GetBitmapN(IDB_ALBUM_RENAME_PROGRESS9);
+ Bitmap *pBitmap9 = pAppResource->GetBitmapN(IDB_ALBUM_RENAME_PROGRESS10);
+ Bitmap *pBitmap10 = pAppResource->GetBitmapN(IDB_ALBUM_RENAME_PROGRESS11);
+ Bitmap *pBitmap11 = pAppResource->GetBitmapN(IDB_ALBUM_RENAME_PROGRESS12);
+ Bitmap *pBitmap12 = pAppResource->GetBitmapN(IDB_ALBUM_RENAME_PROGRESS13);
+ Bitmap *pBitmap13 = pAppResource->GetBitmapN(IDB_ALBUM_RENAME_PROGRESS14);
+ Bitmap *pBitmap14 = pAppResource->GetBitmapN(IDB_ALBUM_RENAME_PROGRESS15);
+ Bitmap *pBitmap15 = pAppResource->GetBitmapN(IDB_ALBUM_RENAME_PROGRESS16);
+ Bitmap *pBitmap16 = pAppResource->GetBitmapN(IDB_ALBUM_RENAME_PROGRESS17);
+ Bitmap *pBitmap17 = pAppResource->GetBitmapN(IDB_ALBUM_RENAME_PROGRESS18);
+ Bitmap *pBitmap18 = pAppResource->GetBitmapN(IDB_ALBUM_RENAME_PROGRESS19);
+ Bitmap *pBitmap19 = pAppResource->GetBitmapN(IDB_ALBUM_RENAME_PROGRESS20);
+ Bitmap *pBitmap20 = pAppResource->GetBitmapN(IDB_ALBUM_RENAME_PROGRESS21);
+ Bitmap *pBitmap21 = pAppResource->GetBitmapN(IDB_ALBUM_RENAME_PROGRESS22);
+ Bitmap *pBitmap22 = pAppResource->GetBitmapN(IDB_ALBUM_RENAME_PROGRESS23);
+ Bitmap *pBitmap23 = pAppResource->GetBitmapN(IDB_ALBUM_RENAME_PROGRESS24);
+ Bitmap *pBitmap24 = pAppResource->GetBitmapN(IDB_ALBUM_RENAME_PROGRESS25);
+ Bitmap *pBitmap25 = pAppResource->GetBitmapN(IDB_ALBUM_RENAME_PROGRESS26);
+ Bitmap *pBitmap26 = pAppResource->GetBitmapN(IDB_ALBUM_RENAME_PROGRESS27);
+ Bitmap *pBitmap27 = pAppResource->GetBitmapN(IDB_ALBUM_RENAME_PROGRESS28);
+ Bitmap *pBitmap28 = pAppResource->GetBitmapN(IDB_ALBUM_RENAME_PROGRESS29);
+ Bitmap *pBitmap29 = pAppResource->GetBitmapN(IDB_ALBUM_RENAME_PROGRESS30);
+
+ // Create AnimationFrames
+ long duration = DURATION / PROGRESS_COUNT;
+ AnimationFrame *pAniFrame1 = new (std::nothrow) AnimationFrame(*pBitmap0, duration);
+ AnimationFrame *pAniFrame2 = new (std::nothrow) AnimationFrame(*pBitmap1, duration);
+ AnimationFrame *pAniFrame3 = new (std::nothrow) AnimationFrame(*pBitmap2, duration);
+ AnimationFrame *pAniFrame4 = new (std::nothrow) AnimationFrame(*pBitmap3, duration);
+ AnimationFrame *pAniFrame5 = new (std::nothrow) AnimationFrame(*pBitmap4, duration);
+ AnimationFrame *pAniFrame6 = new (std::nothrow) AnimationFrame(*pBitmap5, duration);
+ AnimationFrame *pAniFrame7 = new (std::nothrow) AnimationFrame(*pBitmap6, duration);
+ AnimationFrame *pAniFrame8 = new (std::nothrow) AnimationFrame(*pBitmap7, duration);
+ AnimationFrame *pAniFrame9 = new (std::nothrow) AnimationFrame(*pBitmap8, duration);
+ AnimationFrame *pAniFrame10 = new (std::nothrow) AnimationFrame(*pBitmap9, duration);
+ AnimationFrame *pAniFrame11 = new (std::nothrow) AnimationFrame(*pBitmap10, duration);
+ AnimationFrame *pAniFrame12 = new (std::nothrow) AnimationFrame(*pBitmap11, duration);
+ AnimationFrame *pAniFrame13 = new (std::nothrow) AnimationFrame(*pBitmap12, duration);
+ AnimationFrame *pAniFrame14 = new (std::nothrow) AnimationFrame(*pBitmap13, duration);
+ AnimationFrame *pAniFrame15 = new (std::nothrow) AnimationFrame(*pBitmap14, duration);
+ AnimationFrame *pAniFrame16 = new (std::nothrow) AnimationFrame(*pBitmap15, duration);
+ AnimationFrame *pAniFrame17 = new (std::nothrow) AnimationFrame(*pBitmap16, duration);
+ AnimationFrame *pAniFrame18 = new (std::nothrow) AnimationFrame(*pBitmap17, duration);
+ AnimationFrame *pAniFrame19 = new (std::nothrow) AnimationFrame(*pBitmap18, duration);
+ AnimationFrame *pAniFrame20 = new (std::nothrow) AnimationFrame(*pBitmap19, duration);
+ AnimationFrame *pAniFrame21 = new (std::nothrow) AnimationFrame(*pBitmap20, duration);
+ AnimationFrame *pAniFrame22 = new (std::nothrow) AnimationFrame(*pBitmap21, duration);
+ AnimationFrame *pAniFrame23 = new (std::nothrow) AnimationFrame(*pBitmap22, duration);
+ AnimationFrame *pAniFrame24 = new (std::nothrow) AnimationFrame(*pBitmap23, duration);
+ AnimationFrame *pAniFrame25 = new (std::nothrow) AnimationFrame(*pBitmap24, duration);
+ AnimationFrame *pAniFrame26 = new (std::nothrow) AnimationFrame(*pBitmap25, duration);
+ AnimationFrame *pAniFrame27 = new (std::nothrow) AnimationFrame(*pBitmap26, duration);
+ AnimationFrame *pAniFrame28 = new (std::nothrow) AnimationFrame(*pBitmap27, duration);
+ AnimationFrame *pAniFrame29 = new (std::nothrow) AnimationFrame(*pBitmap28, duration);
+ AnimationFrame *pAniFrame30 = new (std::nothrow) AnimationFrame(*pBitmap29, duration);
+
+ // Create AnimationList
+ __pAnimationFrameList = new (std::nothrow) ArrayList();
+ __pAnimationFrameList->Construct();
+ __pAnimationFrameList->Add(*pAniFrame1);
+ __pAnimationFrameList->Add(*pAniFrame2);
+ __pAnimationFrameList->Add(*pAniFrame3);
+ __pAnimationFrameList->Add(*pAniFrame4);
+ __pAnimationFrameList->Add(*pAniFrame5);
+ __pAnimationFrameList->Add(*pAniFrame6);
+ __pAnimationFrameList->Add(*pAniFrame7);
+ __pAnimationFrameList->Add(*pAniFrame8);
+ __pAnimationFrameList->Add(*pAniFrame9);
+ __pAnimationFrameList->Add(*pAniFrame10);
+ __pAnimationFrameList->Add(*pAniFrame11);
+ __pAnimationFrameList->Add(*pAniFrame12);
+ __pAnimationFrameList->Add(*pAniFrame13);
+ __pAnimationFrameList->Add(*pAniFrame14);
+ __pAnimationFrameList->Add(*pAniFrame15);
+ __pAnimationFrameList->Add(*pAniFrame16);
+ __pAnimationFrameList->Add(*pAniFrame17);
+ __pAnimationFrameList->Add(*pAniFrame18);
+ __pAnimationFrameList->Add(*pAniFrame19);
+ __pAnimationFrameList->Add(*pAniFrame20);
+ __pAnimationFrameList->Add(*pAniFrame21);
+ __pAnimationFrameList->Add(*pAniFrame22);
+ __pAnimationFrameList->Add(*pAniFrame23);
+ __pAnimationFrameList->Add(*pAniFrame24);
+ __pAnimationFrameList->Add(*pAniFrame25);
+ __pAnimationFrameList->Add(*pAniFrame26);
+ __pAnimationFrameList->Add(*pAniFrame27);
+ __pAnimationFrameList->Add(*pAniFrame28);
+ __pAnimationFrameList->Add(*pAniFrame29);
+ __pAnimationFrameList->Add(*pAniFrame30);
+
+ // Deallocate a Bitmap.
+ delete pBitmap0;
+ delete pBitmap1;
+ delete pBitmap2;
+ delete pBitmap3;
+ delete pBitmap4;
+ delete pBitmap5;
+ delete pBitmap6;
+ delete pBitmap7;
+ delete pBitmap8;
+ delete pBitmap9;
+ delete pBitmap10;
+ delete pBitmap11;
+ delete pBitmap12;
+ delete pBitmap13;
+ delete pBitmap14;
+ delete pBitmap15;
+ delete pBitmap16;
+ delete pBitmap17;
+ delete pBitmap18;
+ delete pBitmap19;
+ delete pBitmap20;
+ delete pBitmap21;
+ delete pBitmap22;
+ delete pBitmap23;
+ delete pBitmap24;
+ delete pBitmap25;
+ delete pBitmap26;
+ delete pBitmap27;
+ delete pBitmap28;
+ delete pBitmap29;
+
+ // Create Animation
+ __pAnimation = new (std::nothrow) Animation();
+ __pAnimation->Construct(Rectangle((rect.width/2-60/2), (rect.height/2-60/2), 60, 60), *__pAnimationFrameList);
+ __pAnimation->SetRepeatCount(10000);
+ AddControl(*__pAnimation);
+
+ }
+
+ return r;
+}
+
+void
+ProgressAnimation::AnimationStart(void)
+{
+ __pAnimation->SetShowState(true);
+ __pAnimation->Play();
+
+}
+void
+ProgressAnimation::AnimationStop(void)
+{
+ __pAnimation->Stop();
+ __pAnimation->SetShowState(false);
+}
+
+
#include <FApp.h>
#include <FUi.h>
+
#include "GlProgressBar.h"
#include "GlResourceManager.h"
#include "GlTypes.h"
const wchar_t* IDB_ALBUM_ICON_DOWNLOAD = L"T01_album_icon_download.png";
const wchar_t* IDB_ALBUM_ICON_CAMERA = L"T01_album_icon_camera.png";
+const wchar_t* IDB_ALBUM_RENAME_PROGRESS1 = L"00_list_process_01.png";
+const wchar_t* IDB_ALBUM_RENAME_PROGRESS2 = L"00_list_process_02.png";
+const wchar_t* IDB_ALBUM_RENAME_PROGRESS3 = L"00_list_process_03.png";
+const wchar_t* IDB_ALBUM_RENAME_PROGRESS4 = L"00_list_process_04.png";
+const wchar_t* IDB_ALBUM_RENAME_PROGRESS5 = L"00_list_process_05.png";
+const wchar_t* IDB_ALBUM_RENAME_PROGRESS6 = L"00_list_process_06.png";
+const wchar_t* IDB_ALBUM_RENAME_PROGRESS7 = L"00_list_process_07.png";
+const wchar_t* IDB_ALBUM_RENAME_PROGRESS8 = L"00_list_process_08.png";
+const wchar_t* IDB_ALBUM_RENAME_PROGRESS9 = L"00_list_process_09.png";
+const wchar_t* IDB_ALBUM_RENAME_PROGRESS10 = L"00_list_process_10.png";
+
+const wchar_t* IDB_ALBUM_RENAME_PROGRESS11 = L"00_list_process_11.png";
+const wchar_t* IDB_ALBUM_RENAME_PROGRESS12 = L"00_list_process_12.png";
+const wchar_t* IDB_ALBUM_RENAME_PROGRESS13 = L"00_list_process_13.png";
+const wchar_t* IDB_ALBUM_RENAME_PROGRESS14 = L"00_list_process_14.png";
+const wchar_t* IDB_ALBUM_RENAME_PROGRESS15 = L"00_list_process_15.png";
+const wchar_t* IDB_ALBUM_RENAME_PROGRESS16 = L"00_list_process_16.png";
+const wchar_t* IDB_ALBUM_RENAME_PROGRESS17 = L"00_list_process_17.png";
+const wchar_t* IDB_ALBUM_RENAME_PROGRESS18 = L"00_list_process_18.png";
+const wchar_t* IDB_ALBUM_RENAME_PROGRESS19 = L"00_list_process_19.png";
+const wchar_t* IDB_ALBUM_RENAME_PROGRESS20 = L"00_list_process_20.png";
+
+const wchar_t* IDB_ALBUM_RENAME_PROGRESS21 = L"00_list_process_21.png";
+const wchar_t* IDB_ALBUM_RENAME_PROGRESS22 = L"00_list_process_22.png";
+const wchar_t* IDB_ALBUM_RENAME_PROGRESS23 = L"00_list_process_23.png";
+const wchar_t* IDB_ALBUM_RENAME_PROGRESS24 = L"00_list_process_24.png";
+const wchar_t* IDB_ALBUM_RENAME_PROGRESS25 = L"00_list_process_25.png";
+const wchar_t* IDB_ALBUM_RENAME_PROGRESS26 = L"00_list_process_26.png";
+const wchar_t* IDB_ALBUM_RENAME_PROGRESS27 = L"00_list_process_27.png";
+const wchar_t* IDB_ALBUM_RENAME_PROGRESS28 = L"00_list_process_28.png";
+const wchar_t* IDB_ALBUM_RENAME_PROGRESS29 = L"00_list_process_29.png";
+const wchar_t* IDB_ALBUM_RENAME_PROGRESS30 = L"00_list_process_30.png";
+