Use of Hashmap in Thumbnail provider, logic in fetching of memo list
authorSeema <seema.nagraj@samsung.com>
Thu, 21 Mar 2013 10:26:23 +0000 (15:56 +0530)
committerSeema <seema.nagraj@samsung.com>
Thu, 21 Mar 2013 10:26:56 +0000 (15:56 +0530)
Change-Id: I9514de56c223fe079992021470075e7c7ffa002c
Signed-off-by: Seema <seema.nagraj@samsung.com>
22 files changed:
inc/MmDrawingDetailForm.h
inc/MmDrawingEditorForm.h
inc/MmItemProviders.h
inc/MmListForm.h
inc/MmMemoManager.h
inc/MmTextDetailForm.h
inc/MmTextEditorForm.h
inc/MmThumbnailProvider.h
inc/MmTypes.h
res/screen-size-normal/IDL_MEMO_TEXT_EDITOR.xml
src/MmDrawingDetailForm.cpp
src/MmDrawingEditorForm.cpp
src/MmItemProviders.cpp
src/MmListEditorForm.cpp
src/MmListForm.cpp
src/MmListPresentationModel.cpp
src/MmMemoApp.cpp
src/MmMemoManager.cpp
src/MmTask.cpp
src/MmTextDetailForm.cpp
src/MmTextEditorForm.cpp
src/MmThumbnailProvider.cpp

index 5de39df..38876d1 100644 (file)
@@ -101,7 +101,7 @@ private:
        Tizen::Ui::Controls::ListView*      __pPopupList;
        AppControlListProvider*             __pAppControlListProvider;
        VMemoCreator*                                           __pVMemoCreator;
-       Tizen::Base::Integer*                           __pMemoIndex;
+       Tizen::Base::Collection::ArrayList*     __pUpdateDetails;
 };
 
 #endif /* _MM_DRAWING_DETAIL_FORM_H_ */
index d49fd05..9ac7776 100644 (file)
@@ -232,6 +232,8 @@ private:
        ///Selected color from color picker
        Tizen::Graphics::Color                     __selectedColor;
        int                                                             __sliderValue;
+       bool                                                            __isUpdateListView;
+       Tizen::Base::Collection::ArrayList*     __pUpdateDetails;
 };
 
 #endif /* _MM_DRAWING_EDITOR_FORM_H_ */
index bd78935..d456a09 100644 (file)
@@ -51,8 +51,8 @@ class MemoSearchDataProvider
 public:
        MemoSearchDataProvider(void);
        ~MemoSearchDataProvider(void);
-       result GetThumbnail(int itemIndex, Tizen::Base::String filePath) const;
-       result StartThumbnailRequest(int itemIndex, Tizen::Base::String filePath) const;
+       result GetThumbnail(int itemIndex, Tizen::Base::String filePath, int dbId) const;
+       result StartThumbnailRequest(int itemIndex, Tizen::Base::String filePath, int dbId) const;
        result StopThumbnailProvider(void);
 
        virtual Tizen::Ui::Controls::ListItemBase* CreateItem(int index, int itemWidth);
@@ -71,8 +71,8 @@ class MemoListDataProvider
 public:
        MemoListDataProvider(void);
        ~MemoListDataProvider(void);
-       result GetThumbnail(int itemIndex, Tizen::Base::String filePath) const;
-       result StartThumbnailRequest(int itemIndex, Tizen::Base::String filePath) const;
+       result GetThumbnail(int itemIndex, Tizen::Base::String filePath, int dbId) const;
+       result StartThumbnailRequest(int itemIndex, Tizen::Base::String filePath, int dbId) const;
        result StopThumbnailProvider(void);
 
        virtual Tizen::Ui::Controls::ListItemBase* CreateItem(int index, int itemWidth);
index 75a7210..6d7b4b7 100644 (file)
@@ -111,6 +111,8 @@ private:
        Tizen::Ui::Controls::SearchBar*     __pSearchBar;
        ///Item provider for search memo
        MemoSearchDataProvider*             __pSearchItemProvider;
+       Tizen::Ui::Controls::Popup*         __pPopup;
+       Tizen::Ui::Controls::ListView*      __pPopupList;
 };
 
 #endif  /* _MM_LIST_FORM_H_ */
index 39c0c70..47874bb 100644 (file)
@@ -47,7 +47,7 @@ public:
        /**
         * @param a linked list reference to store the result
         */
-       Tizen::Base::Collection::IList* GetMemoListN(void);
+       Tizen::Base::Collection::IList* GetMemoListN(int start, int end);
        ///Finds the number of entries in the database
        /**
         * @param an int reference to store the result
index 7fdf15f..1963255 100644 (file)
@@ -107,7 +107,6 @@ private:
        ///VMemo creator instance
        VMemoCreator*                                       __pVMemoCreator;
        Tizen::Base::String*                    __pVntFilename;
-       Tizen::Base::Integer*                           __pMemoIndex;
 };
 
 #endif /* _MM_TEXT_DETAIL_FORM_H_ */
index 795c5d3..a045a7e 100644 (file)
@@ -162,6 +162,8 @@ private:
        int                                                               __cursorPosition;
        bool                                                    __isMemoTextMaxLength;
        bool                                                    __isEdited;
+       Tizen::Base::Collection::ArrayList*     __pUpdateDetails;
+       bool                                                            __isUpdateListView;
 };
 
 #endif /* _MM_TEXT_EDITOR_FORM_H_ */
index 0df6532..a7fb42f 100644 (file)
@@ -47,24 +47,19 @@ struct ThumbnailRequest
 public:
        ThumbnailRequest(void)
        {
-               AppLog("ThumbRequest::Constructor++");
                SetRequestId(0);
-               SetBitmap(null);
-               AppLog("ThumbRequest::Constructor--");
+               SetDbId(0);
+               //SetBitmap(null);
        }
        ~ThumbnailRequest(void)
        {
-               AppLog("ThumbRequest::Destructor++");
                SetRequestId(0);
-        #if 0
-                       delete pBitmap;
-        #endif
-                       AppLog("ThumbRequest::Destructor--");
+               SetDbId(0);
        }
-       Tizen::Graphics::Bitmap* GetBitmap(void) const
+/*     Tizen::Graphics::Bitmap* GetBitmap(void) const
        {
                return __pBitmap;
-       }
+       }*/
        Tizen::Base::String& GetFilePath(void)
        {
                return __filePath;
@@ -77,10 +72,14 @@ public:
        {
                return __sceneId;
        }
-       void SetBitmap(Tizen::Graphics::Bitmap* pBitmap)
+       int GetDbId(void) const
        {
-               __pBitmap = pBitmap;
+               return __dbId;
        }
+       /*void SetBitmap(Tizen::Graphics::Bitmap* pBitmap)
+       {
+               __pBitmap = pBitmap;
+       }*/
        void SetFilePath(const Tizen::Base::String filePath)
        {
                __filePath = filePath;
@@ -93,19 +92,24 @@ public:
        {
                __sceneId = sceneId;
        }
+       void SetDbId(const int dbId)
+       {
+               __dbId = dbId;
+       }
 
 private:
        Tizen::Base::String      __filePath;
-       Tizen::Graphics::Bitmap* __pBitmap;
+       //Tizen::Graphics::Bitmap* __pBitmap;
        int                      __requestId;
        Tizen::Base::String              __sceneId;
+       int                                              __dbId;
 };
 
 class MemoThumbnailProvider
        : public Tizen::Base::Runtime::Thread
 {
 public:
-       Tizen::Graphics::Bitmap* GetDecodedBitmap(int index);
+       Tizen::Graphics::Bitmap* GetDecodedBitmap(int index, int dbId);
        void RemoveObjectBitmap(int index);
        virtual void OnUserEventReceivedN(RequestId requestId, Tizen::Base::Collection::IList * pArgs);
        /*!
@@ -161,8 +165,8 @@ private:
        static void DestroyInstance(void);
 
 private:
-       Tizen::Base::Collection::IList* __pTempArrayList;
-       Tizen::Base::Collection::IList* __pObjectList;
+       Tizen::Base::Collection::IList*         __pTempArrayList;
+       Tizen::Base::Collection::HashMap*       __pThumbnailList;
 };
 
 #endif /* _MM_THUMBNAIL_PROVIDER_H_ */
index 29ee315..13325ef 100644 (file)
@@ -50,13 +50,22 @@ enum ControlActionId
 enum RequestIds{
        ID_SEARCH_LIST = 301,
        ID_MEMO_LIST = 302,
-       ID_MEMO_LIST_BITMAP = 303
+       ID_MEMO_LIST_APPEND = 303,
+       ID_MEMO_LIST_BITMAP = 304
 };
 
 enum RefreshListId
 {
        ID_REFRESH_LIST_FROM_DATABASEVIEW,
        ID_REFRESH_LIST_FROM_DATABASE,
+       ID_REFRESH_LIST_FROM_LISTVIEW,
+};
+
+
+enum MemoCreateTypeId
+{
+       ID_CREATE_MODE_NEW,
+       ID_CREATE_MODE_EDIT,
 };
 
 //All Forms
index 70cc56e..14d0e55 100644 (file)
@@ -65,7 +65,7 @@
     </Label>
     <Panel id="IDC_PANEL_TEXTSIZE" parent="IDL_MEMO_TEXT_EDITOR">
         <property backgroundColor="#FFFFFF" backgroundColorOpacity="100" compositeEnabled="true" groupStyle="GROUP_STYLE_NONE"/>
-        <layout bottomRelation="" bottomRelationType="" centerHorizontal="false" centerVertical="false" height="600" horizontalFitPolicy="FIT_POLICY_FIXED" leftRelation="" leftRelationType="" marginBottom="0" marginLeft="0" marginRight="0" marginTop="0" mode="Portrait" rightRelation="" rightRelationType="" topRelation="" topRelationType="" type="NONE" verticalFitPolicy="FIT_POLICY_FIXED" width="720" x="0" y="429"/>
+        <layout bottomRelation="" bottomRelationType="" centerHorizontal="false" centerVertical="false" height="600" horizontalFitPolicy="FIT_POLICY_FIXED" leftRelation="" leftRelationType="" marginBottom="0" marginLeft="0" marginRight="0" marginTop="0" mode="Portrait" rightRelation="" rightRelationType="" topRelation="" topRelationType="" type="NONE" verticalFitPolicy="FIT_POLICY_FIXED" width="720" x="0" y="509"/>
         <layout bottomRelation="" bottomRelationType="" centerHorizontal="false" centerVertical="false" height="335" horizontalFitPolicy="FIT_POLICY_FIXED" leftRelation="" leftRelationType="" marginBottom="0" marginLeft="0" marginRight="0" marginTop="0" mode="Landscape" rightRelation="" rightRelationType="" topRelation="" topRelationType="" type="NONE" verticalFitPolicy="FIT_POLICY_FIXED" width="1256" x="23" y="234"/>
     </Panel>
     <Label id="IDC_LABEL_PREVIEW" parent="IDC_PANEL_TEXTSIZE">
index 3b330a3..d8893c2 100644 (file)
@@ -29,6 +29,7 @@
 #include "MmListPresentationModel.h"
 #include "MmTypes.h"
 #include "MmVMemoCreator.h"
+#include "MmThumbnailProvider.h"
 
 using namespace Tizen::Base;
 using namespace Tizen::Base::Collection;
@@ -52,7 +53,7 @@ MemoDrawingDetailForm::MemoDrawingDetailForm(void)
        , __pMemoData(null)
        , __pPopup(null)
        , __pPopupList(null)
-       , __pMemoIndex(null)
+       , __pUpdateDetails(null)
 {
 }
 
@@ -191,14 +192,11 @@ MemoDrawingDetailForm::OnTerminating(void)
        if (__pPopup != null)
        {
                delete __pPopup;
-               __pPopup = null;
        }
-       if(__pMemoIndex != null)
+       if(__pUpdateDetails != null)
        {
-               delete __pMemoIndex;
-               __pMemoIndex = null;
+               delete __pUpdateDetails;
        }
-
        return E_SUCCESS;
 }
 
@@ -235,12 +233,11 @@ MemoDrawingDetailForm::RemoveMemo(void)
                        MemoListPresentationModel::GetInstance()->CreateMemoRegistry();
                        MemoListPresentationModel::GetInstance()->SetValueToRegistry(0);
                }
-               MemoListPresentationModel::GetInstance()->RemoveMemoAtIndex(__pMemoIndex->ToInt());
-               delete __pMemoIndex;
-               __pMemoIndex = null;
+
+               (MemoThumbnailProvider::GetInstance())->RemoveObjectBitmap(__pMemoData->GetMemoIndex());
                SceneManager* pSceneManager = SceneManager::GetInstance();
                IList* pArgs = new (std::nothrow) ArrayList();
-               pArgs->Add(new Integer(ID_REFRESH_LIST_FROM_DATABASEVIEW));
+               pArgs->Add(new Integer(ID_REFRESH_LIST_FROM_DATABASE));
                pSceneManager->GoBackward(BackwardSceneTransition(IDSCN_MEMO_LIST), pArgs);
        }
        return;
@@ -255,6 +252,7 @@ MemoDrawingDetailForm::EditDrawingMemo(void)
        pArg = new (std::nothrow) ArrayList();
        pArg->Construct();
 
+       pArg->Add(new (std::nothrow) Integer(ID_CREATE_MODE_EDIT));
        pArg->Add(__pMemoData);
        pSceneManager->GoForward(ForwardSceneTransition(IDSCN_MEMO_DRAWING_EDITOR), pArg);
 
@@ -370,6 +368,7 @@ MemoDrawingDetailForm::OnSceneActivatedN(const SceneId& previousSceneId, const S
        Image img;
        img.Construct();
 
+
        if (pArgs == null)
        {
                return;
@@ -378,10 +377,11 @@ MemoDrawingDetailForm::OnSceneActivatedN(const SceneId& previousSceneId, const S
        __pMemoData = static_cast<MemoInfo*>(pArgs->GetAt(0));
        if (__pMemoData != null)
        {
-               __pMemoIndex = static_cast<Integer*>(pArgs->GetAt(1));
+               Integer* pMemoIndex = static_cast<Integer*>(pArgs->GetAt(1));
                Integer* pCount = static_cast<Integer*>(pArgs->GetAt(2));
-               SetTitle(__pMemoIndex->ToInt(), pCount->ToInt());
+               SetTitle(pMemoIndex->ToInt(), pCount->ToInt());
 
+               delete pMemoIndex;
                delete pCount;
                String time = GetMemoCreationDateTime(__pMemoData->GetMemoModificationTime());
                __pDatetimeLabel->SetText(time);
@@ -439,7 +439,7 @@ MemoDrawingDetailForm::OnFormBackRequested(Form& source)
        IList* pArgs = new (std::nothrow) ArrayList();
 
        UpdateComment();
-       pArgs->Add(new Integer(ID_REFRESH_LIST_FROM_DATABASEVIEW));
+       pArgs->Add(new Integer(ID_REFRESH_LIST_FROM_DATABASE));
        pSceneManager->GoBackward(BackwardSceneTransition(IDSCN_MEMO_LIST), pArgs);
        return;
 }
index 029e835..00525ff 100644 (file)
@@ -68,6 +68,8 @@ MemoDrawingEditorForm::MemoDrawingEditorForm(void)
        , __pSliderPreviewLabel(null)
        , __selectedColor(Color::GetColor(COLOR_ID_BLACK))
        , __sliderValue(1)
+       , __isUpdateListView(false)
+       , __pUpdateDetails(null)
 {
        __drawingMode = DRAWING_MODE_CURVELINE;
        return;
@@ -75,15 +77,6 @@ MemoDrawingEditorForm::MemoDrawingEditorForm(void)
 
 MemoDrawingEditorForm::~MemoDrawingEditorForm(void)
 {
-       if (__pCanvas != null)
-       {
-               delete __pCanvas;
-       }
-       if (__pBitmap != null)
-       {
-               delete __pBitmap;
-       }
-       __drawingObjects.RemoveAll(true);
        return;
 }
 
@@ -232,6 +225,20 @@ MemoDrawingEditorForm::OnInitializing(void)
 result
 MemoDrawingEditorForm::OnTerminating(void)
 {
+       if(__pUpdateDetails != null)
+       {
+               delete __pUpdateDetails;
+               __pUpdateDetails = null;
+       }
+       if (__pCanvas != null)
+       {
+               delete __pCanvas;
+       }
+       if (__pBitmap != null)
+       {
+               delete __pBitmap;
+       }
+       __drawingObjects.RemoveAll(true);
        return E_SUCCESS;
 }
 
@@ -368,26 +375,27 @@ MemoDrawingEditorForm::ChangeSelectedButtonColor(SelectedButton button)
        switch (button)
        {
        case BUTTON_ERASER:
-               {
-                       __pButtonEraser->SetColor(BUTTON_STATUS_NORMAL, Color(COLOR_BLUE));
-               }
-               break;
+       {
+               __pButtonEraser->SetColor(BUTTON_STATUS_NORMAL, Color(COLOR_BLUE));
+       }
+       break;
 
        case BUTTON_LINE_STROKE:
-               {
-                       __pButtonStroke->SetColor(BUTTON_STATUS_NORMAL, Color(COLOR_BLUE));
-               }
-               break;
+       {
+               __pButtonStroke->SetColor(BUTTON_STATUS_NORMAL, Color(COLOR_BLUE));
+       }
+       break;
 
        case BUTTON_COLOR:
-               {
-                       __pButtonColor->SetColor(BUTTON_STATUS_NORMAL, Color(COLOR_BLUE));
-               }
-               break;
+       {
+               __pButtonColor->SetColor(BUTTON_STATUS_NORMAL, Color(COLOR_BLUE));
+       }
+       break;
+
        default:
-               {
-               }
-               break;
+       {
+       }
+       break;
        }
        __pButtonEraser->Invalidate(true);
        __pButtonStroke->Invalidate(true);
@@ -1062,6 +1070,18 @@ MemoDrawingEditorForm::OnActionPerformed(const Control& source, int actionId)
 
        case IDA_BUTTON_TEXT_MODE: //Text create
                {
+                       bool isUpdate = false;
+                       if(__pUpdateDetails == null)
+                       {
+                               __pUpdateDetails = new (std::nothrow) ArrayList();
+                               __pUpdateDetails->Construct();
+                       }
+                       else
+                       {
+                               __pUpdateDetails->RemoveAll(false);
+                       }
+                       __pUpdateDetails->Add(new (std::nothrow) Integer(ID_CREATE_MODE_NEW));
+
                        if (__isImageDrawn == true || IsCommentEdited() == true)
                        {
                                int modalResult = ShowMessagePopUp(GetResourceString(L"IDS_MEMO_SAVE") + L"?", L"", MSGBOX_STYLE_YESNO, 0);
@@ -1075,9 +1095,15 @@ MemoDrawingEditorForm::OnActionPerformed(const Control& source, int actionId)
                                        {
                                                UpdateMemoInfo();
                                        }
+                                       isUpdate = true;
                                }
                        }
-                       pSceneManager->GoForward(ForwardSceneTransition(IDSCN_MEMO_TEXT_EDITOR, SCENE_TRANSITION_ANIMATION_TYPE_NONE, SCENE_HISTORY_OPTION_NO_HISTORY, SCENE_DESTROY_OPTION_DESTROY), null);
+                       if(__isUpdateListView == true)
+                       {
+                               isUpdate = true;
+                       }
+                       __pUpdateDetails->Add(new (std::nothrow) Integer (isUpdate));
+                       pSceneManager->GoForward(ForwardSceneTransition(IDSCN_MEMO_TEXT_EDITOR, SCENE_TRANSITION_ANIMATION_TYPE_NONE, SCENE_HISTORY_OPTION_NO_HISTORY, SCENE_DESTROY_OPTION_DESTROY), __pUpdateDetails);
                }
                break;
 
@@ -1096,56 +1122,59 @@ MemoDrawingEditorForm::OnActionPerformed(const Control& source, int actionId)
 
        case IDA_HEADER_BUTTON_SAVE:
                {
+                       if (__isImageDrawn == true || IsCommentEdited() == true)
                        {
-                               if (__isImageDrawn == true || IsCommentEdited() == true)
+                               if (__isEditMode == false)
                                {
-                                       if (__isEditMode == false)
-                                       {
-                                               SaveMemoInfo();
-                                       }
-                                       else
-                                       {
-                                               UpdateMemoInfo();
-                                       }
-                                       IList* pArgs = new (std::nothrow) ArrayList();
-                                       pArgs->Add(new (std::nothrow) Integer(ID_REFRESH_LIST_FROM_DATABASEVIEW));
-                                       pSceneManager->GoBackward(BackwardSceneTransition(IDSCN_MEMO_LIST), pArgs);
+                                       SaveMemoInfo();
                                }
                                else
                                {
-                                       ShowMessagePopUp(GetResourceString(L"IDS_MEMO_SAVE"), GetResourceString(L"IDS_SAVE_NOT_EDITED"), MSGBOX_STYLE_NONE, 2000);
+                                       UpdateMemoInfo();
                                }
+                               IList* pArgs = new (std::nothrow) ArrayList();
+                               pArgs->Add(new (std::nothrow) Integer(ID_REFRESH_LIST_FROM_DATABASEVIEW));
+                               pSceneManager->GoBackward(BackwardSceneTransition(IDSCN_MEMO_LIST), pArgs);
+                       }
+                       else
+                       {
+                               ShowMessagePopUp(GetResourceString(L"IDS_MEMO_SAVE"), GetResourceString(L"IDS_SAVE_NOT_EDITED"), MSGBOX_STYLE_NONE, 2000);
                        }
                }
                break;
 
        case IDA_HEADER_BUTTON_CANCEL:
                {
+                       IList* pArgs = new (std::nothrow) ArrayList();
+                       if(__isUpdateListView == true)
+                       {
+                               pArgs->Add(new (std::nothrow) Integer(ID_REFRESH_LIST_FROM_DATABASE));
+                       }
+                       else
+                       {
+                               pArgs->Add(new (std::nothrow) Integer(ID_REFRESH_LIST_FROM_LISTVIEW));
+                       }
+
+                       if (__isImageDrawn == true || IsCommentEdited() == true)
                        {
-                               if (__isImageDrawn == true || IsCommentEdited() == true)
+                               int modalResult = ShowMessagePopUp(GetResourceString(L"IDS_MEMO_SAVE") + L"?", L"", MSGBOX_STYLE_YESNO, 0);
+                               if (modalResult == MSGBOX_RESULT_YES)
                                {
-                                       int modalResult = ShowMessagePopUp(GetResourceString(L"IDS_MEMO_SAVE") + L"?", L"", MSGBOX_STYLE_YESNO, 0);
-                                       if (modalResult == MSGBOX_RESULT_YES)
+                                       if (__isEditMode == false)
+                                       {
+                                               SaveMemoInfo();
+                                       }
+                                       else
                                        {
-                                               if (__isEditMode == false)
-                                               {
-                                                       SaveMemoInfo();
-                                               }
-                                               else
-                                               {
-                                                       UpdateMemoInfo();
-                                               }
-                                               IList* pArgs = new (std::nothrow) ArrayList();
-                                               pArgs->Add(new (std::nothrow) Integer(ID_REFRESH_LIST_FROM_DATABASEVIEW));
-                                               pSceneManager->GoBackward(BackwardSceneTransition(IDSCN_MEMO_LIST), pArgs);
-                                               
-                                               return;
+                                               UpdateMemoInfo();
                                        }
+                                       pArgs->RemoveAt(0, true);
+                                       pArgs->Add(new (std::nothrow) Integer(ID_REFRESH_LIST_FROM_DATABASE));
+                                       pSceneManager->GoBackward(BackwardSceneTransition(IDSCN_MEMO_LIST), pArgs);
+                                       return;
                                }
-                               IList* pArgs = new (std::nothrow) ArrayList();
-                               pArgs->Add(new (std::nothrow) Integer(ID_REFRESH_LIST_FROM_DATABASEVIEW));
-                               pSceneManager->GoBackward(BackwardSceneTransition(IDSCN_MEMO_LIST), pArgs);
                        }
+                       pSceneManager->GoBackward(BackwardSceneTransition(IDSCN_MEMO_LIST), pArgs);
                }
                break;
 
@@ -1295,60 +1324,89 @@ MemoDrawingEditorForm::OnSceneActivatedN(const SceneId& previousSceneId, const S
 
        if (pArgs != null)
        {
-               //Edit memo mode
-               __isEditMode = true;
-               int width = 0;
-               int height = 0;
-               Bitmap* pBitmap = null;
-               Image img;
-
-               img.Construct();
-
-               __pEditMemo = static_cast<MemoInfo*>(pArgs->GetAt(0));
-               if (__pEditMemo != null)
+               Integer* isNew = static_cast<Integer*>(pArgs->GetAt(0));
+               if(isNew != null)
                {
-                       //Gets the drawing canvas size
-                       width = GetClientAreaBounds().width;
-                       height = __pDrawingPanel->GetHeight();
-                       Dimension canvasSize;
-                       canvasSize.SetSize(GetClientAreaBounds().width, __pDrawingPanel->GetHeight());
-
-                       ByteBuffer* pBuffer = img.DecodeToBufferN(__pEditMemo->GetMemoDrawingPath(), BITMAP_PIXEL_FORMAT_RGB565, canvasSize.width, canvasSize.height);
-                       if (pBuffer != null)
+                       if(isNew->ToInt() == ID_CREATE_MODE_NEW)
                        {
-                               pBitmap = Bitmap::GetNonScaledBitmapN(*pBuffer, canvasSize, BITMAP_PIXEL_FORMAT_RGB565);
-                               delete pBuffer;
+                               __isEditMode = false;
                        }
-                       if(pBitmap != null)
+                       else
                        {
-                               SetCanvasBitmap(*pBitmap);
+                               __isEditMode = true;
                        }
+               }
+
+               //Edit memo mode
+               if(__isEditMode == true)
+               {
+                       __isUpdateListView = false;
+
+                       int width = 0;
+                       int height = 0;
+                       Bitmap* pBitmap = null;
+                       Image img;
 
-                       String drawingPath = File::GetFileName(__pEditMemo->GetMemoDrawingPath());
-                       String memoContent = __pEditMemo->GetMemoContents().GetPointer();
-                       memoContent.Append(DRAWING_FILENAME_EXTENSION);
-                       if ( __pComment != null)
+                       img.Construct();
+
+                       __pEditMemo = static_cast<MemoInfo*>(pArgs->GetAt(1));
+                       if (__pEditMemo != null)
                        {
-                               __memoComment.Clear();
-                               if (memoContent != drawingPath)
-                               {
-                                       __memoComment = __pEditMemo->GetMemoContents();
-                                       __pComment->SetText(__memoComment);
+                               //Gets the drawing canvas size
+                               width = GetClientAreaBounds().width;
+                               height = __pDrawingPanel->GetHeight();
 
+                               Dimension canvasSize;
+                               canvasSize.SetSize(GetClientAreaBounds().width, __pDrawingPanel->GetHeight());
+
+                               ByteBuffer* pBuffer = img.DecodeToBufferN(__pEditMemo->GetMemoDrawingPath(), BITMAP_PIXEL_FORMAT_RGB565, canvasSize.width, canvasSize.height);
+                               if (pBuffer != null)
+                               {
+                                       pBitmap = Bitmap::GetNonScaledBitmapN(*pBuffer, canvasSize, BITMAP_PIXEL_FORMAT_RGB565);
+                                       delete pBuffer;
                                }
-                               else
+                               if(pBitmap != null)
                                {
-                                       __memoComment = L"";
-                                       __pComment->SetText(L"");
+                                       SetCanvasBitmap(*pBitmap);
                                }
+
+                               String drawingPath = File::GetFileName(__pEditMemo->GetMemoDrawingPath());
+                               String memoContent = __pEditMemo->GetMemoContents().GetPointer();
+                               memoContent.Append(DRAWING_FILENAME_EXTENSION);
+                               if ( __pComment != null)
+                               {
+                                       __memoComment.Clear();
+                                       if (memoContent != drawingPath)
+                                       {
+                                               __memoComment = __pEditMemo->GetMemoContents();
+                                               __pComment->SetText(__memoComment);
+
+                                       }
+                                       else
+                                       {
+                                               __memoComment = L"";
+                                               __pComment->SetText(L"");
+                                       }
+                               }
+                               SetFormTitle(GetResourceString(L"IDS_EDIT_MEMO"));
+                       }
+               }
+               else
+               {
+                       Integer* isUpdate = static_cast<Integer*>(pArgs->GetAt(1));
+                       if(isUpdate != null )
+                       {
+                               __isUpdateListView = isUpdate->ToInt();
                        }
-                       SetFormTitle(GetResourceString(L"IDS_EDIT_MEMO"));
+                       __isEditMode = false;
+                       SetFormTitle(GetResourceString(L"IDS_MEMO_NEW"));
                }
        }
        else
        {
                //New memo mode
                __isEditMode = false;
+               __isUpdateListView = false;
                SetFormTitle(GetResourceString(L"IDS_MEMO_NEW"));
        }
        SetSaveEnabled(false);
index deafe01..368c90b 100644 (file)
@@ -69,15 +69,15 @@ MemoSearchDataProvider::~MemoSearchDataProvider(void)
 }
 
 result
-MemoSearchDataProvider::GetThumbnail(int itemIndex, String filePath) const
+MemoSearchDataProvider::GetThumbnail(int itemIndex, String filePath, int dbId) const
 {
        result res = E_SUCCESS;
-       res = StartThumbnailRequest( itemIndex, filePath);
+       res = StartThumbnailRequest( itemIndex, filePath, dbId);
        return res;
 }
 
 result
-MemoSearchDataProvider::StartThumbnailRequest(int itemIndex, String filePath) const
+MemoSearchDataProvider::StartThumbnailRequest(int itemIndex, String filePath, int dbId) const
 {
        result res = E_SUCCESS;
        ThumbnailRequest* pThumbnailRequest = null;
@@ -218,22 +218,18 @@ MemoSearchDataProvider::CreateItem(int index, int itemWidth)
                String filePath = pMemoData->GetMemoDrawingPath();
                if (!filePath.IsEmpty())
                {
-                       Bitmap* pBitmap = __pThumbnailProvider->GetDecodedBitmap(index);
+                       Bitmap* pBitmap = __pThumbnailProvider->GetDecodedBitmap(index, pMemoData->GetMemoIndex());
                        if (pBitmap == null)
                        {
                                if (_pBitmap != null)
                                {
                                        pItem->AddElement(Rectangle(X_RECTANGLE_LIST_IMAGE, Y_RECTANGLE_LIST_IMAGE, W_LIST_ITEM_IMAGE, H_LIST_ITEM_IMAGE), ID_LISTITEM_IMAGE, *_pBitmap);
-                                       GetThumbnail(index, pMemoData->GetMemoDrawingPath());
+                                       GetThumbnail(index, pMemoData->GetMemoDrawingPath(), pMemoData->GetMemoIndex());
                                }
                        }
                        else
                        {
                                pItem->AddElement(Rectangle(X_RECTANGLE_LIST_IMAGE, Y_RECTANGLE_LIST_IMAGE, W_LIST_ITEM_IMAGE, H_LIST_ITEM_IMAGE), ID_LISTITEM_IMAGE, *pBitmap);
-
-                               delete pBitmap;
-                               pBitmap = null;
-                               __pThumbnailProvider->RemoveObjectBitmap(index);
                        }
                }
                return pItem;
@@ -277,26 +273,25 @@ MemoListDataProvider::~MemoListDataProvider(void)
 }
 
 result
-MemoListDataProvider::GetThumbnail(int itemIndex, String filePath) const
+MemoListDataProvider::GetThumbnail(int itemIndex, String filePath, int dbId) const
 {
        result res = E_SUCCESS;
-       StartThumbnailRequest( itemIndex, filePath);
+       StartThumbnailRequest( itemIndex, filePath, dbId);
        return res;
 }
 
 result
-MemoListDataProvider::StartThumbnailRequest(int itemIndex, String filePath) const
+MemoListDataProvider::StartThumbnailRequest(int itemIndex, String filePath, int dbId) const
 {
        result res = E_SUCCESS;
        ThumbnailRequest* pThumbnailRequest = null;
 
-       AppLog("StartThumbnailRequest++");
-
        pThumbnailRequest = new (std::nothrow) ThumbnailRequest();
 
        pThumbnailRequest->SetRequestId(itemIndex);
        pThumbnailRequest->SetFilePath(filePath);
        pThumbnailRequest->SetSceneId(GetCurrentFormId());
+       pThumbnailRequest->SetDbId(dbId);
 
        Tizen::Base::Collection::ArrayList* pRequestList = null;
        pRequestList = new (std::nothrow) Tizen::Base::Collection::ArrayList();
@@ -328,11 +323,11 @@ MemoListDataProvider::CreateItem(int index, int itemWidth)
 
        pItem->Construct(Dimension(itemWidth, H_LIST_VIEW_ITEM), style);
        MemoInfo* pMemoData = null;
-       if (__previousIndex == index - 1)
+/*     if (__previousIndex == index - 1)
        {
                pMemoData = _pMemoPresentationModel->GetNextMemo();
        }
-       else
+       else*/
        {
                pMemoData = _pMemoPresentationModel->GetMemoAt(index, ID_MEMO_LIST);
        }
@@ -346,7 +341,7 @@ MemoListDataProvider::CreateItem(int index, int itemWidth)
 
                if (!filePath.IsEmpty())
                {
-                       Bitmap* pBitmap = __pThumbnailProvider->GetDecodedBitmap(index);
+                       Bitmap* pBitmap = __pThumbnailProvider->GetDecodedBitmap(index, pMemoData->GetMemoIndex());
                        if (pBitmap == null)
                        {
                                if (_pBitmap != null)
@@ -361,7 +356,7 @@ MemoListDataProvider::CreateItem(int index, int itemWidth)
                                                pItem->AddElement(Rectangle(X_RECTANGLE, Y_RECTANGLE_TEXT, W_EDIT_TEXT_ITEM, H_RECTANGLE_TEXT), ID_LISTITEM_CONTENT, pMemoData->GetMemoContents().GetPointer(), FONT_SIZE_CONTENT, Color(COLOR_BLACK, false), Color(COLOR_BLACK,false), Color(COLOR_BLACK,false), false);
                                                pItem->AddElement(Rectangle(X_RECTANGLE_EDITLIST_IMAGE, Y_TEXT_ITEM_EDITLIST_IMAGE, W_LIST_ITEM_IMAGE, H_LIST_ITEM_IMAGE), ID_LISTITEM_IMAGE, *_pBitmap);
                                        }
-                                       GetThumbnail(index ,pMemoData->GetMemoDrawingPath());
+                                       GetThumbnail(index ,pMemoData->GetMemoDrawingPath(), pMemoData->GetMemoIndex());
                                }
                        }
                        else
@@ -376,9 +371,6 @@ MemoListDataProvider::CreateItem(int index, int itemWidth)
                                        pItem->AddElement(Rectangle(X_RECTANGLE, Y_RECTANGLE_TEXT, W_EDIT_TEXT_ITEM, H_RECTANGLE_TEXT), ID_LISTITEM_CONTENT, pMemoData->GetMemoContents().GetPointer(), FONT_SIZE_CONTENT, Color(COLOR_BLACK, false), Color(COLOR_BLACK,false), Color(COLOR_BLACK,false), false);
                                        pItem->AddElement(Rectangle(X_RECTANGLE_EDITLIST_IMAGE, Y_TEXT_ITEM_EDITLIST_IMAGE, W_LIST_ITEM_IMAGE, H_LIST_ITEM_IMAGE), ID_LISTITEM_IMAGE, *pBitmap);
                                }
-                               delete pBitmap;
-                               pBitmap = null;
-                               __pThumbnailProvider->RemoveObjectBitmap(index);
                        }
                }
                else
index 2e9cf44..9e2fa0d 100644 (file)
@@ -314,7 +314,7 @@ MemoListEditorForm::OnActionPerformed(const Control& source, int actionId)
        case IDA_FOOTER_BUTTON_CREATE:    //Cancel
                {
                        IList* pArgs = new (std::nothrow) ArrayList();
-                       pArgs->Add(new (std::nothrow) Integer(ID_REFRESH_LIST_FROM_DATABASEVIEW));
+                       pArgs->Add(new (std::nothrow) Integer(ID_REFRESH_LIST_FROM_LISTVIEW));
                        pSceneManager->GoBackward(BackwardSceneTransition(), pArgs);
                }
                break;
index 405424a..815caa8 100644 (file)
@@ -46,6 +46,8 @@ MemoListForm::MemoListForm(void)
        , __pMemoListView(null)
        , __pSearchBar(null)
        , __pSearchItemProvider(null)
+       , __pPopup(null)
+       , __pPopupList(null)
 {
 }
 
@@ -189,7 +191,6 @@ MemoListForm::DisplayData(RequestId requestId, Tizen::Base::Collection::IList* p
                {
                        ThumbnailRequest* pTempThumbnailRequest = null;
                        pTempThumbnailRequest = (ThumbnailRequest*)pList->GetAt(0);
-                       AppLog("ID_MEMO_LIST_BITMAP %d", pTempThumbnailRequest->GetRequestId());
                        __pMemoListView->RefreshList(pTempThumbnailRequest->GetRequestId(), LIST_REFRESH_TYPE_ITEM_MODIFY);
                        pList->RemoveAll(false);
                        delete pList;
@@ -301,8 +302,8 @@ MemoListForm::OnSceneActivatedN(const SceneId& previousSceneId, const SceneId& c
                if (isSaved != null)
                {
                        switch(isSaved->ToInt())
-                               {
-                               case ID_REFRESH_LIST_FROM_DATABASEVIEW:
+                       {
+                       case ID_REFRESH_LIST_FROM_DATABASEVIEW:
                                {
                                        DisplayData(ID_MEMO_LIST);
                                }
@@ -314,6 +315,14 @@ MemoListForm::OnSceneActivatedN(const SceneId& previousSceneId, const SceneId& c
                                }
                                break;
 
+                       case ID_REFRESH_LIST_FROM_LISTVIEW: //No change in the Memo database. Hence no need to create the LListview, just show it.
+                               {
+                                       MemoListPresentationModel::GetInstance()->ResetListIndex(ID_MEMO_LIST);
+                                       __pMemoListView->SetShowState(true);
+                                       __pMemoListView->ScrollToItem(0);
+                               }
+                               break;
+
                        default:
                                break;
                        }
index d65b594..b0412c5 100644 (file)
@@ -352,7 +352,13 @@ MemoListPresentationModel::HandleTaskComplete(const RequestId requestId, IList*
                        delete pArgs;
                }
                break;
-       
+       case ID_MEMO_LIST_APPEND:
+       {
+               __pMemoList->AddItems(*((LinkedList*)(pArgs->GetAt(0))));
+               pArgs->RemoveAll(false);
+               delete pArgs;
+       }
+       break;
        case ID_SEARCH_LIST:
                {
                        if (__pEnum != null)
index cb540b4..b057eda 100644 (file)
@@ -118,7 +118,7 @@ MemoApp::OnUserEventReceivedN(RequestId requestId, IList* pArgs)
                }
                return;
        }
-       if (requestId == ID_MEMO_LIST || requestId == ID_SEARCH_LIST )
+       if (requestId == ID_MEMO_LIST || requestId == ID_MEMO_LIST_APPEND || requestId == ID_SEARCH_LIST )
        {
                MemoListPresentationModel::GetInstance()->HandleTaskComplete(requestId, pArgs);
        }
index c0c52a3..7f26073 100644 (file)
@@ -393,18 +393,20 @@ CATCH:
 }
 
 IList*
-MemoManager::GetMemoListN()
+MemoManager::GetMemoListN(int start, int end)
 {
        DbStatement* pStmt = null;
        DbEnumerator* pEnum = null;
        IList* pMemoList = new (std::nothrow) LinkedList();
        //__pDatabase->BeginTransaction();
-       String statement(L"SELECT id,Contents,TextSize,Color,CreationTime,ModificationTime,DrawingFilePath from Memo ORDER BY ModificationTime DESC");
+       String statement(L"SELECT id,Contents,TextSize,Color,CreationTime,ModificationTime,DrawingFilePath from Memo ORDER BY ModificationTime DESC  LIMIT ?, ?");
 
        pStmt = __pDatabase->CreateStatementN(statement);
 
        if (pStmt != null)
        {
+               pStmt->BindInt(0, start);
+               pStmt->BindInt(1, end);
                pEnum = __pDatabase->ExecuteStatementN(*pStmt);
        }
 
index af8f326..d8815c4 100644 (file)
@@ -26,6 +26,7 @@
 #include "MmMemoApp.h"
 #include "MmTask.h"
 #include "MmTypes.h"
+#include "MmThumbnailProvider.h"
 
 using namespace Tizen::Base;
 using namespace Tizen::Base::Collection;
@@ -106,6 +107,7 @@ DeleteTask::Run(void)
                    if (pMemo != null && pMemo->GetMemoDrawingPath().IsEmpty() == false)
                {
                             RemoveMemoDrawingFile(pMemo->GetMemoDrawingPath());
+                            (MemoThumbnailProvider::GetInstance())->RemoveObjectBitmap(pMemo->GetMemoIndex());
                    }
                    delete pMemo;
                    pMemo = null;
@@ -153,12 +155,29 @@ ListTask::~ListTask(void)
 Object*
 ListTask::Run(void)
 {
-       IList* pMemoList = null;
+       /*IList* pMemoList = null;
        IList* pArgs = new (std::nothrow) ArrayList();
        pMemoList = (MemoManager::GetInstance()->GetMemoListN());
 
        pArgs->Add(dynamic_cast<LinkedList*>(pMemoList));
        MemoApp::GetInstance()->SendUserEvent(ID_MEMO_LIST, pArgs);
+*/
+       int count = MemoManager::GetInstance()->GetCount();
+       for (int i = 0; i <= count; i = i + 30)
+       {
+               IList* pMemoList = null;
+               IList* pArgs = new (std::nothrow) ArrayList();
+               pMemoList = (MemoManager::GetInstance()->GetMemoListN(i, i+30));
 
+               pArgs->Add(dynamic_cast<LinkedList*>(pMemoList));
+               if (i == 0)
+               {
+                MemoApp::GetInstance()->SendUserEvent(ID_MEMO_LIST, pArgs);
+               }
+               else
+               {
+                MemoApp::GetInstance()->SendUserEvent(ID_MEMO_LIST_APPEND, pArgs);
+               }
+       }
        return null;
 }
index 9a3af8c..1c91b67 100644 (file)
@@ -46,7 +46,6 @@ MemoTextDetailForm::MemoTextDetailForm(void)
        , __pPopup(null)
        , __pPopupList(null)
        , __pVntFilename(null)
-       , __pMemoIndex(null)
 {
        __pVMemoCreator = new (std::nothrow) VMemoCreator();
        __pAppControlListProvider = new (std::nothrow) AppControlListProvider();
@@ -73,11 +72,6 @@ MemoTextDetailForm::~MemoTextDetailForm(void)
                delete __pPopup;
                __pPopup = null;
        }
-       if(__pMemoIndex != null)
-       {
-               delete __pMemoIndex;
-               __pMemoIndex = null;
-       }
        return;
 }
 
@@ -178,11 +172,8 @@ MemoTextDetailForm::RemoveMemo(void)
        r = MemoDataPresentationModel::GetInstance()->RemoveMemoAt(__pMemoData->GetMemoIndex());
        if ( r == E_SUCCESS)
        {
-               MemoListPresentationModel::GetInstance()->RemoveMemoAtIndex(__pMemoIndex->ToInt());
-               delete __pMemoIndex;
-               __pMemoIndex = null;
                IList* pArgs = new (std::nothrow) ArrayList();
-               pArgs->Add(new (std::nothrow) Integer(ID_REFRESH_LIST_FROM_DATABASEVIEW));
+               pArgs->Add(new (std::nothrow) Integer(ID_REFRESH_LIST_FROM_DATABASE));
                pSceneManager->GoBackward(BackwardSceneTransition(IDSCN_MEMO_LIST), pArgs);
        }
        return;
@@ -201,6 +192,7 @@ MemoTextDetailForm::ShowCreateSceneInEditMode(void)
                __pEditArgList = new (std::nothrow) ArrayList();
                __pEditArgList->Construct();
        }
+       __pEditArgList->Add(new (std::nothrow) Integer(ID_CREATE_MODE_EDIT));
        __pEditArgList->Add(__pMemoData);
        pSceneManager->GoForward(ForwardSceneTransition(IDSCN_MEMO_TEXT_EDITOR), __pEditArgList);
        return;
@@ -292,9 +284,11 @@ MemoTextDetailForm::OnSceneActivatedN(const SceneId& previousSceneId, const Scen
                        SetMemoContent(__pMemoData->GetMemoContents().GetPointer(), __pMemoData->GetMemoTextSize(), Color(__pMemoData->GetMemoTextColor(), false));
                        String time = GetMemoCreationDateTime(__pMemoData->GetMemoModificationTime());
                        __pDateTime->SetText(time);
-                       __pMemoIndex = static_cast<Integer*>(pArgs->GetAt(1));
+                       Integer* pMemoIndex = static_cast<Integer*>(pArgs->GetAt(1));
                        Integer* pCount = static_cast<Integer*>(pArgs->GetAt(2));
-                       SetTitle(__pMemoIndex->ToInt(), pCount->ToInt());
+                       SetTitle(pMemoIndex->ToInt(), pCount->ToInt());
+
+                       delete pMemoIndex;
                        delete pCount;
                }
        }
index 64569d4..8ebf70e 100644 (file)
@@ -58,6 +58,8 @@ MemoTextEditorForm::MemoTextEditorForm(void)
        , __cursorPosition(0)
        , __isMemoTextMaxLength(false)
        , __isEdited(false)
+       , __pUpdateDetails(null)
+       , __isUpdateListView(false)
 {
 }
 
@@ -170,6 +172,11 @@ MemoTextEditorForm::OnInitializing(void)
 result
 MemoTextEditorForm::OnTerminating(void)
 {
+       if (__pUpdateDetails != null)
+       {
+               __pUpdateDetails->RemoveAll(false);
+               delete __pUpdateDetails;
+       }
        return E_SUCCESS;
 }
 
@@ -201,6 +208,18 @@ MemoTextEditorForm::OnActionPerformed(const Control& source, int actionId)
                {
                        MemoInfo* pNewMemo;
                        pNewMemo = GetMemoN();
+                       bool isUpdate = false;
+                       if(__pUpdateDetails == null)
+                       {
+                               __pUpdateDetails = new (std::nothrow) ArrayList();
+                               __pUpdateDetails->Construct();
+                       }
+                       else
+                       {
+                               __pUpdateDetails->RemoveAll(false);
+                       }
+                       __pUpdateDetails->Add(new (std::nothrow) Integer(ID_CREATE_MODE_NEW));
+
                        String text = __pMemoContentEditarea->GetText();
                        text.Trim();
                        if(text.GetLength() != 0)
@@ -217,10 +236,24 @@ MemoTextEditorForm::OnActionPerformed(const Control& source, int actionId)
                                        {
                                                UpdateMemoInfo();
                                        }
+                                       isUpdate = true;
                                }
                        }
                        delete pNewMemo;
-                       pSceneManager->GoForward(ForwardSceneTransition(IDSCN_MEMO_DRAWING_EDITOR, SCENE_TRANSITION_ANIMATION_TYPE_NONE, SCENE_HISTORY_OPTION_NO_HISTORY, SCENE_DESTROY_OPTION_DESTROY), null);
+                       if(__isUpdateListView == true)
+                       {
+                               isUpdate = true;
+                       }
+
+                       __pUpdateDetails->Add(new (std::nothrow) Integer (isUpdate));
+                       if(text.GetLength() == 0)
+                       {
+                               pSceneManager->GoForward(ForwardSceneTransition(IDSCN_MEMO_DRAWING_EDITOR, SCENE_TRANSITION_ANIMATION_TYPE_NONE, SCENE_HISTORY_OPTION_NO_HISTORY, SCENE_DESTROY_OPTION_DESTROY), null);
+                       }
+                       else
+                       {
+                               pSceneManager->GoForward(ForwardSceneTransition(IDSCN_MEMO_DRAWING_EDITOR, SCENE_TRANSITION_ANIMATION_TYPE_NONE, SCENE_HISTORY_OPTION_NO_HISTORY, SCENE_DESTROY_OPTION_DESTROY), __pUpdateDetails);
+                       }
                }
                break;
 
@@ -243,6 +276,16 @@ MemoTextEditorForm::OnActionPerformed(const Control& source, int actionId)
 
        case IDA_HEADER_BUTTON_CANCEL:
                {
+                       IList* pArgs = new (std::nothrow) ArrayList();
+                       if(__isUpdateListView == false)
+                       {
+                               pArgs->Add(new (std::nothrow) Integer(ID_REFRESH_LIST_FROM_LISTVIEW));
+                       }
+                       else
+                       {
+                               pArgs->Add(new (std::nothrow) Integer(ID_REFRESH_LIST_FROM_DATABASE));
+                       }
+
                        MemoInfo* pNewMemo;
                        pNewMemo = GetMemoN();
                        if (__isEdited == true)
@@ -263,12 +306,12 @@ MemoTextEditorForm::OnActionPerformed(const Control& source, int actionId)
                                                {
                                                        UpdateMemoInfo();
                                                }
+                                               pArgs->RemoveAt(0, true);
+                                               pArgs->Add(new (std::nothrow) Integer(ID_REFRESH_LIST_FROM_DATABASE));
                                        }
                                }
                        }
                        delete pNewMemo;
-                       IList* pArgs = new (std::nothrow) ArrayList();
-                       pArgs->Add(new (std::nothrow) Integer(ID_REFRESH_LIST_FROM_DATABASEVIEW));
                        pSceneManager->GoBackward(BackwardSceneTransition(IDSCN_MEMO_LIST), pArgs);
                }
                break;
@@ -373,17 +416,43 @@ MemoTextEditorForm::OnSceneActivatedN(const SceneId& previousSceneId, const Scen
 {
        RepositionControls(ID_DEFAULT_POSITION);
        SetSaveEnable();
-
        if (pArgs != null)
        {
-               __pEditMemo = static_cast< MemoInfo*>(pArgs->GetAt(0));
-               __isEditMode = true;
-               //Edit Memo
-               SetMemoEditDetails(__pEditMemo);
+               Integer* isNew = static_cast<Integer*>(pArgs->GetAt(0));
+               if(isNew != null)
+               {
+                       if(isNew->ToInt() == ID_CREATE_MODE_NEW)
+                       {
+                               __isEditMode = false;
+                       }
+                       else
+                       {
+                               __isEditMode = true;
+                       }
+               }
+               if(__isEditMode == true)
+               {
+                       __pEditMemo = static_cast< MemoInfo*>(pArgs->GetAt(1));
+                       //__isEditMode = true;
+                       //Edit Memo
+                       SetMemoEditDetails(__pEditMemo);
+                       __isUpdateListView = false;
+               }
+               else
+               {
+                       Integer* isUpdate = static_cast<Integer*>(pArgs->GetAt(1));
+                       if(isUpdate != null )
+                       {
+                               __isUpdateListView = isUpdate->ToInt();
+                       }
+                       //New memo
+                       RefreshCreateView();
+               }
        }
        else
        {
                __isEditMode = false;
+               __isUpdateListView = false;
                //New memo
                RefreshCreateView();
        }
@@ -593,7 +662,6 @@ MemoTextEditorForm::ShowHideFontSizeSlider(bool showState)
        {
                __pSliderPanel->SetShowState(false);
                __pMemoContentEditarea->ShowKeypad();
-               //ChangeSelectedButtonColor(BUTTON_NONE);
                RepositionControls(ID_DEFAULT_POSITION);
        }
        __pSliderPanel->Show();
index d63ffe4..cc4405b 100644 (file)
@@ -36,16 +36,16 @@ using namespace Tizen::Media;
 
 MemoThumbnailProvider::MemoThumbnailProvider(void)
        : __pTempArrayList(null)
-       , __pObjectList(null)
+       , __pThumbnailList(null)
 {
 }
 
 MemoThumbnailProvider::~MemoThumbnailProvider(void)
 {
-       if (__pObjectList != null)
+       if (__pThumbnailList != null)
        {
-               __pObjectList->RemoveAll(false);
-               delete __pObjectList;
+               __pThumbnailList->RemoveAll(true);
+               delete __pThumbnailList;
        }
        return;
 }
@@ -97,66 +97,26 @@ MemoThumbnailProvider::Construct(void)
 void
 MemoThumbnailProvider::RemoveObjectBitmap(int index)
 {
-       if (__pObjectList->GetCount() == 0)
+       if (__pThumbnailList->GetCount() == 0)
        {
                return ;
        }
-
-       IEnumerator* pEnum = null;
-       ThumbnailRequest* pObject = null;
-       pEnum = __pObjectList->GetEnumeratorN();
-
-       if (pEnum != null)
-       {
-               while (pEnum->MoveNext() == E_SUCCESS)
-               {
-                       pObject = static_cast<ThumbnailRequest*>(pEnum->GetCurrent());
-                       if (pObject != null)
-                       {
-                               if (pObject->GetRequestId() == index)
-                               {
-                                       __pObjectList->Remove(*pObject, false);
-                                       delete pObject;
-                                       delete pEnum;
-                                       pEnum = null;
-                                       return;
-                               }
-                       }
-               }
-       }
+       __pThumbnailList->Remove(Integer(index));
        return ;
 }
 
 Bitmap*
-MemoThumbnailProvider::GetDecodedBitmap(int objectIndex)
+MemoThumbnailProvider::GetDecodedBitmap(int objectIndex, int dbId)
 {
-       if (__pObjectList == null)
+       if (__pThumbnailList == null)
        {
                return null;
        }
 
-       IEnumerator* pEnum = null;
-       ThumbnailRequest* pObject = null;
-       pEnum = __pObjectList->GetEnumeratorN();
-       if (pEnum != null)
-       {
-               while (pEnum->MoveNext() == E_SUCCESS)
-               {
-                       pObject = static_cast<ThumbnailRequest*>(pEnum->GetCurrent());
-                       if (pObject != null)
-                       {
-                               if (pObject->GetRequestId() == objectIndex)
-                               {
-                                       delete pEnum;
-                                       pEnum = null;
-                                       return pObject->GetBitmap();
-                               }
-                       }
-               }
-               delete pEnum;
-               pEnum = null;
-       }
-       return null;
+       Bitmap* pBitmap = null;
+       pBitmap = static_cast<Bitmap*>(__pThumbnailList->GetValue(Integer(dbId)));
+
+       return pBitmap;
 }
 
 ThumbnailManagerResultValues
@@ -164,7 +124,6 @@ MemoThumbnailProvider::RequestThumbnail(ThumbnailRequest* pRequest)
 {
        if (pRequest == null)
        {
-               AppLogDebug("Thumbnail Request is null");
                return THUMBNAIL_MANAGER_RESULT_VALUES_FAILED;
        }
 
@@ -182,16 +141,17 @@ MemoThumbnailProvider::RequestThumbnail(ThumbnailRequest* pRequest)
                return THUMBNAIL_MANAGER_RESULT_VALUES_FAILED;
        }
 
-       if (pRequest != null)
+       /*if (pRequest != null)
        {
                pRequest->SetBitmap(pBitmap);
-       }
+       }*/
 
-       if (!__pObjectList)
+       if (__pThumbnailList == null)
        {
-               __pObjectList = new (std::nothrow) ArrayList();
+               __pThumbnailList = new (std::nothrow) HashMap();
+               __pThumbnailList->Construct();
        }
-       __pObjectList->Add(pRequest);
+       __pThumbnailList->Add(new Integer(pRequest->GetDbId()), pBitmap);
        return thumbMgrRes;
 }