2 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
4 // Licensed under the Flora License, Version 1.1 (the License);
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
8 // http://floralicense.org/license/
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an AS IS BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
18 * @file CtGroupEditorForm.cpp
19 * @brief This is the implementation file for the GroupEditorForm class.
24 #include "CtContactsApp.h"
25 #include "CtGroupEditorForm.h"
26 #include "CtGroupPresentationModel.h"
27 #include "CtResourceManager.h"
28 #include "CtSceneRegister.h"
30 #include "CtCommonUtil.h"
32 using namespace Tizen::App;
33 using namespace Tizen::Base;
34 using namespace Tizen::Base::Collection;
35 using namespace Tizen::Graphics;
36 using namespace Tizen::Io;
37 using namespace Tizen::Media;
38 using namespace Tizen::Ui;
39 using namespace Tizen::Ui::Controls;
40 using namespace Tizen::Ui::Scenes;
41 using namespace Tizen::Social;
42 using namespace Tizen::System;
44 static const int IDA_HEADER_SAVE = 0;
45 static const int IDA_BUTTON_GALLERY = 10;
46 static const int IDA_BUTTON_TAKE_PHOTO = 11;
47 static const int IDA_BUTTON_REMOVE = 12;
48 static const int IDA_BUTTON_RINGTONE_CLEAR = 13;
49 static const int IDA_POPUP_DISCARD_CHANGES_OK = 20;
50 static const int IDA_POPUP_DISCARD_CHANGES_CANCEL = 21;
52 static const wchar_t* IDB_ICON_ADD_NORMAL = L"C02_caller_id_icon_add.png";
53 static const wchar_t* IDB_ICON_ADD_PRESSED = L"C02_caller_id_icon_add_press.png";
54 static const wchar_t* IDB_ICON_CAMERA_NORMAL = L"C02_caller_id_icon_camera.png";
55 static const wchar_t* IDB_ICON_CAMERA_PRESSED = L"C02_caller_id_icon_camera_press.png";
56 static const wchar_t* IDB_ICON_REMOVE_NORMAL = L"00_button_expand_minus_press.png";
57 static const wchar_t* IDB_ICON_REMOVE_PRESSED = L"00_button_expand_minus_press.png";
58 static const wchar_t* IDB_REMOVE_BG_NORMAL = L"00_circle_button_delete.png";
59 static const wchar_t* IDB_REMOVE_BG_PRESSED = L"00_circle_button_delete_press.png";
60 static const wchar_t* IDB_DETAILS_RESET_NORMAL = L"00_button_refresh.png";
61 static const wchar_t* IDB_DETAILS_RESET_PRESSED = L"00_button_refresh_press.png";
63 static const int H_ITEM = 128;
64 static const int H_THUMBNAIL = 360;
65 static const int Y_THUMBNAIL = 49;
66 static const int H_ICON_BUTTON = 74;
67 static const int Y_REMOVE_BUTTON = 26;
68 static const int X_REMOVE_BUTTON_MARGIN = 40;
69 static const int X_REFRESH_BUTTON_MARGIN = 88;
71 static const int X_RINGTONE_TEXT = 3;
72 static const int Y_RINGTONE_TITLE = 10;
73 static const int Y_RINGTONE_NAME = 68;
74 static const int W_RINGTONE_TEXT = 600;
75 static const int H_RINGTONE_TITLE = 58;
76 static const int H_RINGTONE_NAME = 60;
78 static const int X_GROUP_TEXT_GAP = 5;
79 static const int H_GROUP_TEXT_GAP = 10;
81 static const unsigned int COLOR_GUIDE_TEXT = Color32<255, 0, 0>::Value;
82 static const unsigned int COLOR_RINGTONE_TITLE = Color32<128, 128, 128>::Value;
83 static const unsigned int COLOR_THUMBNAIL = Color32<239, 237, 229>::Value;
84 static const unsigned int COLOR_TABLE_BG = Color32<248, 246, 239>::Value;
85 static const unsigned int COLOR_ITEM_TITLE = Color32<128, 128, 128>::Value;
86 static const unsigned int COLOR_ITEM_VALUE = Color32<0, 0, 0>::Value;
87 static const unsigned int COLOR_ITEM_PRESSED = Color32<248, 246, 239>::Value;
88 static const unsigned int COLOR_PRESSED = Color32<87, 135, 194>::Value;
90 static const int ITEM_COUNT = 3;
92 static const int FONT_SIZE_RINGTONE_TITLE = 32;
94 static const wchar_t* INPUT_DATA_SELECTION_MODE_SINGLE = L"single";
95 static const wchar_t* INPUT_KEY_SELECTION_MODE = L"http://tizen.org/appcontrol/data/selection_mode";
96 static const wchar_t* INPUT_KEY_IMAGEVIEWER_MODE = L"http://tizen.org/appcontrol/data/image/crop_mode";
97 static const wchar_t* INPUT_KEY_ALLOW_SWITCH = L"http://tizen.org/appcontrol/data/camera/allow_switch";
98 static const wchar_t* INPUT_MIME_TYPE_CAMERA = L"image/jpg";
99 static const wchar_t* INPUT_MIME_TYPE_GALLERY = L"image/*";
100 static const wchar_t* INPUT_MIME_TYPE_AUDIO = L"audio/*";
101 static const wchar_t* INPUT_VALUE_FALSE = L"false";
102 static const wchar_t* INPUT_VALUE_IMAGEVIEWER_TYPE = L"fit_to_screen";
103 static const wchar_t* OUTPUT_KEY_SELECTED = L"http://tizen.org/appcontrol/data/selected";
104 static const wchar_t* THUMBNAIL_LABEL = L"thumbnail";
105 static const wchar_t* THUMBNAIL_EMPTY_LABEL = L"emptyThumbnail";
106 static const wchar_t* ADD_BUTTON = L"add";
107 static const wchar_t* CAMERA_BUTTON = L"camera";
108 static const wchar_t* REMOVE_BUTTON = L"remove";
109 static const wchar_t* SD_CARD_UNMOUNTED = L"Unmounted";
111 static const wchar_t* GROUP_EDITOR_LABEL_TITLE = L"GroupLabelTitle";
112 static const wchar_t* GROUP_EDITOR_LABEL_VALUE = L"GroupLabelValue";
113 static const wchar_t* GROUP_EDITOR_STYLE_PANEL = L"GroupStylePanel";
115 GroupEditorForm::GroupEditorForm(void)
116 : __pPresentationModel(null)
118 , __pFileEventManager(null)
119 , __isEditMode(false)
121 , __isGroupsChanged(false)
122 , __pDiscardChangesPopup(null)
126 GroupEditorForm::~GroupEditorForm(void)
131 GroupEditorForm::Initialize(void)
133 Construct(L"IDL_GROUP_EDITOR_FORM");
137 GroupEditorForm::OnInitializing(void)
139 Footer* pFooter = GetFooter();
140 pFooter->AddActionEventListener(*this);
141 SetFormBackEventListener(this);
142 DeviceManager::AddDeviceEventListener(DEVICE_TYPE_STORAGE_CARD, *this);
144 __pTableView = new (std::nothrow) TableView();
145 __pTableView->Construct(Rectangle(0, 0, GetClientAreaBounds().width, GetClientAreaBounds().height), true, TABLE_VIEW_SCROLL_BAR_STYLE_FADE_OUT);
146 __pTableView->SetItemProvider(this);
147 __pTableView->AddTableViewItemEventListener(*this);
148 AddControl(__pTableView);
154 GroupEditorForm::OnTerminating(void)
156 __pTableView->SetItemProvider(null);
158 delete __pPresentationModel;
159 delete __pFileEventManager;
161 if (__pDiscardChangesPopup != null)
163 delete __pDiscardChangesPopup;
166 DeviceManager::RemoveDeviceEventListener(DEVICE_TYPE_STORAGE_CARD, *this);
172 GroupEditorForm::OnFormBackRequested(Tizen::Ui::Controls::Form& source)
174 SceneManager* pSceneManager = SceneManager::GetInstance();
178 Footer* pFooter = GetFooter();
179 FooterItemStatus status;
180 pFooter->GetItemStatus(0, status);
182 if (status != FOOTER_ITEM_STATUS_DISABLED && __isGroupsChanged == true)
184 ShowDiscardChangesPopup();
188 result r = pSceneManager->GoBackward(BackwardSceneTransition(SCENE_TRANSITION_ANIMATION_TYPE_RIGHT));
189 TryReturnVoid(r == E_SUCCESS, "[%s] Unable to go backward", GetErrorMessage(r));
193 GroupEditorForm::ShowDiscardChangesPopup(void)
195 if (__pDiscardChangesPopup == null)
197 __pDiscardChangesPopup = new (std::nothrow) Popup();
198 __pDiscardChangesPopup->Construct(false, Dimension(W_SAVE_POPUP, H_SAVE_POPUP));
199 __pDiscardChangesPopup->SetPropagatedKeyEventListener(this);
201 Rectangle popupClientBounds = __pDiscardChangesPopup->GetClientAreaBounds();
203 Label* pLabel = new (std::nothrow) Label();
204 pLabel->Construct(Rectangle(X_SAVE_LABEL, Y_SAVE_LABEL, W_SAVE_LABEL, H_SAVE_LABEL), ResourceManager::GetString(L"IDS_PB_POP_DISCARD_CHANGES_Q"));
205 pLabel->SetTextConfig(FONT_SIZE_SAVE_CONFIRM, LABEL_TEXT_STYLE_NORMAL);
206 pLabel->SetTextVerticalAlignment(ALIGNMENT_MIDDLE);
207 pLabel->SetTextHorizontalAlignment(ALIGNMENT_LEFT);
209 Button* pSaveButton = new (std::nothrow) Button();
210 pSaveButton->Construct(Rectangle(X_SAVE_LABEL + W_SAVE_BUTTON + W_POPUP_ITEM_GAP, Y_SAVE_BUTTON, W_SAVE_BUTTON, H_SAVE_BUTTON), ResourceManager::GetString(L"IDS_COM_SK_OK"));
211 pSaveButton->SetTextSize(FONT_SIZE_SAVE_BUTTON);
212 pSaveButton->SetActionId(IDA_POPUP_DISCARD_CHANGES_OK);
213 pSaveButton->AddActionEventListener(*this);
215 Button* pCancelButton = new (std::nothrow) Button();
216 pCancelButton->Construct(Rectangle(X_SAVE_LABEL, Y_SAVE_BUTTON, W_SAVE_BUTTON, H_SAVE_BUTTON), ResourceManager::GetString(L"IDS_PB_SK_CANCEL"));
217 pCancelButton->SetTextSize(FONT_SIZE_SAVE_BUTTON);
218 pCancelButton->SetActionId(IDA_POPUP_DISCARD_CHANGES_CANCEL);
219 pCancelButton->AddActionEventListener(*this);
221 __pDiscardChangesPopup->AddControl(pLabel);
222 __pDiscardChangesPopup->AddControl(pSaveButton);
223 __pDiscardChangesPopup->AddControl(pCancelButton);
226 __pDiscardChangesPopup->SetShowState(true);
227 __pDiscardChangesPopup->Show();
231 GroupEditorForm::HideDiscardChangesPopup(void)
233 __pDiscardChangesPopup->SetShowState(false);
238 GroupEditorForm::OnFileEventOccured(const unsigned long events, const Tizen::Base::String &path, const unsigned int eventId)
240 String thumbnailPath = __pPresentationModel->GetThumbnailPath();
241 if (thumbnailPath.Equals(path, false) == true)
243 __pPresentationModel->SetThumbnailPath(String());
244 __pTableView->RefreshItem(0, TABLE_VIEW_REFRESH_TYPE_ITEM_MODIFY);
245 __pTableView->RefreshItem(1, TABLE_VIEW_REFRESH_TYPE_ITEM_MODIFY);
249 String ringtonePath = __pPresentationModel->GetRingtone();
250 if (ringtonePath.Equals(path, false) == true )
252 __pPresentationModel->SetRingtone(String());
253 __pTableView->RefreshItem(2, TABLE_VIEW_REFRESH_TYPE_ITEM_MODIFY);
259 GroupEditorForm::OnDeviceStateChanged(Tizen::System::DeviceType deviceType, const Tizen::Base::String &state)
261 if (deviceType != DEVICE_TYPE_STORAGE_CARD || __pPresentationModel->GetThumbnailPath().IsEmpty())
266 if (state.Equals(SD_CARD_UNMOUNTED, false) && File::IsFileExist(__pPresentationModel->GetThumbnailPath()) == false)
268 __pPresentationModel->SetThumbnailPath(L"");
269 __pTableView->RefreshItem(0, TABLE_VIEW_REFRESH_TYPE_ITEM_MODIFY);
275 GroupEditorForm::OnActionPerformed(const Tizen::Ui::Control& source, int actionId)
279 case IDA_HEADER_SAVE:
281 result r = E_SUCCESS;
283 if (CommonUtil::isMemoryAvailable() == false)
285 CommonUtil::showMemoryFullMessageBox();
289 __pTableView->RefreshItem(1, TABLE_VIEW_REFRESH_TYPE_ITEM_MODIFY);
291 if (__pPresentationModel->IsDefaultCategory() == false && __pPresentationModel->IsDuplicatedCategory() == true)
293 Footer* pFooter = GetFooter();
294 pFooter->SetItemEnabled(0, false);
300 r = __pPresentationModel->UpdateCategory();
304 OnCategoriesChanged();
306 TryReturnVoid(r == E_SUCCESS, "[%s] Unable to update category", GetErrorMessage(r));
310 r = __pPresentationModel->AddCategory();
311 TryReturnVoid(r == E_SUCCESS, "[%s] Unable to add category", GetErrorMessage(r));
318 case IDA_BUTTON_GALLERY:
320 LaunchAppControl(PROVIDER_ID_GALLERY, OPERATION_ID_PICK);
323 case IDA_BUTTON_TAKE_PHOTO:
325 LaunchAppControl(PROVIDER_ID_CAMERA, OPERATION_ID_CREATE_CONTENT);
328 case IDA_BUTTON_REMOVE:
330 __pPresentationModel->SetThumbnailPath(String());
331 __pTableView->RefreshItem(0, TABLE_VIEW_REFRESH_TYPE_ITEM_MODIFY);
332 __pTableView->RefreshItem(1, TABLE_VIEW_REFRESH_TYPE_ITEM_MODIFY);
334 if (__pFileEventManager != null)
336 delete __pFileEventManager;
337 __pFileEventManager = null;
341 case IDA_BUTTON_RINGTONE_CLEAR:
343 __pPresentationModel->SetRingtone(String());
344 __pTableView->RefreshItem(2, TABLE_VIEW_REFRESH_TYPE_ITEM_MODIFY);
347 case IDA_POPUP_DISCARD_CHANGES_OK:
349 HideDiscardChangesPopup();
352 SceneManager* pSceneManager = SceneManager::GetInstance();
353 result r = pSceneManager->GoBackward(BackwardSceneTransition(SCENE_TRANSITION_ANIMATION_TYPE_RIGHT));
354 TryReturnVoid(r == E_SUCCESS, "[%s] Unable to go backward", GetErrorMessage(r));
357 case IDA_POPUP_DISCARD_CHANGES_CANCEL:
359 HideDiscardChangesPopup();
368 GroupEditorForm::OnSceneActivatedN(const Tizen::Ui::Scenes::SceneId& previousSceneId,
369 const Tizen::Ui::Scenes::SceneId& currentSceneId, Tizen::Base::Collection::IList* pArgs)
371 ContactsApp* pContactsApp = static_cast<ContactsApp*>(ContactsApp::GetInstance());
372 pContactsApp->AddContactsAppChangeEventListener(*this);
374 RecordId categoryId = INVALID_RECORD_ID;
378 IEnumerator* pEnum = pArgs->GetEnumeratorN();
379 if (pEnum->MoveNext() == E_SUCCESS)
381 Integer* pCategoryId = static_cast<Integer*>(pEnum->GetCurrent());
382 if (pCategoryId != null)
384 categoryId = pCategoryId->ToInt();
390 pArgs->RemoveAll(true);
394 __pPresentationModel = new (std::nothrow) GroupPresentationModel();
395 __pPresentationModel->Construct(categoryId);
396 __pPresentationModel->AddContactChangeListener(*this);
398 Header* pHeader = GetHeader();
401 pHeader->SetTitleText(ResourceManager::GetString(L"IDS_PB_OPT2_EDIT_GROUPS"));
405 pHeader->SetTitleText(ResourceManager::GetString(L"IDS_COM_BODY_CREATE"));
408 Footer* pFooter = GetFooter();
411 pFooter->SetItemEnabled(0, true);
415 pFooter->SetItemEnabled(0, false);
421 GroupEditorForm::OnSceneDeactivated(const Tizen::Ui::Scenes::SceneId& currentSceneId,
422 const Tizen::Ui::Scenes::SceneId& nextSceneId)
424 ContactsApp* pContactsApp = static_cast<ContactsApp*>(ContactsApp::GetInstance());
425 pContactsApp->RemoveContactsAppChangeEventListener(*this);
427 __pPresentationModel->RemoveContactChangeListener(*this);
431 GroupEditorForm::GetItemCount(void)
436 Tizen::Ui::Controls::TableViewItem*
437 GroupEditorForm::CreateItem(int itemIndex, int itemWidth)
439 ContactsApp *pContactsApp = static_cast<ContactsApp*>(ContactsApp::GetInstance());
441 Label* pSubjectLabel = null;
442 Label* pContentLabel = null;
443 int itemHeight = H_ITEM + pContactsApp->GetFontHeightOffset();
447 itemHeight = Y_THUMBNAIL * 2 + H_THUMBNAIL;
450 TableViewItem* pItem = new (std::nothrow) TableViewItem();
451 pItem->Construct(Dimension(itemWidth, itemHeight), TABLE_VIEW_ANNEX_STYLE_NORMAL);
455 Label* pThumbnailLabel = new (std::nothrow) Label();
456 pThumbnailLabel->Construct(Rectangle((itemWidth - H_THUMBNAIL) / 2, Y_THUMBNAIL, H_THUMBNAIL, H_THUMBNAIL), L"");
457 pThumbnailLabel->SetName(THUMBNAIL_LABEL);
458 pItem->AddControl(pThumbnailLabel);
459 Label* pEmptyThumbnailLabel = new (std::nothrow) Label();
460 pEmptyThumbnailLabel->Construct(Rectangle((itemWidth - H_THUMBNAIL) / 2, Y_THUMBNAIL, H_THUMBNAIL, H_THUMBNAIL), L"");
461 pEmptyThumbnailLabel->SetName(THUMBNAIL_EMPTY_LABEL);
462 pEmptyThumbnailLabel->SetBackgroundColor(COLOR_THUMBNAIL);
463 pItem->AddControl(pEmptyThumbnailLabel);
465 if (__pPresentationModel->GetThumbnailPath().IsEmpty() == false)
467 Bitmap* pThumbnail = null;
468 ImageBuffer thumbnailImageBuffer;
469 result r = thumbnailImageBuffer.Construct(__pPresentationModel->GetThumbnailPath());
472 pThumbnail = thumbnailImageBuffer.GetBitmapN(BITMAP_PIXEL_FORMAT_RGB565, BUFFER_SCALING_NONE);
474 pThumbnailLabel->SetBackgroundBitmap(*pThumbnail);
477 pEmptyThumbnailLabel->SetShowState(false);
480 Button* pButtonAdd = new (std::nothrow) Button();
481 pButtonAdd->Construct(Rectangle((itemWidth - H_ICON_BUTTON) / 2, (H_THUMBNAIL - H_ICON_BUTTON) / 2 + Y_THUMBNAIL, H_ICON_BUTTON, H_ICON_BUTTON), L"");
482 pButtonAdd->SetActionId(IDA_BUTTON_GALLERY);
483 pButtonAdd->AddActionEventListener(*this);
484 pButtonAdd->SetName(ADD_BUTTON);
485 Bitmap* pIconNormal = ResourceManager::GetBitmapN(IDB_ICON_ADD_NORMAL);
486 Bitmap* pIconPressed = ResourceManager::GetBitmapN(IDB_ICON_ADD_PRESSED);
487 if (pIconNormal != null)
489 pButtonAdd->SetNormalBackgroundBitmap(*pIconNormal);
492 if (pIconPressed != null)
494 pButtonAdd->SetPressedBackgroundBitmap(*pIconPressed);
497 pItem->AddControl(pButtonAdd);
498 pItem->SetIndividualSelectionEnabled(pButtonAdd, true);
500 Button* pButtonCamera = new (std::nothrow) Button();
501 pButtonCamera->Construct(Rectangle((itemWidth - H_THUMBNAIL) / 2 + H_THUMBNAIL, Y_THUMBNAIL + H_THUMBNAIL - H_ICON_BUTTON, H_ICON_BUTTON, H_ICON_BUTTON), L"");
502 pButtonCamera->SetActionId(IDA_BUTTON_TAKE_PHOTO);
503 pButtonCamera->AddActionEventListener(*this);
504 pButtonCamera->SetName(CAMERA_BUTTON);
505 pIconNormal = ResourceManager::GetBitmapN(IDB_ICON_CAMERA_NORMAL);
506 pIconPressed = ResourceManager::GetBitmapN(IDB_ICON_CAMERA_PRESSED);
507 if (pIconNormal != null)
509 pButtonCamera->SetNormalBackgroundBitmap(*pIconNormal);
512 if (pIconPressed != null)
514 pButtonCamera->SetPressedBackgroundBitmap(*pIconPressed);
517 pItem->AddControl(pButtonCamera);
518 pItem->SetIndividualSelectionEnabled(pButtonCamera, true);
520 Button* pButtonRemove = new (std::nothrow) Button();
521 pButtonRemove->Construct(Rectangle((itemWidth - H_THUMBNAIL) / 2 - X_REMOVE_BUTTON_MARGIN, Y_REMOVE_BUTTON, H_ICON_BUTTON, H_ICON_BUTTON), L"");
522 pButtonRemove->SetActionId(IDA_BUTTON_REMOVE);
523 pButtonRemove->AddActionEventListener(*this);
524 pButtonRemove->SetName(REMOVE_BUTTON);
525 pIconNormal = ResourceManager::GetBitmapN(IDB_ICON_REMOVE_NORMAL);
526 pIconPressed = ResourceManager::GetBitmapN(IDB_ICON_REMOVE_PRESSED);
527 if (pIconNormal != null)
529 pButtonRemove->SetNormalBitmap(Point(0, 0), *pIconNormal);
532 if (pIconPressed != null)
534 pButtonRemove->SetPressedBitmap(Point(0, 0), *pIconPressed);
538 pIconNormal = ResourceManager::GetBitmapN(IDB_REMOVE_BG_NORMAL);
539 pIconPressed = ResourceManager::GetBitmapN(IDB_REMOVE_BG_PRESSED);
540 if (pIconNormal != null)
542 pButtonRemove->SetNormalBackgroundBitmap(*pIconNormal);
545 if (pIconPressed != null)
547 pButtonRemove->SetPressedBackgroundBitmap(*pIconPressed);
550 pItem->AddControl(pButtonRemove);
551 pItem->SetIndividualSelectionEnabled(pButtonRemove, true);
553 if (__pPresentationModel->GetThumbnailPath().IsEmpty() == true)
555 pButtonRemove->SetShowState(false);
559 pButtonAdd->SetShowState(false);
561 pItem->SetBackgroundColor(COLOR_TABLE_BG, TABLE_VIEW_ITEM_DRAWING_STATUS_NORMAL);
562 pItem->SetBackgroundColor(COLOR_TABLE_BG, TABLE_VIEW_ITEM_DRAWING_STATUS_PRESSED);
564 else if (itemIndex == 1)
566 EditField* pEditField = new (std::nothrow) EditField();
567 pEditField->Construct(Rectangle(X_GROUP_TEXT_GAP, X_GROUP_TEXT_GAP, itemWidth - H_GROUP_TEXT_GAP, H_ITEM + pContactsApp->GetFontHeightOffset() - H_GROUP_TEXT_GAP), EDIT_FIELD_STYLE_NORMAL, INPUT_STYLE_OVERLAY, EDIT_FIELD_TITLE_STYLE_TOP, !__pPresentationModel->IsDefaultCategory());
568 pEditField->AddTextEventListener(*this);
569 pEditField->AddKeypadEventListener(*this);
570 pEditField->SetText(__pPresentationModel->GetCategoryName());
571 pEditField->SetTitleText(ResourceManager::GetString(L"IDS_PB_BODY_GROUP_NAME_ABB"));
572 pEditField->SetTextSize(pContactsApp->GetFontSize());
573 pEditField->SetEnabled(!__pPresentationModel->IsDefaultCategory());
575 if (__isEditMode == true)
577 String categoryName = __pPresentationModel->GetCategoryName();
578 pEditField->SetText(categoryName);
581 pItem->SetBackgroundColor(COLOR_THUMBNAIL, TABLE_VIEW_ITEM_DRAWING_STATUS_NORMAL);
582 pItem->SetBackgroundColor(COLOR_THUMBNAIL, TABLE_VIEW_ITEM_DRAWING_STATUS_PRESSED);
584 pItem->AddControl(pEditField);
585 pItem->SetIndividualSelectionEnabled(pEditField, true);
587 else if (itemIndex == 2)
589 Panel* pGroupStyle = new (std::nothrow) Panel();
590 pGroupStyle->Construct(Rectangle(0, 0, itemWidth , itemHeight), GROUP_STYLE_NONE);
591 pGroupStyle->SetName(GROUP_EDITOR_STYLE_PANEL);
592 pGroupStyle->SetBackgroundColor(COLOR_THUMBNAIL);
593 pGroupStyle->AddTouchEventListener(*this);
594 pItem->AddKeyEventListener(*this);
595 pItem->AddControl(pGroupStyle);
597 pSubjectLabel = new (std::nothrow) Label();
598 pSubjectLabel->Construct(Rectangle(X_RINGTONE_TEXT, Y_RINGTONE_TITLE, W_RINGTONE_TEXT, H_RINGTONE_TITLE),
599 ResourceManager::GetString(L"IDS_PB_BODY_RINGTONE"));
600 pSubjectLabel->SetTextHorizontalAlignment(ALIGNMENT_LEFT);
601 pSubjectLabel->SetTextVerticalAlignment(ALIGNMENT_MIDDLE);
602 pSubjectLabel->SetTextColor(Color(COLOR_RINGTONE_TITLE));
603 pSubjectLabel->SetTextConfig(FONT_SIZE_RINGTONE_TITLE, LABEL_TEXT_STYLE_BOLD);
604 pSubjectLabel->SetName(GROUP_EDITOR_LABEL_TITLE);
605 pSubjectLabel->AddTouchEventListener(*this);
606 pGroupStyle->AddControl(pSubjectLabel);
609 String ringtonePath = __pPresentationModel->GetRingtone();
612 if (ringtonePath.IsEmpty() == true)
614 trimmedPath = ResourceManager::GetString(L"IDS_PB_BODY_DEFAULT");
618 ringtonePath.LastIndexOf(L"/", ringtonePath.GetLength() - 1, index);
621 ringtonePath.SubString(index + 1, trimmedPath);
625 pContentLabel = new (std::nothrow) Label();
626 pContentLabel->Construct(Rectangle(X_RINGTONE_TEXT, Y_RINGTONE_NAME, W_RINGTONE_TEXT, H_RINGTONE_NAME + pContactsApp->GetFontHeightOffset()), trimmedPath);
627 pContentLabel->SetTextHorizontalAlignment(ALIGNMENT_LEFT);
628 pContentLabel->SetTextVerticalAlignment(ALIGNMENT_MIDDLE);
629 pContentLabel->SetTextConfig(pContactsApp->GetFontSize(), LABEL_TEXT_STYLE_NORMAL);
630 pContentLabel->SetName(GROUP_EDITOR_LABEL_VALUE);
631 pContentLabel->AddTouchEventListener(*this);
632 pGroupStyle->AddControl(pContentLabel);
634 Button* pClearButton = new (std::nothrow) Button();
635 pClearButton->Construct(Rectangle(itemWidth - X_REFRESH_BUTTON_MARGIN, (pItem->GetHeight() - H_ICON_BUTTON) / 2, H_ICON_BUTTON, H_ICON_BUTTON));
636 pClearButton->SetActionId(IDA_BUTTON_RINGTONE_CLEAR);
637 pClearButton->AddActionEventListener(*this);
639 Bitmap* pReset = ResourceManager::GetBitmapN(IDB_DETAILS_RESET_NORMAL);
642 pClearButton->SetNormalBitmap(Point(0, 0), *pReset);
645 pReset = ResourceManager::GetBitmapN(IDB_DETAILS_RESET_PRESSED);
648 pClearButton->SetPressedBitmap(Point(0, 0), *pReset);
652 pItem->AddControl(pClearButton);
653 pItem->SetIndividualSelectionEnabled(pClearButton, true);
655 pItem->SetBackgroundColor(COLOR_THUMBNAIL, TABLE_VIEW_ITEM_DRAWING_STATUS_NORMAL);
662 GroupEditorForm::DeleteItem(int itemIndex, Tizen::Ui::Controls::TableViewItem* pItem)
669 GroupEditorForm::UpdateItem(int itemIndex, Tizen::Ui::Controls::TableViewItem* pItem)
678 Button* pRemoveButton = static_cast<Button*>(pItem->GetControl(REMOVE_BUTTON, false));
679 Button* pAddButton = static_cast<Button*>(pItem->GetControl(ADD_BUTTON, false));
680 Label* pThumbnailLabel = static_cast<Label*>(pItem->GetControl(THUMBNAIL_LABEL, false));
681 Label* pThumbnailEmptyLabel = static_cast<Label*>(pItem->GetControl(THUMBNAIL_EMPTY_LABEL, false));
682 if (pRemoveButton == null || pAddButton == null ||
683 pThumbnailLabel == null || pThumbnailEmptyLabel == null)
688 if (__pPresentationModel->GetThumbnailPath().IsEmpty() == true)
690 pRemoveButton->SetShowState(false);
691 pThumbnailLabel->SetShowState(false);
692 pThumbnailEmptyLabel->SetShowState(true);
693 pAddButton->SetShowState(true);
697 pAddButton->SetShowState(false);
698 pThumbnailEmptyLabel->SetShowState(false);
699 pThumbnailLabel->SetShowState(true);
700 pRemoveButton->SetShowState(true);
702 Bitmap* pThumbnail = null;
703 ImageBuffer thumbnailImageBuffer;
704 result r = thumbnailImageBuffer.Construct(__pPresentationModel->GetThumbnailPath());
707 pThumbnail = thumbnailImageBuffer.GetBitmapN(BITMAP_PIXEL_FORMAT_ARGB8888, BUFFER_SCALING_NONE);
709 pThumbnailLabel->SetBackgroundBitmap(*pThumbnail);
712 pThumbnailLabel->Invalidate(false);
715 else if (itemIndex == 1)
717 EditField* pEditField = static_cast<EditField*>(pItem->GetControl(0));
718 if (pEditField == null)
723 String groupName = pEditField->GetText();
726 if (groupName.GetLength() > 0)
728 Footer* pFooter = GetFooter();
729 pFooter->SetItemEnabled(0, true);
730 pFooter->Invalidate(true);
733 if (__pPresentationModel->IsDefaultCategory() == false && __pPresentationModel->IsDuplicatedCategory() == true)
735 pEditField->SetEnabled(true);
737 pEditField->SetGuideTextColor(Color(COLOR_GUIDE_TEXT));
738 pEditField->SetGuideText(ResourceManager::GetString(L"IDS_PB_POP_GROUP_ALREADY_IN_USE"));
739 pEditField->SetFocus();
740 pEditField->Invalidate(false);
743 else if (itemIndex == 2)
746 String ringtonePath = __pPresentationModel->GetRingtone();
749 if (ringtonePath.IsEmpty() == true)
751 trimmedPath = ResourceManager::GetString(L"IDS_PB_BODY_DEFAULT");
755 ringtonePath.LastIndexOf(L"/", ringtonePath.GetLength() - 1, index);
758 ringtonePath.SubString(index + 1, trimmedPath);
762 Panel* pPanel = static_cast<Panel*>(pItem->GetControl(0));
769 Label* pRingtoneName = static_cast<Label*>(pPanel->GetControl(1));
771 if (pRingtoneName == null)
776 if (pRingtoneName != null)
778 pRingtoneName->SetText(trimmedPath);
779 pRingtoneName->Invalidate(true);
785 GroupEditorForm::GetDefaultItemHeight(void)
791 GroupEditorForm::OnTableViewItemStateChanged(Tizen::Ui::Controls::TableView& tableView, int itemIndex, Tizen::Ui::Controls::TableViewItem* pItem, Tizen::Ui::Controls::TableViewItemStatus status)
793 if (status == TABLE_VIEW_ITEM_STATUS_SELECTED && itemIndex == 2)
795 LaunchAppControl(PROVIDER_ID_FILEMANAGER, OPERATION_ID_PICK);
800 GroupEditorForm::OnTableViewContextItemActivationStateChanged(Tizen::Ui::Controls::TableView& tableView, int itemIndex, Tizen::Ui::Controls::TableViewContextItem* pContextItem, bool activated)
805 GroupEditorForm::OnTableViewItemReordered(Tizen::Ui::Controls::TableView& tableView, int itemIndexFrom, int itemIndexTo)
810 GroupEditorForm::OnTextValueChanged(const Tizen::Ui::Control& source)
812 EditField* pEditField = const_cast<EditField *>(static_cast<const EditField *>(&source));
813 if (pEditField == null)
818 String existingCategoryName = __pPresentationModel->GetCategoryName();
819 String name = pEditField->GetText();
823 pEditField->SetGuideText(String(CHARACTER_SPACE));
824 pEditField->Invalidate(false);
826 Footer* pFooter = GetFooter();
827 pFooter->SetItemEnabled(0, false);
828 pFooter->Invalidate(true);
832 __pPresentationModel->SetCategoryName(name);
834 bool isSaveEnabled = false;
836 __isGroupsChanged = false;
838 for (int index = 0; index < name.GetLength(); index++)
840 name.GetCharAt(index, ch);
844 isSaveEnabled = true;
845 __isGroupsChanged = true;
850 Footer* pFooter = GetFooter();
852 pFooter->SetItemEnabled(0, isSaveEnabled);
853 pFooter->Invalidate(true);
857 GroupEditorForm::OnTextValueChangeCanceled(const Tizen::Ui::Control& source)
862 GroupEditorForm::OnTouchPressed(const Tizen::Ui::Control& source, const Tizen::Graphics::Point& currentPosition, const Tizen::Ui::TouchEventInfo& touchInfo)
864 Panel* pPanel = null;
866 if (source.GetName().Equals(GROUP_EDITOR_STYLE_PANEL, true))
868 pPanel = static_cast<Panel*>(&(const_cast<Control&>(source)));
870 else if (source.GetName().Equals(GROUP_EDITOR_LABEL_TITLE, true) || source.GetName().Equals(GROUP_EDITOR_LABEL_VALUE, true))
872 pPanel = static_cast<Panel*>(source.GetParent());
877 pPanel->SetBackgroundColor(COLOR_PRESSED);
879 Label* pLabelValue = static_cast<Label*>(pPanel->GetControl(GROUP_EDITOR_LABEL_VALUE, true));
880 pLabelValue->SetTextColor(Color(COLOR_ITEM_PRESSED));
882 Label* pLabelTitle = static_cast<Label*>(pPanel->GetControl(GROUP_EDITOR_LABEL_TITLE, true));
883 pLabelTitle->SetTextColor(COLOR_ITEM_PRESSED);
885 pPanel->Invalidate(true);
890 GroupEditorForm::OnTouchReleased(const Tizen::Ui::Control& source, const Tizen::Graphics::Point& currentPosition, const Tizen::Ui::TouchEventInfo& touchInfo)
892 Panel* pPanel = null;
894 if (source.GetName().Equals(GROUP_EDITOR_STYLE_PANEL, true))
896 pPanel = static_cast<Panel*>(&(const_cast<Control&>(source)));
898 else if (source.GetName().Equals(GROUP_EDITOR_LABEL_TITLE, true) || source.GetName().Equals(GROUP_EDITOR_LABEL_VALUE, true))
900 pPanel = static_cast<Panel*>(source.GetParent());
905 pPanel->SetBackgroundColor(COLOR_THUMBNAIL);
907 Label* pLabelValue = static_cast<Label*>(pPanel->GetControl(GROUP_EDITOR_LABEL_VALUE, true));
908 pLabelValue->SetTextColor(Color(COLOR_ITEM_VALUE));
910 Label* pLabelTitle = static_cast<Label*>(pPanel->GetControl(GROUP_EDITOR_LABEL_TITLE, true));
911 pLabelTitle->SetTextColor(COLOR_ITEM_TITLE);
913 pPanel->Invalidate(true);
919 GroupEditorForm::OnTouchMoved(const Tizen::Ui::Control& source, const Tizen::Graphics::Point& currentPosition, const Tizen::Ui::TouchEventInfo& touchInfo)
921 Panel* pPanel = null;
923 if (source.GetName().Equals(GROUP_EDITOR_STYLE_PANEL, true))
925 pPanel = static_cast<Panel*>(&(const_cast<Control&>(source)));
927 else if (source.GetName().Equals(GROUP_EDITOR_LABEL_TITLE, true) || source.GetName().Equals(GROUP_EDITOR_LABEL_VALUE, true))
929 pPanel = static_cast<Panel*>(source.GetParent());
934 pPanel->SetBackgroundColor(COLOR_THUMBNAIL);
936 Label* pLabelValue = static_cast<Label*>(pPanel->GetControl(GROUP_EDITOR_LABEL_VALUE, true));
937 pLabelValue->SetTextColor(Color(COLOR_ITEM_VALUE));
939 Label* pLabelTitle = static_cast<Label*>(pPanel->GetControl(GROUP_EDITOR_LABEL_TITLE, true));
940 pLabelTitle->SetTextColor(COLOR_ITEM_TITLE);
942 pPanel->Invalidate(true);
947 GroupEditorForm::OnTouchFocusIn(const Tizen::Ui::Control& source, const Tizen::Graphics::Point& currentPosition, const Tizen::Ui::TouchEventInfo& touchInfo)
952 GroupEditorForm::OnTouchFocusOut(const Tizen::Ui::Control& source, const Tizen::Graphics::Point& currentPosition, const Tizen::Ui::TouchEventInfo& touchInfo)
957 GroupEditorForm::OnTouchCanceled(const Tizen::Ui::Control& source, const Tizen::Graphics::Point& currentPosition, const Tizen::Ui::TouchEventInfo& touchInfo)
962 GroupEditorForm::OnKeyPressed(const Tizen::Ui::Control& source, Tizen::Ui::KeyCode keyCode)
964 if (keyCode == KEY_ENTER )
966 TableViewItem* pItem = static_cast<TableViewItem*>(&(const_cast<Control&>(source)));
968 Panel* pPanel = static_cast<Panel*>(pItem->GetControl(0));
975 Label* pLabelValue = static_cast<Label*>(pPanel->GetControl(GROUP_EDITOR_LABEL_VALUE, true));
977 if (pLabelValue == null)
982 Label* pLabelTitle = static_cast<Label*>(pPanel->GetControl(GROUP_EDITOR_LABEL_TITLE, true));
984 if (pLabelTitle == null)
989 pPanel->SetBackgroundColor(COLOR_PRESSED);
990 pLabelValue->SetTextColor(Color(COLOR_ITEM_PRESSED));
991 pLabelTitle->SetTextColor(COLOR_ITEM_PRESSED);
992 pPanel->Invalidate(true);
997 GroupEditorForm::OnKeyReleased(const Tizen::Ui::Control& source, Tizen::Ui::KeyCode keyCode)
999 if (keyCode == KEY_ENTER )
1002 TableViewItem* pItem = static_cast<TableViewItem*>(&(const_cast<Control&>(source)));
1004 Panel* pPanel = static_cast<Panel*>(pItem->GetControl(0));
1011 Label* pLabelValue = static_cast<Label*>(pPanel->GetControl(GROUP_EDITOR_LABEL_VALUE, true));
1013 if (pLabelValue == null)
1018 Label* pLabelTitle = static_cast<Label*>(pPanel->GetControl(GROUP_EDITOR_LABEL_TITLE, true));
1020 if (pLabelTitle == null)
1025 pPanel->SetBackgroundColor(COLOR_THUMBNAIL);
1026 pLabelValue->SetTextColor(Color(COLOR_ITEM_VALUE));
1027 pLabelTitle->SetTextColor(COLOR_ITEM_TITLE);
1028 pPanel->Invalidate(true);
1033 GroupEditorForm::OnKeyLongPressed(const Tizen::Ui::Control& source, Tizen::Ui::KeyCode keyCode)
1039 GroupEditorForm::OnKeyPressed(Control& source, const KeyEventInfo& keyEventInfo)
1045 GroupEditorForm::OnKeyReleased(Control& source, const KeyEventInfo& keyEventInfo)
1047 if (keyEventInfo.GetKeyCode() == KEY_BACK || keyEventInfo.GetKeyCode() == KEY_ESC)
1049 if (__pDiscardChangesPopup && __pDiscardChangesPopup->GetShowState() == true)
1051 HideDiscardChangesPopup();
1059 GroupEditorForm::OnPreviewKeyPressed(Control& source, const KeyEventInfo& keyEventInfo)
1065 GroupEditorForm::OnPreviewKeyReleased(Control& source, const KeyEventInfo& keyEventInfo)
1071 GroupEditorForm::OnKeypadWillOpen(Tizen::Ui::Control& source)
1076 GroupEditorForm::OnKeypadOpened(Tizen::Ui::Control& source)
1078 Rectangle clientBounds = GetClientAreaBounds();
1080 __pTableView->SetSize(clientBounds.width, clientBounds.height);
1084 GroupEditorForm::OnKeypadClosed(Tizen::Ui::Control& source)
1089 GroupEditorForm::OnKeypadActionPerformed(Tizen::Ui::Control& source, Tizen::Ui::KeypadAction keypadAction)
1094 GroupEditorForm::OnKeypadBoundsChanged(Tizen::Ui::Control& source)
1096 Rectangle clientBounds = GetClientAreaBounds();
1098 __pTableView->SetSize(clientBounds.width, clientBounds.height);
1102 GroupEditorForm::OnAppControlCompleteResponseReceived(const Tizen::App::AppId& appId, const Tizen::Base::String& operationId, Tizen::App::AppCtrlResult appControlResult, const Tizen::Base::Collection::IMap* pExtraData)
1104 AppLogDebug("ENTER");
1109 TryReturnVoid(appControlResult == APP_CTRL_RESULT_SUCCEEDED, "[E_FAILURE] The result of an appcontrol is not succeeded.");
1110 TryReturnVoid(pExtraData != null, "[E_FAILURE] The extra data is null.");
1112 const String *pResultString = null;
1113 const ArrayList* pResultList = dynamic_cast<const ArrayList*>(pExtraData->GetValue(String(OUTPUT_KEY_SELECTED)));
1114 if (pResultList != null)
1116 pResultString = static_cast<const String*>(pResultList->GetAt(0));
1120 pResultString = static_cast<const String*>(pExtraData->GetValue(String(OUTPUT_KEY_SELECTED)));
1122 TryReturnVoid(pResultString != null, "[E_FAILURE] Unable to get file path.");
1124 if (appId.Equals(String(PROVIDER_ID_CAMERA)) && operationId.Equals(String(OPERATION_ID_CREATE_CONTENT)))
1126 __pPresentationModel->SetThumbnailPath(*pResultString);
1127 __pTableView->RefreshItem(0, TABLE_VIEW_REFRESH_TYPE_ITEM_MODIFY);
1129 if (__pFileEventManager == null)
1131 __pFileEventManager = new (std::nothrow) FileEventManager();
1132 __pFileEventManager->Construct(*this);
1134 __pFileEventManager->AddPath(*pResultString, FILE_EVENT_TYPE_DELETE | FILE_EVENT_TYPE_DELETE_SELF | FILE_EVENT_TYPE_MODIFY | FILE_EVENT_TYPE_MOVE_SELF);
1135 __isGroupsChanged = true;
1137 else if (appId.Equals(String(PROVIDER_ID_GALLERY)) && operationId.Equals(String(OPERATION_ID_PICK)))
1141 ImageFormat imageFormat;
1142 result r = ImageBuffer::GetImageInfo(*pResultString, imageFormat, width, height);
1144 if (appControlResult == APP_CTRL_RESULT_FAILED || r != E_SUCCESS)
1146 int modalResult = 0;
1147 MessageBox unsupportedMessageBox;
1148 unsupportedMessageBox.Construct(L"", ResourceManager::GetString(L"IDS_MP_POP_INVALID_FILE"), MSGBOX_STYLE_NONE, 3000);
1149 unsupportedMessageBox.ShowAndWait(modalResult);
1154 __pPresentationModel->SetThumbnailPath(*pResultString);
1155 __pTableView->RefreshItem(0, TABLE_VIEW_REFRESH_TYPE_ITEM_MODIFY);
1157 if (__pFileEventManager == null)
1159 __pFileEventManager = new (std::nothrow) FileEventManager();
1160 __pFileEventManager->Construct(*this);
1162 __pFileEventManager->AddPath(*pResultString, FILE_EVENT_TYPE_DELETE | FILE_EVENT_TYPE_DELETE_SELF | FILE_EVENT_TYPE_MODIFY | FILE_EVENT_TYPE_MOVE_SELF);
1163 __isGroupsChanged = true;
1165 else if (appId.Equals(String(PROVIDER_ID_FILEMANAGER)) && operationId.Equals(String(OPERATION_ID_PICK)))
1167 __pPresentationModel->SetRingtone(*pResultString);
1168 __pTableView->RefreshItem(2, TABLE_VIEW_REFRESH_TYPE_ITEM_MODIFY);
1170 if (__pFileEventManager == null)
1172 __pFileEventManager = new (std::nothrow) FileEventManager();
1173 __pFileEventManager->Construct(*this);
1175 __pFileEventManager->AddPath(*pResultString, FILE_EVENT_TYPE_DELETE | FILE_EVENT_TYPE_DELETE_SELF | FILE_EVENT_TYPE_MODIFY | FILE_EVENT_TYPE_MOVE_SELF);
1176 __isGroupsChanged = true;
1179 AppLogDebug("EXIT");
1183 GroupEditorForm::LaunchAppControl(const Tizen::App::AppId& appId, const Tizen::Base::String& operationId)
1185 result r = E_SUCCESS;
1192 extraData.Construct();
1194 if (appId.Equals(String(PROVIDER_ID_CAMERA)) && operationId.Equals(String(OPERATION_ID_CREATE_CONTENT)))
1196 mimeType.Append(INPUT_MIME_TYPE_CAMERA);
1197 extraData.Add(new (std::nothrow) String(INPUT_KEY_ALLOW_SWITCH), new (std::nothrow) String(INPUT_VALUE_FALSE));
1199 else if (appId.Equals(String(PROVIDER_ID_GALLERY)) && operationId.Equals(String(OPERATION_ID_PICK)))
1201 mimeType.Append(INPUT_MIME_TYPE_GALLERY);
1202 extraData.Add(new (std::nothrow) String(INPUT_KEY_SELECTION_MODE), new (std::nothrow) String(INPUT_DATA_SELECTION_MODE_SINGLE));
1203 extraData.Add(new (std::nothrow) String(INPUT_KEY_IMAGEVIEWER_MODE), new (std::nothrow) String(INPUT_VALUE_IMAGEVIEWER_TYPE));
1205 else if (appId.Equals(String(PROVIDER_ID_FILEMANAGER)) && operationId.Equals(String(OPERATION_ID_PICK)))
1207 mimeType.Append(INPUT_MIME_TYPE_AUDIO);
1208 extraData.Add(new (std::nothrow) String(INPUT_KEY_SELECTION_MODE), new (std::nothrow) String(INPUT_DATA_SELECTION_MODE_SINGLE));
1211 AppControl* pAppControl = AppManager::FindAppControlN(appId, operationId);
1213 if (pAppControl != null)
1215 r = pAppControl->Start(&uri, &mimeType, &extraData, this);
1216 TryCatch(r == E_SUCCESS, , "[%s] Unable to launch app control", GetErrorMessage(r));
1223 extraData.RemoveAll(true);
1230 GroupEditorForm::OnContactsChanged(void)
1235 GroupEditorForm::OnCategoriesChanged(void)
1237 result r = E_SUCCESS;
1239 SceneManager* pSceneManager = SceneManager::GetInstance();
1241 SceneId previousSceneId;
1242 IListT<SceneId>* pHistoryList = pSceneManager->GetSceneHistoryN();
1243 if (pHistoryList != null)
1245 int count = pHistoryList->GetCount();
1246 r = pHistoryList->GetAt(count - 1, previousSceneId);
1247 delete pHistoryList;
1248 TryReturnVoid(r == E_SUCCESS, "[%s] Unable to get previous scene id", GetErrorMessage(r));
1251 if (previousSceneId.Equals(IDSCN_CONTACT_DETAILS, true) || previousSceneId.Equals(IDSCN_CONTACT_EDITOR, true))
1253 if (__pPresentationModel->GetCategoryCount() > 0)
1255 ArrayList* pArg = new (std::nothrow) ArrayList();
1257 pArg->Add(new (std::nothrow) Integer(__pPresentationModel->GetCategoryId()));
1259 r = pSceneManager->GoBackward(BackwardSceneTransition(SCENE_TRANSITION_ANIMATION_TYPE_RIGHT), pArg);
1260 TryReturnVoid(r == E_SUCCESS, "[%s] Unable to go backward", GetErrorMessage(r));
1268 r = pSceneManager->GoBackward(BackwardSceneTransition(SCENE_TRANSITION_ANIMATION_TYPE_RIGHT));
1269 TryReturnVoid(r == E_SUCCESS, "[%s] Unable to go backward", GetErrorMessage(r));
1274 GroupEditorForm::OnForeground(void)
1276 if ( File::IsFileExist(__pPresentationModel->GetThumbnailPath()) == false)
1278 __pPresentationModel->SetThumbnailPath(L"");
1279 __pTableView->RefreshItem(0, TABLE_VIEW_REFRESH_TYPE_ITEM_MODIFY);
1281 if (IsEnabled() == false)
1283 result r = SetEnabled(true);
1284 AppLogDebug("Form Enabled = %s", GetErrorMessage(r));
1290 GroupEditorForm::OnBackground(void)