Tizen::Ui::Controls::ListView* __pPopupList;
AppControlListProvider* __pAppControlListProvider;
VMemoCreator* __pVMemoCreator;
- Tizen::Base::Integer* __pMemoIndex;
+ Tizen::Base::Collection::ArrayList* __pUpdateDetails;
};
#endif /* _MM_DRAWING_DETAIL_FORM_H_ */
///Selected color from color picker
Tizen::Graphics::Color __selectedColor;
int __sliderValue;
+ bool __isUpdateListView;
+ Tizen::Base::Collection::ArrayList* __pUpdateDetails;
};
#endif /* _MM_DRAWING_EDITOR_FORM_H_ */
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);
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);
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_ */
/**
* @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
///VMemo creator instance
VMemoCreator* __pVMemoCreator;
Tizen::Base::String* __pVntFilename;
- Tizen::Base::Integer* __pMemoIndex;
};
#endif /* _MM_TEXT_DETAIL_FORM_H_ */
int __cursorPosition;
bool __isMemoTextMaxLength;
bool __isEdited;
+ Tizen::Base::Collection::ArrayList* __pUpdateDetails;
+ bool __isUpdateListView;
};
#endif /* _MM_TEXT_EDITOR_FORM_H_ */
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;
{
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;
{
__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);
/*!
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_ */
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
</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">
#include "MmListPresentationModel.h"
#include "MmTypes.h"
#include "MmVMemoCreator.h"
+#include "MmThumbnailProvider.h"
using namespace Tizen::Base;
using namespace Tizen::Base::Collection;
, __pMemoData(null)
, __pPopup(null)
, __pPopupList(null)
- , __pMemoIndex(null)
+ , __pUpdateDetails(null)
{
}
if (__pPopup != null)
{
delete __pPopup;
- __pPopup = null;
}
- if(__pMemoIndex != null)
+ if(__pUpdateDetails != null)
{
- delete __pMemoIndex;
- __pMemoIndex = null;
+ delete __pUpdateDetails;
}
-
return E_SUCCESS;
}
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;
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);
Image img;
img.Construct();
+
if (pArgs == null)
{
return;
__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);
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;
}
, __pSliderPreviewLabel(null)
, __selectedColor(Color::GetColor(COLOR_ID_BLACK))
, __sliderValue(1)
+ , __isUpdateListView(false)
+ , __pUpdateDetails(null)
{
__drawingMode = DRAWING_MODE_CURVELINE;
return;
MemoDrawingEditorForm::~MemoDrawingEditorForm(void)
{
- if (__pCanvas != null)
- {
- delete __pCanvas;
- }
- if (__pBitmap != null)
- {
- delete __pBitmap;
- }
- __drawingObjects.RemoveAll(true);
return;
}
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;
}
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);
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);
{
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;
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;
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);
}
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;
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;
}
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();
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);
}
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, 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
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
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;
, __pMemoListView(null)
, __pSearchBar(null)
, __pSearchItemProvider(null)
+ , __pPopup(null)
+ , __pPopupList(null)
{
}
{
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;
if (isSaved != null)
{
switch(isSaved->ToInt())
- {
- case ID_REFRESH_LIST_FROM_DATABASEVIEW:
+ {
+ case ID_REFRESH_LIST_FROM_DATABASEVIEW:
{
DisplayData(ID_MEMO_LIST);
}
}
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;
}
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)
}
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);
}
}
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);
}
#include "MmMemoApp.h"
#include "MmTask.h"
#include "MmTypes.h"
+#include "MmThumbnailProvider.h"
using namespace Tizen::Base;
using namespace Tizen::Base::Collection;
if (pMemo != null && pMemo->GetMemoDrawingPath().IsEmpty() == false)
{
RemoveMemoDrawingFile(pMemo->GetMemoDrawingPath());
+ (MemoThumbnailProvider::GetInstance())->RemoveObjectBitmap(pMemo->GetMemoIndex());
}
delete pMemo;
pMemo = null;
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;
}
, __pPopup(null)
, __pPopupList(null)
, __pVntFilename(null)
- , __pMemoIndex(null)
{
__pVMemoCreator = new (std::nothrow) VMemoCreator();
__pAppControlListProvider = new (std::nothrow) AppControlListProvider();
delete __pPopup;
__pPopup = null;
}
- if(__pMemoIndex != null)
- {
- delete __pMemoIndex;
- __pMemoIndex = null;
- }
return;
}
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;
__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;
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;
}
}
, __cursorPosition(0)
, __isMemoTextMaxLength(false)
, __isEdited(false)
+ , __pUpdateDetails(null)
+ , __isUpdateListView(false)
{
}
result
MemoTextEditorForm::OnTerminating(void)
{
+ if (__pUpdateDetails != null)
+ {
+ __pUpdateDetails->RemoveAll(false);
+ delete __pUpdateDetails;
+ }
return E_SUCCESS;
}
{
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)
{
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;
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)
{
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;
{
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();
}
{
__pSliderPanel->SetShowState(false);
__pMemoContentEditarea->ShowKeypad();
- //ChangeSelectedButtonColor(BUTTON_NONE);
RepositionControls(ID_DEFAULT_POSITION);
}
__pSliderPanel->Show();
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;
}
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
{
if (pRequest == null)
{
- AppLogDebug("Thumbnail Request is null");
return THUMBNAIL_MANAGER_RESULT_VALUES_FAILED;
}
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;
}