///Launches the create drawing scene in edit mode with selected memo content
void EditDrawingMemo(void);
+ void HandleSavePopUpCancelEvent(void);
+
private:
Tizen::Base::String __memoComment;
Tizen::Graphics::Bitmap* __pBitmap;
Tizen::Base::String* __pVntFilename;
Tizen::Base::String* __pDrawingFileName;
Tizen::Ui::Controls::OptionMenu* __pOption;
+ Tizen::Ui::Controls::Popup* __pSavePopup;
+ int __previousActionId;
};
#endif /* _MM_DRAWING_DETAIL_FORM_H_ */
#ifndef _MM_DRAWING_EDITOR_FORM_H_
#define _MM_DRAWING_EDITOR_FORM_H_
+#include <FSystem.h>
+
class CurveLine;
class DrawingObject;
class Eraser;
, public Tizen::Ui::Controls::ISliderEventListener
, public Tizen::Ui::Scenes::ISceneEventListener
, public Tizen::Ui::IPropagatedKeyEventListener
+ , public Tizen::System::ISettingEventListener
{
public:
MemoDrawingEditorForm(void);
virtual bool OnPreviewKeyReleased (Control &source, const Tizen::Ui::KeyEventInfo &keyEventInfo);
virtual void OnFormBackRequested(Tizen::Ui::Controls::Form& source);
+
+ virtual void OnSettingChanged(Tizen::Base::String& key);
private:
///indicates the mode of canvas
enum MemoDrawingMode
Tizen::Base::Collection::ArrayList* __pUpdateDetails;
Tizen::Ui::Controls::Popup* __pSavePopup;
int __previousActionId;
+ Tizen::Base::String __dateTimeFormat;
+ Tizen::Base::String __dateTime;
};
#endif /* _MM_DRAWING_EDITOR_FORM_H_ */
#ifndef _MM_TEXT_EDITOR_FORM_H_
#define _MM_TEXT_EDITOR_FORM_H_
+#include <FSystem.h>
+
enum RepositionLabel
{
ID_DEMO_POSITION,
, public Tizen::Ui::Controls::IFormBackEventListener
, public Tizen::Ui::Controls::ISliderEventListener
, public Tizen::Ui::Scenes::ISceneEventListener
+ , public Tizen::System::ISettingEventListener
{
public:
MemoTextEditorForm(void);
bool IsMemoEdited(void);
+ void SetDateTime(void);
+
virtual void OnActionPerformed(const Tizen::Ui::Control& source, int actionId);
virtual void OnAdjustmentValueChanged(const Tizen::Ui::Control& source, int adjustment);
virtual void OnTouchPressed(const Tizen::Ui::Control& source, const Tizen::Graphics::Point& currentPosition, const Tizen::Ui::TouchEventInfo& touchInfo);
virtual void OnTouchReleased(const Tizen::Ui::Control& source, const Tizen::Graphics::Point& currentPosition, const Tizen::Ui::TouchEventInfo& touchInfo){};
+ virtual void OnSettingChanged(Tizen::Base::String& key);
private:
Tizen::Graphics::Color __buttonColor;
///the memo creation time
Tizen::Ui::Controls::Button* __pButtonTextMode;
Tizen::Ui::Controls::Popup* __pSavePopup;
int __previousActionId;
+ Tizen::Base::String __dateTimeFormat;
+ Tizen::Base::String __dateTime;
};
#endif /* _MM_TEXT_EDITOR_FORM_H_ */
pButton2->AddActionEventListener(*pActionEventListener);
pPopup->Invalidate(true);
- AppLog("Seema 1");
}
return;
}
, __pVntFilename(null)
, __pDrawingFileName(null)
, __pOption(null)
+ , __pSavePopup(null)
{
__pVMemoCreator = new (std::nothrow) VMemoCreator();
}
{
__pOption->Destroy();
}
+ if (__pSavePopup != null)
+ {
+ __pSavePopup->RemoveAllControls();
+ delete __pSavePopup;
+ __pSavePopup = null;
+ }
return E_SUCCESS;
}
case IDA_FOOTER_BUTTON_CREATE: //New
{
- SceneManager* pSceneManager = SceneManager::GetInstance();
+ __previousActionId = IDA_FOOTER_BUTTON_CREATE;
UpdateComment();
- pSceneManager->GoForward(ForwardSceneTransition(IDSCN_MEMO_DRAWING_EDITOR), null);
}
break;
case IDA_FOOTER_BUTTON_SHARE: //Share
{
+ __previousActionId = IDA_FOOTER_BUTTON_SHARE;
UpdateComment();
- // Shows List of AppControls to share Memo.
- if (__pPopup == null)
- {
- __pPopup = new (std::nothrow) Popup();
- __pPopupList = new (std::nothrow) ListView();
- __pPopupList->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);
- AppControlListProvider* pAppControlListProvider = new (std::nothrow) AppControlListProvider();
- ConstructAppControlPopup(__pPopup, __pPopupList, pAppControlListProvider, this, this);
- }
- __pPopup->SetShowState(true);
- __pPopup->Show();
}
break;
case IDA_FOOTER_BUTTON_EDIT: //Edit
{
+ __previousActionId = IDA_FOOTER_BUTTON_EDIT;
UpdateComment();
- EditDrawingMemo();
+ }
+ break;
+
+ case IDA_BUTTON_SAVE_POPUP:
+ {
+ __pSavePopup->SetShowState(false);
+ __pSavePopup->Invalidate(true);
+
+ String newComment = __pCommentEditArea->GetText();
+ newComment.Trim();
+ if (newComment.IsEmpty() != true)
+ {
+ __pMemoData->SetMemoContents(newComment);
+ }
+ else
+ {
+ //If comment is null then save the filename as contents in memo data
+ String fileName = File::GetFileName(__pMemoData->GetMemoDrawingPath());
+ fileName.SetLength(fileName.GetLength() - FILE_EXTENSION_SIZE);
+ __pMemoData->SetMemoContents(fileName);
+ }
+ DateTime modificationTime;
+ SystemTime::GetCurrentTime(TIME_MODE_UTC, modificationTime);
+ __pMemoData->SetMemoModificationTime(modificationTime);
+ MemoDataPresentationModel::GetInstance()->UpdateMemoAt(__pMemoData->GetMemoIndex(), __pMemoData);
+ __memoComment = newComment;
+ HandleSavePopUpCancelEvent();
}
break;
case IDA_BUTTON_CANCEL_POPUP:
{
- __pDeletePopup->SetShowState(false);
- __pDeletePopup->Invalidate(true);
+ if(__pDeletePopup && __pDeletePopup->GetShowState() == true)
+ {
+ __pDeletePopup->SetShowState(false);
+ __pDeletePopup->Invalidate(true);
+ }
+ if(__pSavePopup && __pSavePopup->GetShowState() == true)
+ {
+ __pSavePopup->SetShowState(false);
+ __pSavePopup->Invalidate(true);
+ HandleSavePopUpCancelEvent();
+ }
}
break;
}
else
{
- SceneManager* pSceneManager = SceneManager::GetInstance();
- IList* pArgs = new (std::nothrow) ArrayList();
-
+ __previousActionId = 1;
UpdateComment();
- pArgs->Add(new Integer(ID_REFRESH_LIST_FROM_DATABASE));
- pSceneManager->GoBackward(BackwardSceneTransition(IDSCN_MEMO_LIST), pArgs);
}
return;
}
{
if (IsCommentEdited() == false)
{
+ HandleSavePopUpCancelEvent();
return;
}
- int modalResult = ShowMessagePopUp(GetResourceString(L"IDS_COM_POP_ERRORMSG_SAVE_Q"), L"", MSGBOX_STYLE_YESNO, 0);
- if (modalResult == MSGBOX_RESULT_YES)
+ if (__pSavePopup == null)
{
- String newComment = __pCommentEditArea->GetText();
- newComment.Trim();
- if (newComment.IsEmpty() != true)
- {
- __pMemoData->SetMemoContents(newComment);
- }
- else
- {
- //If comment is null then save the filename as contents in memo data
- String fileName = File::GetFileName(__pMemoData->GetMemoDrawingPath());
- fileName.SetLength(fileName.GetLength() - FILE_EXTENSION_SIZE);
- __pMemoData->SetMemoContents(fileName);
- }
- DateTime modificationTime;
- SystemTime::GetCurrentTime(TIME_MODE_UTC, modificationTime);
- __pMemoData->SetMemoModificationTime(modificationTime);
- MemoDataPresentationModel::GetInstance()->UpdateMemoAt(__pMemoData->GetMemoIndex(), __pMemoData);
- __memoComment = newComment;
+ __pSavePopup = new (std::nothrow) Popup();
+ ConstructSavePopup(__pSavePopup, this);
}
+ __pSavePopup->SetShowState(true);
+ __pSavePopup->Show();
+
return;
}
{
return false;
}
+
+
+void
+MemoDrawingDetailForm::HandleSavePopUpCancelEvent(void)
+{
+ SceneManager* pSceneManager = SceneManager::GetInstance();
+ IList* pArgs = new (std::nothrow) ArrayList();
+
+ if(__previousActionId == IDA_FOOTER_BUTTON_CREATE)
+ {
+ pSceneManager->GoForward(ForwardSceneTransition(IDSCN_MEMO_DRAWING_EDITOR), null);
+ }
+ else if(__previousActionId == IDA_FOOTER_BUTTON_SHARE)
+ {
+ // Shows List of AppControls to share Memo.
+ if (__pPopup == null)
+ {
+ __pPopup = new (std::nothrow) Popup();
+ __pPopupList = new (std::nothrow) ListView();
+ __pPopupList->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);
+ AppControlListProvider* pAppControlListProvider = new (std::nothrow) AppControlListProvider();
+ ConstructAppControlPopup(__pPopup, __pPopupList, pAppControlListProvider, this, this);
+ }
+ __pPopup->SetShowState(true);
+ __pPopup->Show();
+ }
+ else if(__previousActionId == IDA_FOOTER_BUTTON_EDIT)
+ {
+ EditDrawingMemo();
+ }
+ else if(__previousActionId == 1)
+ {
+ pArgs->Add(new Integer(ID_REFRESH_LIST_FROM_DATABASE));
+ pSceneManager->GoBackward(BackwardSceneTransition(IDSCN_MEMO_LIST), pArgs);
+ }
+ return;
+}
*/
#include <FMedia.h>
-#include <FSystem.h>
#include "MmCommonUtils.h"
#include "MmDataPresentationModel.h"
#include "MmDrawingEditorForm.h"
void
MemoDrawingEditorForm::OnSceneActivatedN(const SceneId& previousSceneId, const SceneId& currentSceneId, IList* pArgs)
{
+ SettingInfo::AddSettingEventListener(*this);
+ String dateTimeFormatKey = L"http://tizen.org/setting/locale.date_time.format";
+ String dateTimeKey = L"http://tizen.org/setting/locale.date_time";
+
+ SettingInfo::GetValue(dateTimeKey, __dateTime);
+ SettingInfo::GetValue(dateTimeFormatKey, __dateTimeFormat);
+
if(previousSceneId == IDSCN_MEMO_ADD_EDIT_COMMENT)
{
if(pArgs != null)
__pEditMemo = null;
__isEditMode = false;
}
+ SettingInfo::RemoveSettingEventListener(*this);
return;
}
SceneManager::GetInstance()->GoBackward(BackwardSceneTransition(IDSCN_MEMO_LIST), pArgs);
}
}
+
+void
+MemoDrawingEditorForm::OnSettingChanged(Tizen::Base::String& key)
+{
+ String dateTimeFormatString;
+ String dateTimeFormatKey = L"http://tizen.org/setting/locale.date_time.format";
+
+ String dateTimeString;
+ String dateTimeKey = L"http://tizen.org/setting/locale.date_time";
+
+ if ( key.CompareTo(dateTimeFormatKey) == 0 )
+ {
+ SettingInfo::GetValue(dateTimeFormatKey, dateTimeFormatString);
+ if ( __dateTimeFormat.CompareTo(dateTimeFormatString) !=0)
+ {
+ __dateTimeFormat = dateTimeFormatString;
+ SetDateTime();
+ }
+ }
+ else if ( key.CompareTo(dateTimeKey) == 0 )
+ {
+ SettingInfo::GetValue(dateTimeKey, dateTimeString);
+ if ( __dateTime.CompareTo(dateTimeString) !=0)
+ {
+ __dateTime = dateTimeString;
+ SetDateTime();
+ }
+ }
+ return;
+}
+
__pThumbnailProvider->Stop();
__pThumbnailProvider->Join();
}
+ SettingInfo::RemoveSettingEventListener(*this);
return true;
}
*/
#include <FApp.h>
-#include <FSystem.h>
+
#include "MmCommonUtils.h"
#include "MmDataPresentationModel.h"
#include "MmInfo.h"
MemoTextEditorForm::OnInitializing(void)
{
result r = E_SUCCESS;
+
__pMemoContentEditarea = static_cast<EditArea*>(GetControl("IDC_MEMOCONTENT"));
__pMemoContentEditarea->AddActionEventListener(*this);
__pMemoContentEditarea->AddTextEventListener(*this);
void
MemoTextEditorForm::OnSceneActivatedN(const SceneId& previousSceneId, const SceneId& currentSceneId, IList* pArgs)
{
+ String dateTimeFormatKey = L"http://tizen.org/setting/locale.date_time.format";
+ String dateTimeKey = L"http://tizen.org/setting/locale.date_time";
+
+ SettingInfo::GetValue(dateTimeKey, __dateTime);
+ SettingInfo::GetValue(dateTimeFormatKey, __dateTimeFormat);
+
+ SettingInfo::AddSettingEventListener(*this);
RepositionControls(ID_DEFAULT_POSITION);
SetSaveEnable(false);
if (pArgs != null)
__pMemoContentEditarea->Clear();
RepositionControls(ID_DEFAULT_POSITION);
__pEditMemo = null;
+ SettingInfo::RemoveSettingEventListener(*this);
return;
}
__pColorPickerPanel->Invalidate(true);
__pSliderPanel->SetShowState(false);
__pSliderPanel->Invalidate(true);
- SystemTime::GetCurrentTime(TIME_MODE_UTC, __createTime);
- String createTimeString = GetMemoCreationDateTime(__createTime);
- __pMemoCreateTime->SetText(createTimeString);
- __pMemoCreateTime->Invalidate(true);
+ SetDateTime();
__pMemoContentEditarea->Clear();
__pMemoContentEditarea->ShowKeypad();
__isEditMode = true;
SetControlAlwaysAtBottom(*this, true);
- SystemTime::GetCurrentTime(TIME_MODE_UTC, __createTime);
- String createTimeString = GetMemoCreationDateTime(__createTime);
- __pMemoCreateTime->SetText(createTimeString);
+ SetDateTime();
__pMemoContentEditarea->Clear();
__pMemoContentEditarea->SetText(pMemoData->GetMemoContents());
}
return false;
}
+
+void
+MemoTextEditorForm::SetDateTime(void)
+{
+ SystemTime::GetCurrentTime(TIME_MODE_UTC, __createTime);
+ String createTimeString = GetMemoCreationDateTime(__createTime);
+ __pMemoCreateTime->SetText(createTimeString);
+ __pMemoCreateTime->Invalidate(true);
+ return;
+}
+
+void
+MemoTextEditorForm::OnSettingChanged(Tizen::Base::String& key)
+{
+ String dateTimeFormatString;
+ String dateTimeFormatKey = L"http://tizen.org/setting/locale.date_time.format";
+
+ String dateTimeString;
+ String dateTimeKey = L"http://tizen.org/setting/locale.date_time";
+
+ if ( key.CompareTo(dateTimeFormatKey) == 0 )
+ {
+ SettingInfo::GetValue(dateTimeFormatKey, dateTimeFormatString);
+ if ( __dateTimeFormat.CompareTo(dateTimeFormatString) !=0)
+ {
+ __dateTimeFormat = dateTimeFormatString;
+ SetDateTime();
+ }
+ }
+ else if ( key.CompareTo(dateTimeKey) == 0 )
+ {
+ SettingInfo::GetValue(dateTimeKey, dateTimeString);
+ if ( __dateTime.CompareTo(dateTimeString) !=0)
+ {
+ __dateTime = dateTimeString;
+ SetDateTime();
+ }
+ }
+ return;
+}