Tizen::Base::Collection::ArrayList* __pUpdateDetails;
Tizen::Ui::Controls::Popup* __pDeletePopup;
Tizen::Ui::TouchFlickGestureDetector* __pFlickGesture;
- Tizen::Base::Integer* __pMemoIndex;
- Tizen::Base::Integer* __pCount;
+ Tizen::Base::Integer* __pMemoIndex;
+ Tizen::Base::Integer* __pCount;
+ Tizen::Base::Collection::ArrayList* __pShareMemoList;
+ Tizen::Base::String* __pVntFilename;
+ Tizen::Base::String* __pDrawingFileName;
};
#endif /* _MM_DRAWING_DETAIL_FORM_H_ */
///previous list index
int __previousIndex;
MemoThumbnailProvider* __pThumbnailProvider;
+ Tizen::Ui::Controls::ListContextItem* __pItemContext;
};
///item provider to use AppControl. List of Applications to be used.
///VMemoCreator object that helps in creating VNT file for each memo to be shared
VMemoCreator* __pVMemoCreator;
///number of memo selected
- int __selectedMemoCount;
+ int __selectedMemoCount;
Tizen::Ui::Controls::Popup* __pDeletePopup;
+ Tizen::Base::Collection::ArrayList* __pShareMemoList;
};
#endif /* _MM_LIST_EDITOR_FORM_H_ */
class CustomDataProvider;
class MemoListDataProvider;
class MemoSearchDataProvider;
+class VMemoCreator;
///The form to List all memos.
class MemoListForm
: public IDataEventListener
int GetSortValueFromRegistry(void) const;
void SetSortValueToRegistry(const int value);
+ void DeleteListItem(void);
virtual void OnActionPerformed(const Tizen::Ui::Control& source, int actionId);
virtual void OnFormBackRequested(Tizen::Ui::Controls::Form& source);
virtual void OnKeypadOpened(Tizen::Ui::Control& source);
virtual void OnKeypadWillOpen(Tizen::Ui::Control& source){};
- virtual void OnListViewContextItemStateChanged (Tizen::Ui::Controls::ListView& listView, int index, int elementId, Tizen::Ui::Controls::ListContextItemStatus status){};
+ virtual void OnListViewContextItemStateChanged (Tizen::Ui::Controls::ListView& listView, int index, int elementId, Tizen::Ui::Controls::ListContextItemStatus status);
virtual void OnListViewItemLongPressed (Tizen::Ui::Controls::ListView& listView, int index, int elementId, bool &invokeListViewItemCallback){};
virtual void OnListViewItemReordered (Tizen::Ui::Controls::ListView& listView, int indexFrom, int indexTo){};
virtual void OnListViewItemStateChanged (Tizen::Ui::Controls::ListView& listView, int index, int elementId, Tizen::Ui::Controls::ListItemStatus status);
Tizen::App::AppRegistry* __pAppRegistry;
Tizen::Base::String __registryKey;
bool __isKeypadOpened;
+ Tizen::Ui::Controls::Popup* __pDeletePopup;
+ MemoInfo* __pMemoData;
+ int __selectedItemIndex;
+ Tizen::Ui::Controls::Popup* __pSharePopup;
+ Tizen::Ui::Controls::ListView* __pSharePopupList;
+ VMemoCreator* __pVMemoCreator;
+ AppControlListProvider* __pAppControlListProvider;
+ Tizen::Base::String* __pVntFilename;
+ Tizen::Base::Collection::ArrayList* __pShareMemoList;
};
#endif /* _MM_LIST_FORM_H_ */
Tizen::Base::String* __pVntFilename;
Tizen::Ui::Controls::Popup* __pDeletePopup;
Tizen::Ui::TouchFlickGestureDetector* __pFlickGesture;
- Tizen::Base::Integer* __pMemoIndex;
- Tizen::Base::Integer* __pCount;
+ Tizen::Base::Integer* __pMemoIndex;
+ Tizen::Base::Integer* __pCount;
+ Tizen::Base::Collection::ArrayList* __pShareMemoList;
};
#endif /* _MM_TEXT_DETAIL_FORM_H_ */
extern const int ID_LISTITEM_CONTENT;
extern const int ID_LISTITEM_DATETIME;
extern const int ID_LISTITEM_IMAGE;
+extern const int ID_LISTCONTEXTITEM_DELETE;
+extern const int ID_LISTCONTEXTITEM_SHARE;
//width and height of controls
extern const int W_LIST_ITEM_IMAGE;
extern const unsigned int COLOR_SELECT_ALL;
extern const unsigned int COLOR_TOOLBAR_BG;
extern const unsigned int COLOR_COMMENT_BG;
+extern const unsigned int COLOR_RED;
extern const wchar_t* IDB_COLOR_ICON;
extern const wchar_t* IDB_COLOR_ICON_PRESS;
</ListView>
<Label id="IDC_LABEL_SELECTED" parent="IDL_MEMO_LIST_EDITOR">
<property accessibilityHint="" backgroundBitmapPath="" backgroundColor="#444444" backgroundColorOpacity="100" horizontalAlign="ALIGN_CENTER" leftMargin="16" text="" textColor="#FFFFFF" textSize="33.0" textStyle="LABEL_TEXT_STYLE_BOLD" topMargin="0" verticalAlign="ALIGN_MIDDLE"/>
- <layout bottomRelation="" bottomRelationType="" centerHorizontal="false" centerVertical="false" height="48.0" horizontalFitPolicy="FIT_POLICY_FIXED" leftRelation="" leftRelationType="" marginBottom="0.0" marginLeft="0.0" marginRight="0.0" marginTop="0.0" mode="Portrait" rightRelation="" rightRelationType="" topRelation="" topRelationType="" verticalFitPolicy="FIT_POLICY_FIXED" width="720.0" x="0.0" y="966.0"/>
+ <layout bottomRelation="IDL_MEMO_LIST_EDITOR" bottomRelationType="RECT_EDGE_RELATION_BOTTOM_TO_BOTTOM" centerHorizontal="false" centerVertical="false" height="52.0" horizontalFitPolicy="FIT_POLICY_FIXED" leftRelation="" leftRelationType="" marginBottom="0.0" marginLeft="0.0" marginRight="0.0" marginTop="0.0" mode="Portrait" rightRelation="" rightRelationType="" topRelation="IDC_LISTVIEW_EDITLIST" topRelationType="RECT_EDGE_RELATION_TOP_TO_BOTTOM" verticalFitPolicy="FIT_POLICY_FIXED" width="720.0" x="0.0" y="959.0"/>
<layout bottomRelation="" bottomRelationType="" centerHorizontal="false" centerVertical="false" height="31.0" horizontalFitPolicy="FIT_POLICY_FIXED" leftRelation="" leftRelationType="" marginBottom="0.0" marginLeft="0.0" marginRight="0.0" marginTop="0.0" mode="Landscape" rightRelation="" rightRelationType="" topRelation="" topRelationType="" verticalFitPolicy="FIT_POLICY_FIXED" width="1274.0" x="0.0" y="521.0"/>
</Label>
</Scene>
, __pFlickGesture(null)
, __pMemoIndex(null)
, __pCount(null)
-
+ , __pShareMemoList(null)
+ , __pVntFilename(null)
+ , __pDrawingFileName(null)
{
+ __pVMemoCreator = new (std::nothrow) VMemoCreator();
}
MemoDrawingDetailForm::~MemoDrawingDetailForm(void)
}
if (__pPopup != null)
{
+ __pPopup->RemoveAllControls();
delete __pPopup;
}
if(__pUpdateDetails != null)
{
delete __pDeletePopup;
}
- if(__pMemoIndex != null)
+ if (__pMemoIndex != null)
{
delete __pMemoIndex;
__pMemoIndex = null;
}
- if(__pCount != null)
+ if (__pCount != null)
{
delete __pCount;
__pCount = null;
}
+ if (__pShareMemoList != null)
+ {
+ __pShareMemoList->RemoveAll();
+ delete __pShareMemoList;
+ }
+ if (__pVntFilename != null)
+ {
+ delete __pVntFilename;
+ }
+ if (__pDrawingFileName != null)
+ {
+ delete __pDrawingFileName;
+ }
+
}
result
result r = E_SUCCESS;
int xPos= 0, yPos = 0;
- __pVMemoCreator = new (std::nothrow) VMemoCreator();
-
Header* pFormHeader = GetHeader();
if (pFormHeader != null)
{
{
if (&listView == __pPopupList)
{
- String* pVmemoFilename = new (std::nothrow) String();
- ArrayList* pShareMemoList = new (std::nothrow) ArrayList();
+ if(__pVntFilename == null)
+ {
+ __pVntFilename = new (std::nothrow) String();
+ }
+ else
+ {
+ __pVntFilename->Clear();
+ }
+
+ if(__pShareMemoList == null)
+ {
+ __pShareMemoList = new (std::nothrow) ArrayList();
+ __pShareMemoList->Construct();
+ }
+ else
+ {
+ __pShareMemoList->RemoveAll();
+ }
__pPopup->SetShowState(false);
__pPopup->Invalidate(true);
- pShareMemoList->Construct();
- __pVMemoCreator = new (std::nothrow) VMemoCreator();
- *pVmemoFilename = __pVMemoCreator->CreateVMemo(*__pMemoData);
- pShareMemoList->Add(pVmemoFilename);
+ *__pVntFilename = __pVMemoCreator->CreateVMemo(*__pMemoData);
+ __pShareMemoList->Add(__pVntFilename);
- String* pDrawingFileName = new (std::nothrow) String();
- pDrawingFileName->Append(File::GetFileName(__pMemoData->GetMemoDrawingPath()));
- pShareMemoList->Add(pDrawingFileName);
+ if(__pDrawingFileName == null)
+ {
+ __pDrawingFileName = new (std::nothrow) String();
+ }
+ else
+ {
+ __pDrawingFileName->Clear();
+ }
+ __pDrawingFileName->Append(File::GetFileName(__pMemoData->GetMemoDrawingPath()));
+ __pShareMemoList->Add(__pDrawingFileName);
- LaunchAppToShare(index, pShareMemoList);
- pShareMemoList = null;
+ LaunchAppToShare(index, __pShareMemoList);
}
return;
}
__pMemoData->SetMemoContents(fileName);
}
DateTime modificationTime;
- SystemTime::GetCurrentTime(STANDARD_TIME, modificationTime);
+ SystemTime::GetCurrentTime(TIME_MODE_UTC, modificationTime);
__pMemoData->SetMemoModificationTime(modificationTime);
MemoDataPresentationModel::GetInstance()->UpdateMemoAt(__pMemoData->GetMemoIndex(), __pMemoData);
__memoComment = newComment;
__pMemoCreateTimePanel->SetBackgroundColor(Color::GetColor(COLOR_ID_WHITE));
__pMemoCreateTime = static_cast<Label*>(GetControl("IDC_LABEL_DATETIME"));
- SystemTime::GetCurrentTime(STANDARD_TIME, __createTime);
+ SystemTime::GetCurrentTime(TIME_MODE_UTC, __createTime);
String createTimeString = GetMemoCreationDateTime(__createTime);
__pMemoCreateTime->SetText(createTimeString);
__pMemoCreateTime->SetBackgroundColor(Color::GetColor(COLOR_ID_WHITE));
void
MemoDrawingEditorForm::SetDateTime(void)
{
- SystemTime::GetCurrentTime(STANDARD_TIME, __createTime);
+ SystemTime::GetCurrentTime(TIME_MODE_UTC, __createTime);
String createTimeString = GetMemoCreationDateTime(__createTime);
__pMemoCreateTime->SetText(createTimeString);
__pMemoCreateTime->Invalidate(true);
String comment = __pComment->GetText();
comment.Trim();
+ bool enable = false;
+ int objectCount = __drawingObjects.GetCount();
+ if(objectCount == 0)
+ {
+ enable = false; //No line , no eraser so object count is zero
+ }
+ else
+ {
+ //Check the object count for all the objects
+ for(int i = 0; i < objectCount; i++)
+ {
+ DrawingObject* object = null;
+ object = (DrawingObject*)__drawingObjects.GetAt(i);
+ //In create mode check only for Curve line objects
+ if(__isEditMode == false)
+ {
+ if(object != null && object->GetDrawingObjectType() == CURVELINE_OBJECT )
+ {
+ CurveLine* pCurveLine = (CurveLine*)object;
+ if(pCurveLine != null && pCurveLine->curvelinePointLists.GetCount() < 2)
+ {
+ enable = false;
+ }
+ else
+ {
+ enable = true;
+ break;
+ }
+ }
+ }
+ else
+ {
+ //In create mode check both for Curveline and eraser objects
+ //as user can edit the already drawn image using eraser before drawing any new line
+ if(object != null && object->GetDrawingObjectType() == CURVELINE_OBJECT )
+ {
+ CurveLine* pCurveLine = (CurveLine*)object;
+ if(pCurveLine != null && pCurveLine->curvelinePointLists.GetCount() < 2)
+ {
+ enable = false;
+ }
+ else
+ {
+ enable = true;
+ break;
+ }
+ }
+ else if(object != null && object->GetDrawingObjectType() == ERASER_OBJECT )
+ {
+ Eraser* pEraser = (Eraser*)object;
+ if(pEraser != null && pEraser->eraserPointLists.GetCount() < 2)
+ {
+ enable = false;
+ }
+ else
+ {
+ enable = true;
+ break;
+ }
+ }
+ }
+ }
+ }
if (isEnable == true)
{
if(__isEditMode == false)
{
- int pointCount = 0;
- if(__pCurveLine != null)
- {
- pointCount = __pCurveLine->GetObjectCount();
- }
- if (pointCount > 1 || comment.GetLength() != 0)
+ if (enable == true || comment.GetLength() != 0)
{
__pFormHeader->SetButtonEnabled(BUTTON_POSITION_LEFT, true);
}
else
{
- __pComment->Clear();
+ __pFormHeader->SetItemSelected(1);
__pFormHeader->SetButtonEnabled(BUTTON_POSITION_LEFT, false);
__pFormHeader->SetButtonTextColor(BUTTON_ITEM_STATUS_DISABLED, Color::GetColor(COLOR_ID_GREY));
}
}
else if(__isEditMode == true)
{
- int pointCount = 0;
- if(__pCurveLine != null)
- {
- pointCount = __pCurveLine->GetObjectCount();
- }
- else if(__pEraser != null)
- {
- pointCount = __pEraser->eraserPointLists.GetCount();
- }
- if (pointCount > 1 || IsCommentEdited() == true)
+ if (enable == true || IsCommentEdited() == true)
{
__pFormHeader->SetButtonEnabled(BUTTON_POSITION_LEFT, true);
}
else
{
- __pComment->Clear();
+ __pFormHeader->SetItemSelected(1);
__pFormHeader->SetButtonEnabled(BUTTON_POSITION_LEFT, false);
__pFormHeader->SetButtonTextColor(BUTTON_ITEM_STATUS_DISABLED, Color::GetColor(COLOR_ID_GREY));
}
}
- else
- {
- //When only whitespace is entered, Save has to be disabled and
- //the Comment EditArea's field has to be cleared
- __pComment->Clear();
- __pFormHeader->SetButtonEnabled(BUTTON_POSITION_LEFT, false);
- __pFormHeader->SetButtonTextColor(BUTTON_ITEM_STATUS_DISABLED, Color::GetColor(COLOR_ID_GREY));
- }
}
else
{
else
{
UpdateMemoInfo();
+ (MemoThumbnailProvider::GetInstance())->RemoveObjectBitmap(__pEditMemo->GetMemoIndex());
}
pArgs->RemoveAt(0, true);
pArgs->Add(new (std::nothrow) Integer(ID_REFRESH_LIST_FROM_DATABASE));
pNewMemo->SetMemoTextColor(colorRGB);
Tizen::Base::DateTime modificationTime;
- SystemTime::GetCurrentTime(STANDARD_TIME, modificationTime);
+ SystemTime::GetCurrentTime(TIME_MODE_UTC, modificationTime);
pNewMemo->SetMemoModificationTime(modificationTime);
pNewMemo->SetMemoDrawingPath(filePath);
pNewMemo->SetMemoDrawingPath(__pEditMemo->GetMemoDrawingPath());
Tizen::Base::DateTime modificationTime;
- SystemTime::GetCurrentTime(STANDARD_TIME, modificationTime);
+ SystemTime::GetCurrentTime(TIME_MODE_UTC, modificationTime);
pNewMemo->SetMemoModificationTime(modificationTime);
r = MemoDataPresentationModel::GetInstance()->UpdateMemoAt(__pEditMemo->GetMemoIndex(), pNewMemo);
}
else
{
- if(__drawingObjects.GetCount() == 0)
- {
- SetSaveEnabled(false);
- }
- else
- {
- int objectCount = __drawingObjects.GetCount();
- bool enable = false;
- for (int i=0; i < objectCount; i++)
- {
- DrawingObject* object = null;
- object = (DrawingObject*)__drawingObjects.GetAt(i);
- if(object != null && object->GetDrawingObjectType() == CURVELINE_OBJECT )
- {
- CurveLine* pCurveLine = (CurveLine*)object;
- if(pCurveLine != null && pCurveLine->curvelinePointLists.GetCount() < 2)
- {
- enable = false;
- }
- else
- {
- enable = true;
- break;
- }
- }
- }
- if(enable == true)
- {
- SetSaveEnabled(true);
- }
- else
- {
- SetSaveEnabled(false);
- }
-
- }
+ SetSaveEnabled(true);
}
}
__pComment->SetCursorPosition(0);
, __previousIndex(-1)
{
__pThumbnailProvider = MemoThumbnailProvider::GetInstance();
+ __pItemContext = new (std::nothrow) ListContextItem();
+ __pItemContext->Construct();
+ __pItemContext->AddElement(ID_LISTCONTEXTITEM_SHARE, GetResourceString(L"IDS_COM_BUTTON_SHARE"));
+ __pItemContext->AddElement(ID_LISTCONTEXTITEM_DELETE, GetResourceString(L"IDS_COM_BODY_DELETE"));
+ __pItemContext->SetElementBackgroundColor(ID_LISTCONTEXTITEM_DELETE, LIST_CONTEXT_ITEM_ELEMENT_STATUS_NORMAL, Color(COLOR_RED, false));
+ __pItemContext->SetElementBackgroundColor(ID_LISTCONTEXTITEM_DELETE, LIST_CONTEXT_ITEM_ELEMENT_STATUS_PRESSED, Color(COLOR_RED, false));
+
return;
}
MemoListDataProvider::~MemoListDataProvider(void)
{
+ if(__pItemContext != null)
+ {
+ delete __pItemContext;
+ __pItemContext = null;
+ }
return;
}
pItem->AddElement(Rectangle(X_RECTANGLE, Y_RECTANGLE_TEXT, W_EDIT_MAIN_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);
}
}
+
+ if (currentSceneId == IDSCN_MEMO_LIST && __pItemContext != null)
+ {
+ pItem->SetContextItem(__pItemContext);
+ }
return pItem;
}
else
, __pVMemoCreator(null)
, __selectedMemoCount(0)
, __pDeletePopup(null)
+ , __pShareMemoList(null)
{
}
}
if (__pPopup != null)
{
+ __pPopup->RemoveAllControls();
delete __pPopup;
__pPopup = null;
}
delete __pDeletePopup;
__pDeletePopup = null;
}
+ if (__pShareMemoList != null)
+ {
+ __pShareMemoList->RemoveAll(true);
+ delete __pShareMemoList;
+ }
return E_SUCCESS;
}
MemoListEditorForm::CreateVntFilesList(void)
{
bool isItemChecked = false;
- ArrayList* pShareMemoList = new (std::nothrow) ArrayList();
+
+ if(__pShareMemoList == null)
+ {
+ __pShareMemoList = new (std::nothrow) ArrayList();
+ __pShareMemoList->Construct();
+ }
+ else
+ {
+ __pShareMemoList->RemoveAll(true);
+ }
MemoListPresentationModel::GetInstance()->ResetListIndex(ID_MEMO_LIST);
- pShareMemoList->Construct();
for (int itemIndex = 0; itemIndex <= __memoCount; itemIndex++)
{
{
String* pFilename = new (std::nothrow) String();
*pFilename = __pVMemoCreator->CreateVMemo(*pMemoData);
- pShareMemoList->Add(pFilename);
+ __pShareMemoList->Add(pFilename);
if (!pMemoData->GetMemoDrawingPath().IsEmpty())
{
String* pDrawingFileName = new (std::nothrow) String();
pDrawingFileName->Append(File::GetFileName(pMemoData->GetMemoDrawingPath()));
- pShareMemoList->Add(pDrawingFileName);
+ __pShareMemoList->Add(pDrawingFileName);
}
}
}
}
- return pShareMemoList;
+ return __pShareMemoList;
}
void
*/
#include "MmCommonUtils.h"
+#include "MmDataPresentationModel.h"
#include "MmMemoManager.h"
#include "MmInfo.h"
#include "MmItemProviders.h"
#include "MmListPresentationModel.h"
#include "MmThumbnailProvider.h"
#include "MmTypes.h"
+#include "MmVMemoCreator.h"
using namespace Tizen::App;
using namespace Tizen::Base;
, __pPopupList(null)
, __pAppRegistry(null)
, __isKeypadOpened(false)
+ , __pDeletePopup(null)
+ , __pMemoData(null)
+ , __selectedItemIndex(-1)
+ , __pSharePopup(null)
+ , __pVntFilename(null)
+ , __pShareMemoList(null)
{
+ __pVMemoCreator = new (std::nothrow) VMemoCreator();
+ __pAppControlListProvider = new (std::nothrow) AppControlListProvider();
}
MemoListForm::~MemoListForm(void)
__pMemoDetails->RemoveAll(false);
delete __pMemoDetails;
}
- if(__pSortByListProvider != null)
+ if (__pSortByListProvider != null)
{
delete __pSortByListProvider;
__pSortByListProvider = null;
}
+ if (__pVMemoCreator != null)
+ {
+ delete __pVMemoCreator;
+ }
+ if (__pAppControlListProvider != null)
+ {
+ delete __pAppControlListProvider;
+ }
+ if (__pPopup != null)
+ {
+ __pPopup->RemoveAllControls();
+ delete __pPopup;
+ __pPopup = null;
+ }
+ if (__pSharePopup != null)
+ {
+ __pSharePopup->RemoveAllControls();
+ delete __pSharePopup;
+ __pSharePopup = null;
+ }
+ if (__pVntFilename != null)
+ {
+ delete __pVntFilename;
+ }
+ if(__pShareMemoList != null)
+ {
+ __pShareMemoList->RemoveAll();
+ delete __pShareMemoList;
+ }
return E_SUCCESS;
}
break;
case IDA_BUTTON_CLOSE_POPUP:
{
- __pPopup->SetShowState(false);
- __pPopup->Invalidate(true);
+ if(__pPopup != null && __pPopup->GetShowState() == true)
+ {
+ __pPopup->SetShowState(false);
+ __pPopup->Invalidate(true);
+ }
+ if(__pSharePopup != null && __pSharePopup->GetShowState() == true)
+ {
+ __pSharePopup->SetShowState(false);
+ __pSharePopup->Invalidate(true);
+ }
+ }
+ break;
+ case IDA_BUTTON_CANCEL_POPUP:
+ {
+ __pDeletePopup->SetShowState(false);
+ __pDeletePopup->Invalidate(true);
+ }
+ break;
+
+ case IDA_BUTTON_DELETE_POPUP:
+ {
+ __pDeletePopup->SetShowState(false);
+ __pDeletePopup->Invalidate(true);
+ DeleteListItem();
}
break;
+
default:
break;
}
}
void
+MemoListForm::DeleteListItem(void)
+{
+ if(__pMemoData != null)
+ {
+ result r = E_SUCCESS;
+ int count = MemoListPresentationModel::GetInstance()->GetMemoCount(ID_MEMO_LIST);
+ bool isDrawingMemo = false;
+ if(__pMemoData->GetMemoDrawingPath().IsEmpty() == false)
+ {
+ isDrawingMemo = true;
+ }
+ r = MemoDataPresentationModel::GetInstance()->RemoveMemoAt(__pMemoData->GetMemoIndex());
+ if (r == E_SUCCESS)
+ {
+ if(isDrawingMemo == true)
+ {
+ //Delete the drawing file from /shared/data path
+ RemoveMemoDrawingFile(__pMemoData->GetMemoDrawingPath());
+ (MemoThumbnailProvider::GetInstance())->RemoveObjectBitmap(__pMemoData->GetMemoIndex());
+ }
+ MemoListPresentationModel::GetInstance()->RemoveMemoAtIndex(__selectedItemIndex);
+ __pMemoListView->UpdateList();
+ if(count == 1)
+ {
+ MemoListPresentationModel::GetInstance()->CreateMemoRegistry();
+ MemoListPresentationModel::GetInstance()->SetValueToRegistry(0);
+ }
+
+ SetListFormTitle(ID_MEMO_LIST);
+ //Enable or disable the edit option depending on the memo count
+ int memoCount = MemoListPresentationModel::GetInstance()->GetMemoCount(ID_MEMO_LIST);
+ if (memoCount == 0)
+ {
+ __pFormFooter->SetButtonEnabled(BUTTON_POSITION_LEFT, false);
+ }
+ else
+ {
+ __pFormFooter->SetButtonEnabled(BUTTON_POSITION_LEFT, true);
+ }
+ __pFormFooter->Draw();
+ }
+ __pMemoData = null;
+ __selectedItemIndex = -1;
+ }
+ return;
+}
+
+void
+MemoListForm::OnListViewContextItemStateChanged(ListView& listView, int index, int elementId, ListContextItemStatus status)
+{
+ if (__pSearchBar->GetMode() == SEARCH_BAR_MODE_NORMAL || __isSearchRegistered == false)
+ {
+ __pMemoData = MemoListPresentationModel::GetInstance()->GetMemoAt(index, ID_MEMO_LIST);
+ }
+ else
+ {
+ return;
+ }
+ __selectedItemIndex = index;
+
+ if(elementId == ID_LISTCONTEXTITEM_SHARE)
+ {
+ if (__pSharePopup == null)
+ {
+ __pSharePopup = new (std::nothrow) Popup();
+ __pSharePopupList = new (std::nothrow) ListView();
+ __pSharePopupList->Construct(Tizen::Graphics::Rectangle(X_POPUP_LIST_RECTANGLE, Y_POPUP_LIST_RECTANGLE, W_POPUP_LIST_RECTANGLE, H_POPUP_LIST_RECTANGLE), true, SCROLL_STYLE_FAST_SCROLL);
+ ConstructAppControlPopup(__pSharePopup, __pSharePopupList, __pAppControlListProvider, this, this);
+ }
+ __pSharePopup->SetShowState(true);
+ __pSharePopup->Show();
+ }
+ else if(elementId == ID_LISTCONTEXTITEM_DELETE)
+ {
+ if (__pDeletePopup == null)
+ {
+ __pDeletePopup = new (std::nothrow) Popup();
+ ConstructDeletePopup(__pDeletePopup, this);
+ }
+ __pDeletePopup->SetShowState(true);
+ __pDeletePopup->Show();
+ }
+ return;
+
+}
+
+void
MemoListForm::OnListViewItemStateChanged (ListView& listView, int index, int elementId, ListItemStatus status)
{
+ MemoInfo* pMemoData = null;
+
if (&listView == __pPopupList)
{
__pPopupList->SetItemChecked(index, false);
MemoListPresentationModel::GetInstance()->RegisterListTask();
return;
}
+ else if (&listView == __pSharePopupList)
+ {
+ if(__pVntFilename == null)
+ {
+ __pVntFilename = new (std::nothrow) String();
+ }
+ else
+ {
+ __pVntFilename->Clear();
+ }
+
+ if(__pShareMemoList == null)
+ {
+ __pShareMemoList = new (std::nothrow) ArrayList();
+ __pShareMemoList->Construct();
+ }
+ else
+ {
+ __pShareMemoList->RemoveAll();
+ }
+
+ __pSharePopup->SetShowState(false);
+ __pSharePopup->Invalidate(true);
+
+ *__pVntFilename = __pVMemoCreator->CreateVMemo(*__pMemoData);
+ __pShareMemoList->Add(__pVntFilename);
+
+ LaunchAppToShare(index, __pShareMemoList);
+ return;
+ }
__pSearchBar->HideKeypad();
SceneManager* pSceneManager = SceneManager::GetInstance();
- MemoInfo* pMemoData = null;
if (__pSearchBar->GetMode() == SEARCH_BAR_MODE_NORMAL || __isSearchRegistered == false)
{
pMemoData = MemoListPresentationModel::GetInstance()->GetMemoAt(index, ID_MEMO_LIST);
DbStatement* pStmt = null;
__pDatabase->BeginTransaction();
- statement.Append(L"SELECT * FROM Memo WHERE Contents LIKE ? ESCAPE ']' ORDER BY ModificationTime DESC");
+ //statement.Append(L"SELECT * FROM Memo WHERE Contents LIKE ? ESCAPE ']' ORDER BY ModificationTime DESC");
+ int sortType = GetSortByType();
+
+ if(sortType == ID_SORT_BY_LATEST)
+ {
+ statement.Append(L"SELECT * FROM Memo WHERE Contents LIKE ? ESCAPE ']' ORDER BY ModificationTime DESC");
+ }
+ else if(sortType == ID_SORT_BY_OLDER)
+ {
+ statement.Append(L"SELECT * FROM Memo WHERE Contents LIKE ? ESCAPE ']' ORDER BY ModificationTime ASC");
+ }
+ else if(sortType == ID_SORT_BY_ATOZ)
+ {
+ statement.Append(L"SELECT * FROM Memo WHERE Contents LIKE ? ESCAPE ']' ORDER BY Contents");
+ }
+ else
+ {
+ statement.Append(L"SELECT * FROM Memo WHERE Contents LIKE ? ESCAPE ']' ORDER BY Contents DESC");
+ }
+
pStmt = __pDatabase->CreateStatementN(statement);
GetLastResult();
keyword2.Append(keyword);
, __pFlickGesture(null)
, __pMemoIndex(null)
, __pCount(null)
+ , __pShareMemoList(null)
{
__pVMemoCreator = new (std::nothrow) VMemoCreator();
__pAppControlListProvider = new (std::nothrow) AppControlListProvider();
}
if (__pPopup != null)
{
+ __pPopup->RemoveAllControls();
delete __pPopup;
__pPopup = null;
}
delete __pDeletePopup;
__pDeletePopup = null;
}
- if(__pMemoIndex != null)
+ if (__pMemoIndex != null)
{
delete __pMemoIndex;
__pMemoIndex = null;
}
- if(__pCount != null)
+ if (__pCount != null)
{
delete __pCount;
__pCount = null;
}
+ if (__pVntFilename != null)
+ {
+ delete __pVntFilename;
+ }
+ if (__pShareMemoList != null)
+ {
+ __pShareMemoList->RemoveAll();
+ delete __pShareMemoList;
+ }
return;
}
{
if (&listView == __pPopupList)
{
- __pVntFilename = new (std::nothrow) String();
- ArrayList* pShareMemoList = new (std::nothrow) ArrayList();
+ if(__pVntFilename == null)
+ {
+ __pVntFilename = new (std::nothrow) String();
+ }
+ else
+ {
+ __pVntFilename->Clear();
+ }
+
+ if(__pShareMemoList == null)
+ {
+ __pShareMemoList = new (std::nothrow) ArrayList();
+ __pShareMemoList->Construct();
+ }
+ else
+ {
+ __pShareMemoList->RemoveAll();
+ }
__pPopup->SetShowState(false);
__pPopup->Invalidate(true);
- pShareMemoList->Construct();
*__pVntFilename = __pVMemoCreator->CreateVMemo(*__pMemoData);
- pShareMemoList->Add(__pVntFilename);
+ __pShareMemoList->Add(__pVntFilename);
- LaunchAppToShare(index, pShareMemoList);
- pShareMemoList = null;
+ LaunchAppToShare(index, __pShareMemoList);
}
return;
}
else
{
Tizen::Base::DateTime modificationTime;
- SystemTime::GetCurrentTime(STANDARD_TIME, modificationTime);
+ SystemTime::GetCurrentTime(TIME_MODE_UTC, modificationTime);
pNewMemo->SetMemoModificationTime(modificationTime);
r = MemoDataPresentationModel::GetInstance()->AddMemo(*pNewMemo);
pNewMemo->SetMemoCreationTime(__pEditMemo->GetMemoCreationTime());
Tizen::Base::DateTime modificationTime;
- SystemTime::GetCurrentTime(STANDARD_TIME, modificationTime);
+ SystemTime::GetCurrentTime(TIME_MODE_UTC, modificationTime);
pNewMemo->SetMemoModificationTime(modificationTime);
r = MemoDataPresentationModel::GetInstance()->UpdateMemoAt(__pEditMemo->GetMemoIndex(), pNewMemo);
__pColorPickerPanel->Invalidate(true);
__pSliderPanel->SetShowState(false);
__pSliderPanel->Invalidate(true);
- SystemTime::GetCurrentTime(STANDARD_TIME, __createTime);
+ SystemTime::GetCurrentTime(TIME_MODE_UTC, __createTime);
String createTimeString = GetMemoCreationDateTime(__createTime);
__pMemoCreateTime->SetText(createTimeString);
__pMemoCreateTime->Invalidate(true);
__isEditMode = true;
SetControlAlwaysAtBottom(*this, true);
- SystemTime::GetCurrentTime(STANDARD_TIME, __createTime);
+ SystemTime::GetCurrentTime(TIME_MODE_UTC, __createTime);
String createTimeString = GetMemoCreationDateTime(__createTime);
__pMemoCreateTime->SetText(createTimeString);
const int ID_LISTITEM_CONTENT = 201;
const int ID_LISTITEM_DATETIME = 202;
const int ID_LISTITEM_IMAGE = 203;
+const int ID_LISTCONTEXTITEM_DELETE = 204;
+const int ID_LISTCONTEXTITEM_SHARE = 205;
const int X_RECTANGLE = 16;
const int Y_RECTANGLE_TEXT = 1;//1;
const unsigned int COLOR_SELECT_ALL = 0x3D7EA3;
const unsigned int COLOR_TOOLBAR_BG = 0xEAE8E1;
const unsigned int COLOR_COMMENT_BG = 0xF8F6EF;
+const unsigned int COLOR_RED = 0xD05252;
const wchar_t* IDB_COLOR_ICON = L"P02_edit_toolbar_icon_color.png";
const wchar_t* IDB_COLOR_ICON_PRESS = L"P02_edit_toolbar_icon_color_press.png";