2 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
4 // Licensed under the Flora License, Version 1.0 (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 CtContactDetailsForm.cpp
19 * @brief This is the implementation file for the ContactDetailsForm class.
26 #include "CtContactDetailsForm.h"
27 #include "CtContactPresentationModel.h"
28 #include "CtContactValueListItemProvider.h"
29 #include "CtContactsApp.h"
30 #include "CtResourceManager.h"
31 #include "CtSceneRegister.h"
34 using namespace Tizen::App;
35 using namespace Tizen::Base;
36 using namespace Tizen::Base::Collection;
37 using namespace Tizen::Base::Utility;
38 using namespace Tizen::Graphics;
39 using namespace Tizen::Media;
40 using namespace Tizen::Ui;
41 using namespace Tizen::Ui::Controls;
42 using namespace Tizen::Ui::Scenes;
43 using namespace Tizen::Social;
45 static const int IDA_FOOTER_EDIT = 10;
46 static const int IDA_FOOTER_DELETE = 11;
47 static const int IDA_FOOTER_MORE = 12;
48 static const int IDA_FOOTER_ADD = 13;
49 static const int IDA_VOICE_CALL = 20;
50 static const int IDA_MESSAGE = 21;
51 static const int IDA_VIDEO_CALL = 22;
52 static const int IDA_CONTEXTMENU_SHARE_EMAIL = 30;
53 static const int IDA_CONTEXTMENU_SHARE_MESSAGE = 31;
54 static const int IDA_BUTTON_RINGTONE_CLEAR = 40;
55 static const int IDA_BUTTON_SHARE_NAME_CARD = 50;
56 static const int IDA_POPUP_CLOSE = 60;
57 static const int IDA_INVALID_FILE_POPUP_CLOSE = 61;
58 static const int IDA_MORE_DEFAULT_NUMBER = 70;
60 static const wchar_t* IDB_DETAILS_FAVORITE_ON = L"00_icon_favorite_on.png";
61 static const wchar_t* IDB_DETAILS_FAVORITE_OFF = L"00_icon_favorite_off.png";
62 static const wchar_t* IDB_DETAILS_RESET_NORMAL = L"00_button_refresh.png";
63 static const wchar_t* IDB_DETAILS_RESET_PRESSED = L"00_button_refresh_press.png";
64 static const wchar_t* IDB_CIRCLE_BUTTON_NORMAL = L"C02_circle_button.png";
65 static const wchar_t* IDB_CIRCLE_BUTTON_PRESSED = L"C02_circle_button_press.png";
66 static const wchar_t* IDB_CALL_NORMAL = L"C02_circle_icon_call.png";
67 static const wchar_t* IDB_CALL_PRESSED = L"C02_circle_icon_call_press.png";
68 static const wchar_t* IDB_SMS_NORMAL = L"C02_circle_icon_sms.png";
69 static const wchar_t* IDB_SMS_PRESSED = L"C02_circle_icon_sms_press.png";
70 static const wchar_t* IDB_VIDEO_CALL_NORMAL = L"C02_circle_icon_vt-call.png";
71 static const wchar_t* IDB_VIDEO_CALL_PRESSED = L"C02_circle_icon_vt-call_press.png";
72 static const wchar_t* IDB_MORE_NORMAL = L"00_icon_more.png";
73 static const wchar_t* IDB_MORE_PRESSED = L"00_icon_more_press.png";
75 static const wchar_t* FAVORITE_LABEL = L"FavoriteLabel";
77 static const int Y_THUMBNAIL = 34;
78 static const int H_THUMBNAIL = 360;
79 static const int X_MAIN_INFO = 26;
80 static const int H_NAME = 70;
81 static const int H_SUB_INFO = 40;
82 static const int H_SUB_INFO_DIVIDER = 6;
83 static const int H_DEFAULT_NUMBER = 50;
84 static const int H_QUICK_BUTTON_DIVIDER = 42;
85 #if __SUPPORT_VIDEO_CALL
86 static const int W_QUICK_BUTTON_GAP = 115;
87 static const int X_QUICK_BUTTON = 38;
89 static const int W_QUICK_BUTTON_GAP = 148;
90 static const int X_QUICK_BUTTON = 148;
92 static const int H_QUICK_BUTTON = 138;
93 static const int Y_FAVORITE = 10;
94 static const int H_FAVORITE = 45;
95 static const int W_FAVORITE_GAP = 26;
96 static const int W_GROUP_STYLE_MARGIN = 16;
97 static const int W_TEXT_MARGIN = 26;
98 static const int W_TYPE = 160;
99 static const int H_ITEM = 112;
100 static const int H_ITEM_DOUBLE_LINE = 140;
101 static const int H_ADDITIONAL_ITEM = 54;
102 static const int Y_ITEM_TITLE = 22;
103 static const int H_ITEM_TITLE = 42;
104 static const int H_ITEM_VALUE = 54;
105 static const int H_ICON = 74;
106 static const int Y_BUTTON = 20;
107 static const int H_BUTTON = 72;
108 static const int H_BUTTON_CONTAINER = 132;
109 static const int W_BUTTON_GAP = 18;
111 static const int W_POPUP = 688;
112 static const int H_POPUP = 532;
113 static const int H_INVALID_FILE_POPUP = 200;
114 static const int H_POPUP_LIST_VIEW = 338;
115 static const int Y_POPUP_BUTTON = 358;
116 static const int H_POPUP_BUTTON = 74;
117 static const int W_POPUP_BUTTON = 394;
118 static const int Y_POPUP_TEXT_LABEL = 12;
119 static const int H_POPUP_TEXT_LABEL = 90;
120 static const int X_MORE = 55;
122 static const int SUB_INDEX_MASK = 0xF000;
124 static const unsigned int COLOR_TABLE_BG = Color32<248, 246, 239>::Value;
125 static const unsigned int COLOR_ITEM_TITLE = Color32<128, 128, 128>::Value;
126 static const unsigned int COLOR_ITEM_VALUE = Color32<0, 0, 0>::Value;
127 static const unsigned int COLOR_ITEM_TYPE = Color32<128, 128, 128>::Value;
128 static const unsigned int COLOR_OTHER_NUMBER = Color32<0, 0, 0>::Value;
129 static const unsigned int COLOR_NAME = Color32<59, 115, 182>::Value;
130 static const unsigned int COLOR_GROUP_STYLE = Color32<240, 237, 232>::Value;
131 static const unsigned int COLOR_POPUP_TEXT = Color32<0, 0, 0>::Value;
133 static const int FONT_SIZE_NAME = 56;
134 static const int FONT_SIZE_SUB_INFO = 32;
135 static const int FONT_SIZE_MAIN_TEXT = 44;
136 static const int FONT_SIZE_SUB_TEXT = 32;
137 static const int FONT_SIZE_POPUP_TEXT = 38;
139 static const wchar_t* INPUT_KEY_CALL_TYPE = L"http://tizen.org/appcontrol/data/call/type";
140 static const wchar_t* INPUT_KEY_MESSAGE_TYPE = L"http://tizen.org/appcontrol/data/message/type";
141 static const wchar_t* INPUT_KEY_MESSAGE_TO = L"http://tizen.org/appcontrol/data/to";
142 static const wchar_t* INPUT_KEY_SELECTION_MODE = L"http://tizen.org/appcontrol/data/selection_mode";
143 static const wchar_t* INPUT_DATA_SELECTION_MODE_SINGLE = L"single";
144 static const wchar_t* INPUT_MIME_TYPE_AUDIO = L"audio/*";
145 static const wchar_t* INPUT_URI_TEL = L"tel:";
146 static const wchar_t* INPUT_TYPE_VIDEO = L"video";
147 static const wchar_t* INPUT_TYPE_VOICE = L"voice";
148 static const wchar_t* INPUT_TYPE_SMS = L"sms";
149 static const wchar_t* INPUT_TYPE_MMS = L"mms";
150 static const wchar_t* OUTPUT_KEY_SELECTED = L"http://tizen.org/appcontrol/data/selected";
151 static const wchar_t* KEY_VIEW_TYPE = L"viewType";
152 static const wchar_t* KEY_VIEW_TYPE_VCF = L"path";
153 static const wchar_t* KEY_VIEW_TYPE_CONTACT_ID = L"contactId";
154 static const wchar_t* VALUE_VIEW_TYPE_VCF = L"vcf";
155 static const wchar_t* VALUE_VIEW_TYPE_CONTACT = L"contact";
157 ContactDetailsForm::ContactDetailsForm(void)
158 : __pAppControl(null)
160 , __pContextMenuCall(null)
161 , __pContextMenuShare(null)
162 , __pContextMenuMore(null)
163 , __pDefaultSelectorPopup(null)
164 , __pInvalidFilePopup(null)
166 , __pPresentationModel(null)
167 , __scrolledDistance(0)
171 ContactDetailsForm::~ContactDetailsForm(void)
176 ContactDetailsForm::Initialize(void)
178 Construct(L"IDL_CONTACT_DETAILS_FORM");
182 ContactDetailsForm::OnInitializing(void)
184 Footer* pFooter = GetFooter();
185 pFooter->AddActionEventListener(*this);
186 SetFormBackEventListener(this);
188 __pTableView = new (std::nothrow) TableView();
189 __pTableView->Construct(Rectangle(0, 0, GetClientAreaBounds().width, GetClientAreaBounds().height), true, TABLE_VIEW_SCROLL_BAR_STYLE_FADE_OUT);
190 __pTableView->SetItemProvider(this);
191 __pTableView->AddTableViewItemEventListener(*this);
192 __pTableView->SetBackgroundColor(COLOR_TABLE_BG);
193 __pTableView->AddTouchEventListener(*this);
194 __pTableView->AddScrollEventListener(*this);
195 AddControl(*__pTableView);
197 __pContextMenuCall = new (std::nothrow) ContextMenu();
198 __pContextMenuCall->Construct(Point(0, 0), CONTEXT_MENU_STYLE_LIST);
199 __pContextMenuCall->AddItem(ResourceManager::GetString(L"IDS_COM_BODY_CALL"), IDA_VOICE_CALL);
200 __pContextMenuCall->AddItem(ResourceManager::GetString(L"IDS_COM_BODY_MESSAGE"), IDA_MESSAGE);
201 #if __SUPPORT_VIDEO_CALL
202 __pContextMenuCall->AddItem(ResourceManager::GetString(L"IDS_COM_BODY_VIDEO_CALL"), IDA_VIDEO_CALL);
204 __pContextMenuCall->AddActionEventListener(*this);
206 __pContextMenuShare = new (std::nothrow) ContextMenu();
207 __pContextMenuShare->Construct(Point(0, 0), CONTEXT_MENU_STYLE_LIST);
208 __pContextMenuShare->AddItem(ResourceManager::GetString(L"IDS_COM_BODY_EMAIL"), IDA_CONTEXTMENU_SHARE_EMAIL);
209 __pContextMenuShare->AddItem(ResourceManager::GetString(L"IDS_COM_BODY_MESSAGE"), IDA_CONTEXTMENU_SHARE_MESSAGE);
210 __pContextMenuShare->AddActionEventListener(*this);
212 __pContextMenuMore = new (std::nothrow) ContextMenu();
213 __pContextMenuMore->Construct(Point(X_MORE, GetClientAreaBounds().y + GetClientAreaBounds().height), CONTEXT_MENU_STYLE_LIST);
214 __pContextMenuMore->AddItem(ResourceManager::GetString(L"IDS_PB_BODY_MARK_AS_DEFAULT_NUMBER"), IDA_MORE_DEFAULT_NUMBER);
215 __pContextMenuMore->AddActionEventListener(*this);
217 __pItemList = new (std::nothrow) ArrayListT<int>();
218 __pItemList->Construct();
220 __pPresentationModel = new (std::nothrow) ContactPresentationModel();
221 __pPresentationModel->Construct();
222 __pPresentationModel->AddContactChangeListener(*this);
228 ContactDetailsForm::OnTerminating(void)
230 delete __pAppControl;
231 delete __pContextMenuCall;
232 delete __pContextMenuShare;
233 delete __pContextMenuMore;
235 if (__pItemList != null)
237 __pItemList->RemoveAll();
241 if (__pPresentationModel != null)
243 __pPresentationModel->RemoveContactChangeListener(*this);
244 delete __pPresentationModel;
247 delete __pDefaultSelectorPopup;
248 delete __pInvalidFilePopup;
254 ContactDetailsForm::OnActionPerformed(const Tizen::Ui::Control& source, int actionId)
256 result r = E_SUCCESS;
257 SceneManager* pSceneManager = SceneManager::GetInstance();
261 case IDA_FOOTER_EDIT:
263 ArrayList* pList = new (std::nothrow) ArrayList();
265 pList->Add(*(new (std::nothrow) Integer(__pPresentationModel->GetContactId())));
266 r = pSceneManager->GoForward(ForwardSceneTransition(IDSCN_CONTACT_EDITOR, SCENE_TRANSITION_ANIMATION_TYPE_LEFT), pList);
267 TryReturnVoid(r == E_SUCCESS, "[%s] Unable to go forward", GetErrorMessage(r));
270 case IDA_FOOTER_DELETE:
273 MessageBox deleteMessageBox;
274 deleteMessageBox.Construct(L"", ResourceManager::GetString(L"IDS_COM_SK_DELETE") + L"?", MSGBOX_STYLE_YESNO);
275 deleteMessageBox.ShowAndWait(modalResult);
277 if (modalResult == MSGBOX_RESULT_YES)
279 r = __pPresentationModel->RemoveContact();
280 TryReturnVoid(r == E_SUCCESS, "[%s] Unable to remove contact", GetErrorMessage(r));
284 case IDA_FOOTER_MORE:
286 __pContextMenuMore->SetShowState(true);
287 __pContextMenuMore->Show();
292 ArrayList* pList = new (std::nothrow) ArrayList();
294 pList->Add(*(new (std::nothrow) Integer(INVALID_RECORD_ID)));
295 pList->Add(*(new (std::nothrow) String(__pPresentationModel->GetVcfPath())));
296 r = pSceneManager->GoForward(ForwardSceneTransition(IDSCN_CONTACT_EDITOR, SCENE_TRANSITION_ANIMATION_TYPE_LEFT), pList);
297 TryReturnVoid(r == E_SUCCESS, "[%s] Unable to go forward", GetErrorMessage(r));
300 case IDA_MORE_DEFAULT_NUMBER:
302 ShowDefaultSelectorPopup();
305 case IDA_BUTTON_RINGTONE_CLEAR:
307 __pPresentationModel->SetValue(DETAIL_PROPERTY_RINGTONE, String());
308 __pPresentationModel->UpdateContact();
313 r = LaunchAppControl(PROVIDER_ID_PHONE, OPERATION_ID_CALL, INPUT_TYPE_VOICE, source.GetName());
314 TryReturnVoid(r == E_SUCCESS, "[%s] Unable to launch appcontrol", GetErrorMessage(r));
319 r = LaunchAppControl(PROVIDER_ID_MESSAGE, OPERATION_ID_COMPOSE, INPUT_TYPE_SMS, source.GetName());
320 TryReturnVoid(r == E_SUCCESS, "[%s] Unable to launch appcontrol", GetErrorMessage(r));
325 r = LaunchAppControl(PROVIDER_ID_PHONE, OPERATION_ID_CALL, INPUT_TYPE_VIDEO, source.GetName());
326 TryReturnVoid(r == E_SUCCESS, "[%s] Unable to launch appcontrol", GetErrorMessage(r));
329 case IDA_CONTEXTMENU_SHARE_EMAIL:
331 r = LaunchAppControl(PROVIDER_ID_EMAIL, OPERATION_ID_COMPOSE);
332 TryReturnVoid(r == E_SUCCESS, "[%s] Unable to launch appcontrol", GetErrorMessage(r));
335 case IDA_CONTEXTMENU_SHARE_MESSAGE:
337 r = LaunchAppControl(PROVIDER_ID_MESSAGE, OPERATION_ID_COMPOSE, INPUT_TYPE_MMS);
338 TryReturnVoid(r == E_SUCCESS, "[%s] Unable to launch appcontrol", GetErrorMessage(r));
341 case IDA_BUTTON_SHARE_NAME_CARD:
344 itemPoint.x = GetClientAreaBounds().width / 2;
347 TableViewItem* pParent = static_cast<TableViewItem*>(source.GetParent());
350 itemPoint.y = GetClientAreaBounds().y + pParent->GetY() + source.GetY() - __scrolledDistance;
353 __pContextMenuShare->SetAnchorPosition(itemPoint);
354 __pContextMenuShare->SetShowState(true);
355 __pContextMenuShare->Show();
358 case IDA_POPUP_CLOSE:
360 HideDefaultSelectorPopup();
363 case IDA_INVALID_FILE_POPUP_CLOSE:
365 ContactsApp* pContactsApp = static_cast<ContactsApp*>(ContactsApp::GetInstance());
367 AppControlProviderManager::GetInstance()->SendAppControlResult(pContactsApp->GetRequestId(), APP_CTRL_RESULT_FAILED, null);
368 UiApp::GetInstance()->Terminate();
377 ContactDetailsForm::OnFormBackRequested(Tizen::Ui::Controls::Form& source)
379 if (__appControlViewType.IsEmpty() == false)
381 UiApp* pApp = UiApp::GetInstance();
386 SceneManager* pSceneManager = SceneManager::GetInstance();
388 result r = pSceneManager->GoBackward(BackwardSceneTransition(SCENE_TRANSITION_ANIMATION_TYPE_RIGHT));
389 TryReturnVoid(r == E_SUCCESS, "[%s] Unable to go backward", GetErrorMessage(r));
394 ContactDetailsForm::OnSceneActivatedN(const Tizen::Ui::Scenes::SceneId& previousSceneId, const Tizen::Ui::Scenes::SceneId& currentSceneId, IList* pArgs)
396 ContactsApp* pContactsApp = static_cast<ContactsApp*>(ContactsApp::GetInstance());
397 TryReturnVoid(pContactsApp != null, "Unable to cast UiApp to ContactsApp");
399 pContactsApp->AddContactsAppChangeEventListener(*this);
401 if (previousSceneId == IDSCN_GROUP_SELECTOR || previousSceneId == IDSCN_GROUP_EDITOR)
408 Integer* pArgument = null;
409 __pPresentationModel->RemoveContactFromAllCategories();
410 IEnumerator* pEnum = pArgs->GetEnumeratorN();
411 while (pEnum->MoveNext() == E_SUCCESS)
413 pArgument = static_cast<Integer*>(pEnum->GetCurrent());
414 if (pArgument != null)
416 __pPresentationModel->AddContactToCategory(pArgument->ToInt());
421 __pTableView->RefreshItem(__pItemList->GetCount() - 2, TABLE_VIEW_REFRESH_TYPE_ITEM_MODIFY);
423 else if (previousSceneId == IDSCN_CONTACT_EDITOR && __appControlViewType.IsEmpty())
425 InitializeDetailItemList();
426 __pTableView->UpdateTableView();
435 if (pContactsApp->GetOperationId() == OPERATION_ID_VIEW)
437 __pPresentationModel->RemoveContactChangeListener(*this);
439 result r = InitializeAppControl(pArgs);
443 pArgs->RemoveAll(true);
445 AppLogDebug("Unable to initialize appcontrol");
447 ShowInvalidFilePopup();
452 InitializeDetailItemList();
456 Integer* pContactId = static_cast<Integer*>(pArgs->GetAt(0));
457 if (pContactId != null)
459 __pPresentationModel->SetContactId(pContactId->ToInt());
460 InitializeDetailItemList();
463 __pTableView->UpdateTableView();
468 pArgs->RemoveAll(true);
474 ContactDetailsForm::InitializeAppControl(Tizen::Base::Collection::IList* pArgs)
481 result r = E_SUCCESS;
483 String* pArgStringType = null;
484 String* pArgStringValue = null;
487 String valueViewType;
490 pArgStringType = static_cast<String*>(pArgs->GetAt(0));
491 pArgStringValue = static_cast<String*>(pArgs->GetAt(1));
493 TryReturn(pArgStringType != null && pArgStringValue != null, E_FAILURE, "[E_FAILURE] Unable to initialize appcontrol");
495 ParseAppControlArgument(*pArgStringType, keyViewType, valueViewType);
496 ParseAppControlArgument(*pArgStringValue, keyValue, value);
498 if (keyViewType.Equals(KEY_VIEW_TYPE, false))
500 if (valueViewType.Equals(VALUE_VIEW_TYPE_CONTACT, false))
502 if (keyValue.Equals(KEY_VIEW_TYPE_CONTACT_ID, false))
505 Integer::Parse(value, contactId);
506 r = __pPresentationModel->SetContactId(contactId);
507 __appControlViewType = valueViewType;
509 Footer* pFooter = GetFooter();
510 pFooter->RemoveAllItems();
512 FooterItem footerItemEdit;
513 footerItemEdit.Construct(IDA_FOOTER_EDIT);
514 footerItemEdit.SetText(ResourceManager::GetString(L"IDS_COM_SK_EDIT"));
515 pFooter->AddItem(footerItemEdit);
517 FooterItem footerItemDelete;
518 footerItemDelete.Construct(IDA_FOOTER_DELETE);
519 footerItemDelete.SetText(ResourceManager::GetString(L"IDS_COM_SK_DELETE"));
520 pFooter->AddItem(footerItemDelete);
522 __pPresentationModel->AddContactChangeListener(*this);
526 AppLogDebug("Invalid KEY(contactId) of AppControl[VIEW]. [%ls] has been input", keyValue.GetPointer());
530 else if (valueViewType.Equals(VALUE_VIEW_TYPE_VCF, false))
532 if (keyValue.Equals(KEY_VIEW_TYPE_VCF, false))
534 r = __pPresentationModel->SetVcfPath(value);
536 __appControlViewType = valueViewType;
537 Footer* pFooter = GetFooter();
538 pFooter->RemoveAllItems();
539 pFooter->RemoveButtonAt(BUTTON_POSITION_LEFT);
541 FooterItem footerItemAdd;
542 footerItemAdd.Construct(IDA_FOOTER_ADD);
543 footerItemAdd.SetText(ResourceManager::GetString(L"IDS_COM_OPT_ADD_TO_CONTACTS"));
544 pFooter->AddItem(footerItemAdd);
548 AppLogDebug("Invalid KEY(path) of AppControl[VIEW]. [%ls] has been input", keyValue.GetPointer());
554 AppLogDebug("viewType of AppControl[VIEW] should be either vcf or contact. [%ls] has been inpue", keyValue.GetPointer());
560 AppLogDebug("Invalid KEY(viewType) of AppControl[VIEW]. [%ls] has been input", keyViewType.GetPointer());
568 ContactDetailsForm::OnSceneDeactivated(const Tizen::Ui::Scenes::SceneId& currentSceneId, const Tizen::Ui::Scenes::SceneId& nextSceneId)
570 ContactsApp* pContactsApp = static_cast<ContactsApp*>(ContactsApp::GetInstance());
571 pContactsApp->RemoveContactsAppChangeEventListener(*this);
573 delete __pAppControl;
574 __pAppControl = null;
578 ContactDetailsForm::InitializeDetailItemList(void)
580 if (__pItemList->GetCount() > 0)
582 __pItemList->RemoveAll();
586 __pItemList->Add(DETAIL_PROPERTY_MAIN_INFO);
588 // Other Phone Numbers
589 Footer* pFooter = GetFooter();
590 pFooter->RemoveButtonAt(BUTTON_POSITION_LEFT);
591 int otherNumberCount = __pPresentationModel->GetMultiValuesCount(DETAIL_PROPERTY_PHONE_NUMBER);
592 if (otherNumberCount > 1)
594 ButtonItem footerItemMore;
595 footerItemMore.Construct(BUTTON_ITEM_STYLE_ICON, IDA_FOOTER_MORE);
596 footerItemMore.SetBackgroundBitmap(BUTTON_ITEM_STATUS_NORMAL, ResourceManager::GetBitmapN(IDB_MORE_NORMAL));
597 footerItemMore.SetBackgroundBitmap(BUTTON_ITEM_STATUS_PRESSED, ResourceManager::GetBitmapN(IDB_MORE_PRESSED));
599 if (__appControlViewType.Equals(VALUE_VIEW_TYPE_VCF, false) == false)
601 pFooter->SetButton(BUTTON_POSITION_LEFT, footerItemMore);
605 String otherNumberType;
606 String defaultNumber = __pPresentationModel->GetValue(DETAIL_PROPERTY_DEFAULT_PHONE_NUMBER);
607 String defaultNumberType = __pPresentationModel->GetType(DETAIL_PROPERTY_DEFAULT_PHONE_NUMBER);
608 for (int subIndex = 0; subIndex < otherNumberCount; subIndex++)
610 //omit default number
611 otherNumber = __pPresentationModel->GetValue(DETAIL_PROPERTY_PHONE_NUMBER, subIndex);
612 otherNumberType = __pPresentationModel->GetType(DETAIL_PROPERTY_PHONE_NUMBER, subIndex);
614 if (otherNumber.CompareTo(defaultNumber) == 0 && otherNumberType.CompareTo(defaultNumberType) == 0)
619 __pItemList->Add(DETAIL_PROPERTY_PHONE_NUMBER + subIndex);
623 if (__pPresentationModel->GetMultiValuesCount(DETAIL_PROPERTY_EMAIL) > 0)
625 __pItemList->Add(DETAIL_PROPERTY_EMAIL);
628 if (__pPresentationModel->GetMultiValuesCount(DETAIL_PROPERTY_ADDRESS) > 0)
630 __pItemList->Add(DETAIL_PROPERTY_ADDRESS);
633 if (__pPresentationModel->GetMultiValuesCount(DETAIL_PROPERTY_IM_ADDRESS) > 0)
635 __pItemList->Add(DETAIL_PROPERTY_IM_ADDRESS);
638 if (__pPresentationModel->GetMultiValuesCount(DETAIL_PROPERTY_URL) > 0)
640 __pItemList->Add(DETAIL_PROPERTY_URL);
643 if (__pPresentationModel->GetValue(DETAIL_PROPERTY_BIRTHDAY).IsEmpty() == false)
645 __pItemList->Add(DETAIL_PROPERTY_BIRTHDAY);
648 if (__pPresentationModel->GetValue(DETAIL_PROPERTY_NOTE).IsEmpty() == false)
650 __pItemList->Add(DETAIL_PROPERTY_NOTE);
653 __pItemList->Add(DETAIL_PROPERTY_GROUP);
654 __pItemList->Add(DETAIL_PROPERTY_RINGTONE);
658 ContactDetailsForm::GetItemCount(void)
660 return __pItemList->GetCount();
663 Tizen::Ui::Controls::TableViewItem*
664 ContactDetailsForm::CreateItem(int itemIndex, int itemWidth)
666 TableViewItem* pItem = new (std::nothrow) TableViewItem();
668 int contentItemIndex = -1;
669 int itemSubIndex = -1;
670 __pItemList->GetAt(itemIndex, contentItemIndex);
672 switch (contentItemIndex & SUB_INDEX_MASK)
674 case DETAIL_PROPERTY_PHONE_NUMBER:
676 itemSubIndex = contentItemIndex - DETAIL_PROPERTY_PHONE_NUMBER;
677 contentItemIndex = DETAIL_PROPERTY_PHONE_NUMBER;
680 case DETAIL_PROPERTY_EMAIL:
682 contentItemIndex = DETAIL_PROPERTY_EMAIL;
685 case DETAIL_PROPERTY_IM_ADDRESS:
687 contentItemIndex = DETAIL_PROPERTY_IM_ADDRESS;
690 case DETAIL_PROPERTY_ADDRESS:
692 contentItemIndex = DETAIL_PROPERTY_ADDRESS;
695 case DETAIL_PROPERTY_URL:
697 contentItemIndex = DETAIL_PROPERTY_URL;
704 switch (contentItemIndex)
706 case DETAIL_PROPERTY_MAIN_INFO:
708 AddMainInfo(itemWidth, pItem);
711 case DETAIL_PROPERTY_PHONE_NUMBER: // fall through
712 case DETAIL_PROPERTY_EMAIL: // fall through
713 case DETAIL_PROPERTY_ADDRESS: // fall through
714 case DETAIL_PROPERTY_URL: // fall through
715 case DETAIL_PROPERTY_BIRTHDAY: // fall through
716 case DETAIL_PROPERTY_NOTE:
717 case DETAIL_PROPERTY_IM_ADDRESS:
719 AddProperty(itemWidth, pItem, contentItemIndex, itemSubIndex);
722 case DETAIL_PROPERTY_GROUP:
724 AddGroup(itemWidth, pItem);
727 case DETAIL_PROPERTY_RINGTONE:
729 AddRingTone(itemWidth, pItem);
744 ContactDetailsForm::DeleteItem(int itemIndex, Tizen::Ui::Controls::TableViewItem* pItem)
751 ContactDetailsForm::UpdateItem(int itemIndex, Tizen::Ui::Controls::TableViewItem* pItem)
753 int contentItemIndex = -1;
754 __pItemList->GetAt(itemIndex, contentItemIndex);
758 if (contentItemIndex == DETAIL_PROPERTY_GROUP)
760 value = __pPresentationModel->GetValue(DETAIL_PROPERTY_GROUP);
764 value = ResourceManager::GetString(L"IDS_PB_BODY_NOT_ASSIGNED");
767 else if (contentItemIndex == DETAIL_PROPERTY_RINGTONE)
769 String path = __pPresentationModel->GetValue(DETAIL_PROPERTY_RINGTONE);
771 path.LastIndexOf(L"/", path.GetLength() - 1, index);
775 path.SubString(index + 1, value);
779 Label* pValueLabel = static_cast<Label*>(pItem->GetControl(2));
780 if (pValueLabel == null)
785 pValueLabel->SetText(value);
786 pValueLabel->Invalidate(false);
790 ContactDetailsForm::GetDefaultItemHeight(void)
796 ContactDetailsForm::AddMainInfo(int itemWidth, Tizen::Ui::Controls::TableViewItem* pItem)
798 int itemHeight = Y_THUMBNAIL;
800 Label* pThumbnailLabel = null;
802 String thumbnailPath = __pPresentationModel->GetValue(DETAIL_PROPERTY_THUMBNAIL);
803 Bitmap* pThumbnail = null;
804 ImageBuffer thumbnailImageBuffer;
805 result r = thumbnailImageBuffer.Construct(thumbnailPath);
808 pThumbnail = thumbnailImageBuffer.GetBitmapN(BITMAP_PIXEL_FORMAT_ARGB8888, BUFFER_SCALING_NONE);
810 if (pThumbnail != null)
812 pThumbnail->SetScalingQuality(BITMAP_SCALING_QUALITY_HIGH);
813 pThumbnail->Scale(Dimension(H_THUMBNAIL, H_THUMBNAIL));
814 pThumbnailLabel = new (std::nothrow) Label();
815 pThumbnailLabel->Construct(Rectangle((itemWidth - H_THUMBNAIL) / 2, Y_THUMBNAIL, H_THUMBNAIL, H_THUMBNAIL), L"");
816 pThumbnailLabel->SetBackgroundBitmap(*pThumbnail);
819 itemHeight += (H_THUMBNAIL + Y_THUMBNAIL);
822 String firstName = __pPresentationModel->GetValue(DETAIL_PROPERTY_FIRST_NAME);
823 String middleName = __pPresentationModel->GetValue(DETAIL_PROPERTY_MIDDLE_NAME);
824 String lastName = __pPresentationModel->GetValue(DETAIL_PROPERTY_LAST_NAME);
825 String nickName = __pPresentationModel->GetValue(DETAIL_PROPERTY_NICK_NAME);
826 String suffix = __pPresentationModel->GetValue(DETAIL_PROPERTY_NAME_SUFFIX);
827 String jobTitle = __pPresentationModel->GetValue(DETAIL_PROPERTY_JOB_TITLE);
828 String company = __pPresentationModel->GetValue(DETAIL_PROPERTY_COMPANY);
829 String department = __pPresentationModel->GetValue(DETAIL_PROPERTY_DEPARTMENT);
832 if (firstName.IsEmpty() == false)
834 name = firstName + CHARACTER_SPACE;
836 if (middleName.IsEmpty() == false)
838 name += (middleName + CHARACTER_SPACE);
840 if (lastName.IsEmpty() == false)
847 if (__pPresentationModel->GetMultiValuesCount(DETAIL_PROPERTY_PHONE_NUMBER))
849 name.Append(__pPresentationModel->GetValue(DETAIL_PROPERTY_DEFAULT_PHONE_NUMBER));
853 name.Append(__pPresentationModel->GetValue(DETAIL_PROPERTY_EMAIL, 0));
857 String suffixNickName;
858 if (suffix.IsEmpty() == false)
860 suffixNickName = suffix + CHARACTER_SPACE;
862 if (nickName.IsEmpty() == false)
864 suffixNickName += nickName;
868 if (jobTitle.IsEmpty() == false)
870 companyInfo = jobTitle + CHARACTER_SPACE;
872 if (company.IsEmpty() == false)
874 companyInfo += company + CHARACTER_SPACE;
876 if (department.IsEmpty() == false)
878 companyInfo += department;
881 Label* pNameLabel = null;
882 Label* pFavoriteLabel = null;
883 if (name.IsEmpty() == false)
885 pNameLabel = new (std::nothrow) Label();
886 pNameLabel->Construct(Rectangle(X_MAIN_INFO, itemHeight, itemWidth - (X_MAIN_INFO + H_FAVORITE + W_FAVORITE_GAP * 2), H_NAME), name);
887 pNameLabel->SetTextConfig(FONT_SIZE_NAME, LABEL_TEXT_STYLE_BOLD);
888 pNameLabel->SetTextColor(COLOR_NAME);
889 pNameLabel->SetTextHorizontalAlignment(ALIGNMENT_LEFT);
890 pNameLabel->SetTextVerticalAlignment(ALIGNMENT_TOP);
892 if (__appControlViewType.Equals(VALUE_VIEW_TYPE_VCF, false) == false)
894 pFavoriteLabel = new (std::nothrow) Label();
895 pFavoriteLabel->Construct(Rectangle(itemWidth - (H_FAVORITE + W_FAVORITE_GAP * 2), itemHeight + Y_FAVORITE, H_FAVORITE, H_FAVORITE), L"");
896 pFavoriteLabel->SetName(FAVORITE_LABEL);
897 pFavoriteLabel->AddTouchEventListener(*this);
899 Bitmap* pBitmap = null;
900 if (__pPresentationModel->IsFavorite())
902 pBitmap = ResourceManager::GetBitmapN(IDB_DETAILS_FAVORITE_ON);
906 pBitmap = ResourceManager::GetBitmapN(IDB_DETAILS_FAVORITE_OFF);
911 pFavoriteLabel->SetBackgroundBitmap(*pBitmap);
916 itemHeight += H_NAME;
919 Label* pSuffixNickNameLabel = null;
920 if (suffixNickName.IsEmpty() == false)
922 pSuffixNickNameLabel = new (std::nothrow) Label();
923 pSuffixNickNameLabel->Construct(Rectangle(X_MAIN_INFO, itemHeight, itemWidth - X_MAIN_INFO, H_SUB_INFO), suffixNickName);
924 pSuffixNickNameLabel->SetTextConfig(FONT_SIZE_SUB_INFO, LABEL_TEXT_STYLE_NORMAL);
925 pSuffixNickNameLabel->SetTextHorizontalAlignment(ALIGNMENT_LEFT);
926 pSuffixNickNameLabel->SetTextVerticalAlignment(ALIGNMENT_MIDDLE);
927 itemHeight += (H_SUB_INFO + H_SUB_INFO_DIVIDER);
930 Label* pCompanyInfoLabel = null;
931 if (companyInfo.IsEmpty() == false)
933 pCompanyInfoLabel = new (std::nothrow) Label();
934 pCompanyInfoLabel->Construct(Rectangle(X_MAIN_INFO, itemHeight, itemWidth - X_MAIN_INFO, H_SUB_INFO), companyInfo);
935 pCompanyInfoLabel->SetTextConfig(FONT_SIZE_SUB_INFO, LABEL_TEXT_STYLE_NORMAL);
936 pCompanyInfoLabel->SetTextHorizontalAlignment(ALIGNMENT_LEFT);
937 pCompanyInfoLabel->SetTextVerticalAlignment(ALIGNMENT_MIDDLE);
938 itemHeight += (H_SUB_INFO + H_SUB_INFO_DIVIDER);
941 Label* pDefaultNumberLabel = null;
942 Button* pCallButton = null;
943 Button* pMessageButton = null;
944 #if __SUPPORT_VIDEO_CALL
945 Button* pVideoCallButton = null;
948 String defaultPhoneNumber = __pPresentationModel->GetValue(DETAIL_PROPERTY_DEFAULT_PHONE_NUMBER);
949 if (defaultPhoneNumber.IsEmpty() == false)
951 pDefaultNumberLabel = new (std::nothrow) Label();
952 pDefaultNumberLabel->Construct(Rectangle(X_MAIN_INFO, itemHeight, itemWidth - X_MAIN_INFO, H_DEFAULT_NUMBER), defaultPhoneNumber);
953 pDefaultNumberLabel->SetTextConfig(FONT_SIZE_MAIN_TEXT, LABEL_TEXT_STYLE_BOLD);
954 pDefaultNumberLabel->SetTextHorizontalAlignment(ALIGNMENT_LEFT);
955 pDefaultNumberLabel->SetTextVerticalAlignment(ALIGNMENT_MIDDLE);
956 itemHeight += (H_DEFAULT_NUMBER + H_QUICK_BUTTON_DIVIDER);
958 Bitmap* pBgNormal = ResourceManager::GetBitmapN(IDB_CIRCLE_BUTTON_NORMAL);
959 Bitmap* pBgPressed = ResourceManager::GetBitmapN(IDB_CIRCLE_BUTTON_PRESSED);
960 Bitmap* pCallNormal = ResourceManager::GetBitmapN(IDB_CALL_NORMAL);
961 Bitmap* pCallPressed = ResourceManager::GetBitmapN(IDB_CALL_PRESSED);
962 Bitmap* pMessageNormal = ResourceManager::GetBitmapN(IDB_SMS_NORMAL);
963 Bitmap* pMessagePressed = ResourceManager::GetBitmapN(IDB_SMS_PRESSED);
964 Bitmap* pVideoCallNormal = ResourceManager::GetBitmapN(IDB_VIDEO_CALL_NORMAL);
965 Bitmap* pVideoCallPressed = ResourceManager::GetBitmapN(IDB_VIDEO_CALL_PRESSED);
967 pCallButton = new (std::nothrow) Button();
968 pCallButton->Construct(Rectangle(X_QUICK_BUTTON, itemHeight, H_QUICK_BUTTON, H_QUICK_BUTTON));
969 pCallButton->SetActionId(IDA_VOICE_CALL);
970 pCallButton->AddActionEventListener(*this);
971 if (pBgNormal != null)
973 pCallButton->SetNormalBackgroundBitmap(*pBgNormal);
975 if (pBgPressed != null)
977 pCallButton->SetPressedBackgroundBitmap(*pBgPressed);
979 if (pCallNormal != null)
981 pCallButton->SetNormalBitmap(Point(0, 0), *pCallNormal);
983 if (pCallPressed != null)
985 pCallButton->SetPressedBitmap(Point(0, 0), *pCallPressed);
988 pMessageButton = new (std::nothrow) Button();
989 pMessageButton->Construct(Rectangle((X_QUICK_BUTTON + H_QUICK_BUTTON + W_QUICK_BUTTON_GAP), itemHeight, H_QUICK_BUTTON, H_QUICK_BUTTON));
990 pMessageButton->SetActionId(IDA_MESSAGE);
991 pMessageButton->AddActionEventListener(*this);
992 if (pBgNormal != null)
994 pMessageButton->SetNormalBackgroundBitmap(*pBgNormal);
996 if (pBgPressed != null)
998 pMessageButton->SetPressedBackgroundBitmap(*pBgPressed);
1000 if (pMessageNormal != null)
1002 pMessageButton->SetNormalBitmap(Point(0, 0), *pMessageNormal);
1004 if (pMessagePressed != null)
1006 pMessageButton->SetPressedBitmap(Point(0, 0), *pMessagePressed);
1008 #if __SUPPORT_VIDEO_CALL
1009 pVideoCallButton = new (std::nothrow) Button();
1010 pVideoCallButton->Construct(Rectangle((X_QUICK_BUTTON + (H_QUICK_BUTTON * 2) + (W_QUICK_BUTTON_GAP * 2)), itemHeight, H_QUICK_BUTTON, H_QUICK_BUTTON));
1011 pVideoCallButton->SetActionId(IDA_VIDEO_CALL);
1012 pVideoCallButton->AddActionEventListener(*this);
1013 if (pBgNormal != null)
1015 pVideoCallButton->SetNormalBackgroundBitmap(*pBgNormal);
1017 if (pBgPressed != null)
1019 pVideoCallButton->SetPressedBackgroundBitmap(*pBgPressed);
1021 if (pVideoCallNormal != null)
1023 pVideoCallButton->SetNormalBitmap(Point(0, 0), *pVideoCallNormal);
1025 if (pVideoCallPressed != null)
1027 pVideoCallButton->SetPressedBitmap(Point(0, 0), *pVideoCallPressed);
1034 delete pCallPressed;
1035 delete pMessageNormal;
1036 delete pMessagePressed;
1037 delete pVideoCallNormal;
1038 delete pVideoCallPressed;
1040 itemHeight += (H_QUICK_BUTTON + H_QUICK_BUTTON_DIVIDER);
1044 itemHeight += H_QUICK_BUTTON_DIVIDER;
1047 pItem->Construct(Dimension(itemWidth, itemHeight));
1048 pItem->SetBackgroundColor(COLOR_TABLE_BG, TABLE_VIEW_ITEM_DRAWING_STATUS_NORMAL);
1049 pItem->SetBackgroundColor(COLOR_TABLE_BG, TABLE_VIEW_ITEM_DRAWING_STATUS_PRESSED);
1051 if (pThumbnailLabel != null)
1053 pItem->AddControl(*pThumbnailLabel);
1055 if (pNameLabel != null)
1057 pItem->AddControl(*pNameLabel);
1059 if (pFavoriteLabel != null)
1061 pItem->AddControl(*pFavoriteLabel);
1063 if (pSuffixNickNameLabel != null)
1065 pItem->AddControl(*pSuffixNickNameLabel);
1067 if (pCompanyInfoLabel != null)
1069 pItem->AddControl(*pCompanyInfoLabel);
1071 if (pDefaultNumberLabel != null)
1073 pItem->AddControl(*pDefaultNumberLabel);
1075 #if __SUPPORT_VIDEO_CALL
1076 if (pCallButton != null && pMessageButton != null && pVideoCallButton != null)
1078 pItem->AddControl(*pCallButton);
1079 pItem->AddControl(*pMessageButton);
1080 pItem->AddControl(*pVideoCallButton);
1083 if (pCallButton != null && pMessageButton != null)
1085 pItem->AddControl(*pCallButton);
1086 pItem->AddControl(*pMessageButton);
1092 ContactDetailsForm::AddProperty(int itemWidth, Tizen::Ui::Controls::TableViewItem* pItem, int detailProperty, int itemSubIndex)
1098 int itemHeight = H_ITEM_DOUBLE_LINE;
1099 int valueCount = __pPresentationModel->GetMultiValuesCount(static_cast<DetailProperty>(detailProperty));
1101 if (detailProperty != DETAIL_PROPERTY_PHONE_NUMBER && valueCount > 1)
1103 pItem->Construct(Dimension(itemWidth, H_ITEM_DOUBLE_LINE + (H_ADDITIONAL_ITEM * (valueCount - 1))), TABLE_VIEW_ANNEX_STYLE_NORMAL);
1104 CreateTitleValueTypeItem(itemWidth, pItem, detailProperty);
1109 switch (detailProperty)
1111 case DETAIL_PROPERTY_PHONE_NUMBER:
1113 type = __pPresentationModel->GetType(DETAIL_PROPERTY_PHONE_NUMBER, itemSubIndex);
1114 value = __pPresentationModel->GetValue(DETAIL_PROPERTY_PHONE_NUMBER, itemSubIndex);
1116 pItem->Construct(Dimension(itemWidth, H_ITEM), TABLE_VIEW_ANNEX_STYLE_NORMAL);
1117 pItem->SetName(value);
1119 CreateValueTypeItem(itemWidth, pItem, value, type);
1124 case DETAIL_PROPERTY_EMAIL:
1126 title = ResourceManager::GetString(L"IDS_COM_BODY_EMAIL");
1127 type = __pPresentationModel->GetType(static_cast<DetailProperty>(detailProperty), 0);
1128 value = __pPresentationModel->GetValue(static_cast<DetailProperty>(detailProperty), 0);
1131 case DETAIL_PROPERTY_ADDRESS:
1133 title = ResourceManager::GetString(L"IDS_PB_BODY_ADDRESS");
1134 type = __pPresentationModel->GetType(static_cast<DetailProperty>(detailProperty), 0);
1135 value = __pPresentationModel->GetValue(static_cast<DetailProperty>(detailProperty), 0);
1138 case DETAIL_PROPERTY_IM_ADDRESS:
1140 title = ResourceManager::GetString(L"IDS_PB_HEADER_INSTANT_MESSENGER_ABB");
1141 type = __pPresentationModel->GetType(static_cast<DetailProperty>(detailProperty), 0);
1142 value = __pPresentationModel->GetValue(static_cast<DetailProperty>(detailProperty), 0);
1145 case DETAIL_PROPERTY_URL:
1147 title = ResourceManager::GetString(L"IDS_PB_BODY_URL");
1148 type = __pPresentationModel->GetType(static_cast<DetailProperty>(detailProperty), 0);
1149 value = __pPresentationModel->GetValue(static_cast<DetailProperty>(detailProperty), 0);
1152 case DETAIL_PROPERTY_BIRTHDAY:
1154 title = ResourceManager::GetString(L"IDS_PB_BODY_BIRTHDAY");
1155 value = __pPresentationModel->GetValue(DETAIL_PROPERTY_BIRTHDAY);
1158 case DETAIL_PROPERTY_NOTE:
1160 title = ResourceManager::GetString(L"IDS_PB_BODY_NOTE");
1161 value = __pPresentationModel->GetValue(DETAIL_PROPERTY_NOTE);
1163 TextBox* pNote = new (std::nothrow) TextBox();
1164 pNote->Construct(Rectangle(0, 0, itemWidth - W_TEXT_MARGIN * 2, itemHeight));
1165 pNote->SetText(value);
1166 lineCount = pNote->GetLineCount();
1170 itemHeight += H_ADDITIONAL_ITEM * (lineCount - 1);
1177 pItem->Construct(Dimension(itemWidth, itemHeight), TABLE_VIEW_ANNEX_STYLE_NORMAL);
1178 CreateTitleValueTypeItem(itemWidth, pItem, title, value, type, lineCount);
1182 ContactDetailsForm::AddGroup(int itemWidth, Tizen::Ui::Controls::TableViewItem* pItem)
1184 pItem->Construct(Dimension(itemWidth, H_ITEM_DOUBLE_LINE), TABLE_VIEW_ANNEX_STYLE_NORMAL);
1185 pItem->SetName(Integer::ToString(DETAIL_PROPERTY_GROUP));
1187 String title = ResourceManager::GetString(L"IDS_PB_BODY_GROUPS");
1188 String value = __pPresentationModel->GetValue(DETAIL_PROPERTY_GROUP);
1190 if (value.IsEmpty())
1192 value = ResourceManager::GetString(L"IDS_PB_BODY_NOT_ASSIGNED");
1195 AddGroupStylePanel(itemWidth, pItem, GROUP_STYLE_TOP);
1197 CreateTitleValueTypeItem(itemWidth, pItem, title, value);
1201 ContactDetailsForm::AddRingTone(int itemWidth, Tizen::Ui::Controls::TableViewItem* pItem)
1203 pItem->Construct(Dimension(itemWidth, H_ITEM_DOUBLE_LINE), TABLE_VIEW_ANNEX_STYLE_NORMAL);
1204 pItem->SetName(Integer::ToString(DETAIL_PROPERTY_RINGTONE));
1206 String title = ResourceManager::GetString(L"IDS_PB_BODY_RINGTONE");
1207 String value = __pPresentationModel->GetValue(DETAIL_PROPERTY_RINGTONE);
1211 value.LastIndexOf(L"/", value.GetLength() - 1, index);
1215 value.SubString(index + 1, trimmedPath);
1218 AddGroupStylePanel(itemWidth, pItem, GROUP_STYLE_BOTTOM);
1220 CreateTitleValueTypeItem(itemWidth, pItem, title, trimmedPath);
1222 if (__appControlViewType.Equals(VALUE_VIEW_TYPE_VCF, false) == false)
1224 Button* pClearButton = new (std::nothrow) Button();
1225 pClearButton->Construct(Rectangle(itemWidth - H_ICON - W_TEXT_MARGIN, (H_ITEM_DOUBLE_LINE - H_ICON) / 2, H_ICON, H_ICON));
1226 pClearButton->SetActionId(IDA_BUTTON_RINGTONE_CLEAR);
1227 pClearButton->AddActionEventListener(*this);
1229 Bitmap* pReset = ResourceManager::GetBitmapN(IDB_DETAILS_RESET_NORMAL);
1232 pClearButton->SetNormalBitmap(Point(0, 0), *pReset);
1235 pReset = ResourceManager::GetBitmapN(IDB_DETAILS_RESET_PRESSED);
1238 pClearButton->SetPressedBitmap(Point(0, 0), *pReset);
1242 pItem->AddControl(*pClearButton);
1243 pItem->SetIndividualSelectionEnabled(pClearButton, true);
1248 ContactDetailsForm::AddShareButtons(int itemWidth, Tizen::Ui::Controls::TableViewItem* pItem)
1250 pItem->Construct(Dimension(itemWidth, H_BUTTON_CONTAINER));
1252 int buttonWidth = itemWidth - W_BUTTON_GAP * 2;
1254 Button* pSendNameButton = new (std::nothrow) Button();
1255 pSendNameButton->Construct(Rectangle(W_BUTTON_GAP, Y_BUTTON, buttonWidth, H_BUTTON), ResourceManager::GetString(L"IDS_PB_HEADER_SEND_NAMECARD"));
1256 pSendNameButton->SetActionId(IDA_BUTTON_SHARE_NAME_CARD);
1257 pSendNameButton->AddActionEventListener(*this);
1258 pItem->AddControl(*pSendNameButton);
1262 ContactDetailsForm::CreateValueTypeItem(int itemWidth, Tizen::Ui::Controls::TableViewItem* pItem, const Tizen::Base::String& value, const Tizen::Base::String& type)
1264 pItem->SetBackgroundColor(COLOR_TABLE_BG, TABLE_VIEW_ITEM_DRAWING_STATUS_NORMAL);
1265 pItem->SetBackgroundColor(COLOR_TABLE_BG, TABLE_VIEW_ITEM_DRAWING_STATUS_PRESSED);
1267 Label* pValueLabel = new (std::nothrow) Label();
1268 pValueLabel->Construct(Rectangle(W_TEXT_MARGIN, 0, itemWidth - W_TEXT_MARGIN * 2 - W_TYPE, H_ITEM), value);
1269 pValueLabel->SetTextHorizontalAlignment(ALIGNMENT_LEFT);
1270 pValueLabel->SetTextVerticalAlignment(ALIGNMENT_MIDDLE);
1271 pValueLabel->SetTextConfig(FONT_SIZE_MAIN_TEXT, LABEL_TEXT_STYLE_NORMAL);
1272 pValueLabel->SetTextColor(COLOR_OTHER_NUMBER);
1273 pItem->AddControl(*pValueLabel);
1275 Label* pTypeLabel = new (std::nothrow) Label();
1276 pTypeLabel->Construct(Rectangle((itemWidth - W_TEXT_MARGIN - W_TYPE), 0, W_TYPE, H_ITEM), type);
1277 pTypeLabel->SetTextHorizontalAlignment(ALIGNMENT_RIGHT);
1278 pTypeLabel->SetTextVerticalAlignment(ALIGNMENT_MIDDLE);
1279 pTypeLabel->SetTextConfig(FONT_SIZE_SUB_TEXT, LABEL_TEXT_STYLE_BOLD);
1280 pTypeLabel->SetTextColor(COLOR_ITEM_TYPE);
1281 pItem->AddControl(*pTypeLabel);
1285 ContactDetailsForm::CreateTitleValueTypeItem(int itemWidth, Tizen::Ui::Controls::TableViewItem* pItem, const Tizen::Base::String& title, const Tizen::Base::String& value, const Tizen::Base::String& type, int lineCount)
1287 int valueWidth = itemWidth - (W_TEXT_MARGIN * 2);
1289 pItem->SetBackgroundColor(COLOR_TABLE_BG, TABLE_VIEW_ITEM_DRAWING_STATUS_NORMAL);
1290 pItem->SetBackgroundColor(COLOR_TABLE_BG, TABLE_VIEW_ITEM_DRAWING_STATUS_PRESSED);
1292 Label* pTitleLabel = new (std::nothrow) Label();
1293 pTitleLabel->Construct(Rectangle(W_TEXT_MARGIN, Y_ITEM_TITLE, itemWidth - W_TEXT_MARGIN, H_ITEM_TITLE), title);
1294 pTitleLabel->SetTextHorizontalAlignment(ALIGNMENT_LEFT);
1295 pTitleLabel->SetTextVerticalAlignment(ALIGNMENT_MIDDLE);
1296 pTitleLabel->SetTextConfig(FONT_SIZE_SUB_TEXT, LABEL_TEXT_STYLE_BOLD);
1297 pTitleLabel->SetTextColor(COLOR_ITEM_TITLE);
1298 pItem->AddControl(*pTitleLabel);
1300 if (type.IsEmpty() == false)
1302 Label* pTypeLabel = new (std::nothrow) Label();
1303 pTypeLabel->Construct(Rectangle((itemWidth - W_TEXT_MARGIN - W_TYPE), Y_ITEM_TITLE + H_ITEM_TITLE, W_TYPE, H_ITEM_VALUE), type);
1304 pTypeLabel->SetTextHorizontalAlignment(ALIGNMENT_RIGHT);
1305 pTypeLabel->SetTextVerticalAlignment(ALIGNMENT_MIDDLE);
1306 pTypeLabel->SetTextConfig(FONT_SIZE_SUB_TEXT, LABEL_TEXT_STYLE_BOLD);
1307 pTypeLabel->SetTextColor(COLOR_ITEM_TYPE);
1308 pItem->AddControl(*pTypeLabel);
1310 valueWidth = itemWidth - (W_TEXT_MARGIN * 2) - W_TYPE;
1312 else if (title.Equals(ResourceManager::GetString(L"IDS_PB_BODY_RINGTONE"), false))
1314 valueWidth = itemWidth - (W_TEXT_MARGIN * 2) - H_ICON;
1317 Label* pValueLabel = new (std::nothrow) Label();
1318 pValueLabel->Construct(Rectangle(W_TEXT_MARGIN, Y_ITEM_TITLE + H_ITEM_TITLE, valueWidth, H_ITEM_VALUE * lineCount), value);
1319 pValueLabel->SetTextHorizontalAlignment(ALIGNMENT_LEFT);
1320 pValueLabel->SetTextVerticalAlignment(ALIGNMENT_MIDDLE);
1321 pValueLabel->SetTextConfig(FONT_SIZE_MAIN_TEXT, LABEL_TEXT_STYLE_NORMAL);
1322 pValueLabel->SetTextColor(COLOR_ITEM_VALUE);
1323 pItem->AddControl(*pValueLabel);
1327 ContactDetailsForm::CreateTitleValueTypeItem(int itemWidth, Tizen::Ui::Controls::TableViewItem* pItem, int detailProperty)
1331 pItem->SetBackgroundColor(COLOR_TABLE_BG, TABLE_VIEW_ITEM_DRAWING_STATUS_NORMAL);
1332 pItem->SetBackgroundColor(COLOR_TABLE_BG, TABLE_VIEW_ITEM_DRAWING_STATUS_PRESSED);
1334 switch (detailProperty)
1336 case DETAIL_PROPERTY_EMAIL:
1338 title = ResourceManager::GetString(L"IDS_COM_BODY_EMAIL");
1341 case DETAIL_PROPERTY_ADDRESS:
1343 title = ResourceManager::GetString(L"IDS_PB_BODY_ADDRESS");
1346 case DETAIL_PROPERTY_URL:
1348 title = ResourceManager::GetString(L"IDS_PB_BODY_URL");
1351 case DETAIL_PROPERTY_IM_ADDRESS:
1353 title = ResourceManager::GetString(L"IDS_PB_HEADER_INSTANT_MESSENGER_ABB");
1360 Label* pTitleLabel = new (std::nothrow) Label();
1361 pTitleLabel->Construct(Rectangle(W_TEXT_MARGIN, Y_ITEM_TITLE, itemWidth - W_TEXT_MARGIN, H_ITEM_TITLE), title);
1362 pTitleLabel->SetTextHorizontalAlignment(ALIGNMENT_LEFT);
1363 pTitleLabel->SetTextVerticalAlignment(ALIGNMENT_MIDDLE);
1364 pTitleLabel->SetTextConfig(FONT_SIZE_SUB_TEXT, LABEL_TEXT_STYLE_BOLD);
1365 pTitleLabel->SetTextColor(COLOR_ITEM_TITLE);
1366 pItem->AddControl(*pTitleLabel);
1368 for (int i = 0; i < __pPresentationModel->GetMultiValuesCount(static_cast<DetailProperty>(detailProperty)); i++)
1370 String type = __pPresentationModel->GetType(static_cast<DetailProperty>(detailProperty), i);
1371 String value = __pPresentationModel->GetValue(static_cast<DetailProperty>(detailProperty), i);
1373 int valueWidth = itemWidth - (W_TEXT_MARGIN * 2);
1374 if (type.IsEmpty() == false)
1376 Label* pTypeLabel = new (std::nothrow) Label();
1377 pTypeLabel->Construct(Rectangle((itemWidth - W_TEXT_MARGIN - W_TYPE), Y_ITEM_TITLE + H_ITEM_TITLE + (H_ADDITIONAL_ITEM * i), W_TYPE, H_ITEM_VALUE), type);
1378 pTypeLabel->SetTextHorizontalAlignment(ALIGNMENT_RIGHT);
1379 pTypeLabel->SetTextVerticalAlignment(ALIGNMENT_MIDDLE);
1380 pTypeLabel->SetTextConfig(FONT_SIZE_SUB_TEXT, LABEL_TEXT_STYLE_BOLD);
1381 pTypeLabel->SetTextColor(COLOR_ITEM_TYPE);
1382 pItem->AddControl(*pTypeLabel);
1384 valueWidth = itemWidth - (W_TEXT_MARGIN * 2) - W_TYPE;
1387 Label* pValueLabel = new (std::nothrow) Label();
1388 pValueLabel->Construct(Rectangle(W_TEXT_MARGIN, Y_ITEM_TITLE + H_ITEM_TITLE + (H_ADDITIONAL_ITEM * i), valueWidth, H_ITEM_VALUE), value);
1389 pValueLabel->SetTextHorizontalAlignment(ALIGNMENT_LEFT);
1390 pValueLabel->SetTextVerticalAlignment(ALIGNMENT_MIDDLE);
1391 pValueLabel->SetTextConfig(FONT_SIZE_MAIN_TEXT, LABEL_TEXT_STYLE_NORMAL);
1392 pValueLabel->SetTextColor(COLOR_ITEM_VALUE);
1393 pItem->AddControl(*pValueLabel);
1398 ContactDetailsForm::OnTableViewItemStateChanged(Tizen::Ui::Controls::TableView& tableView, int itemIndex, Tizen::Ui::Controls::TableViewItem* pItem, Tizen::Ui::Controls::TableViewItemStatus status)
1400 SceneManager* pSceneManager = SceneManager::GetInstance();
1402 if (status == TABLE_VIEW_ITEM_STATUS_SELECTED)
1404 String itemName = pItem->GetName();
1406 if (itemName.Equals(Integer::ToString(DETAIL_PROPERTY_GROUP), true) == true)
1408 if (__appControlViewType.Equals(VALUE_VIEW_TYPE_VCF, false) == true)
1413 if (__pPresentationModel->GetCategoryCount() > 0)
1415 IList* pCategoryList = __pPresentationModel->GetAssignedCategoryIdListN();
1417 pSceneManager->GoForward(ForwardSceneTransition(IDSCN_GROUP_SELECTOR, SCENE_TRANSITION_ANIMATION_TYPE_LEFT), pCategoryList);
1421 pSceneManager->GoForward(ForwardSceneTransition(IDSCN_GROUP_EDITOR, SCENE_TRANSITION_ANIMATION_TYPE_LEFT));
1424 else if (itemName.Equals(Integer::ToString(DETAIL_PROPERTY_RINGTONE), true) == true)
1426 if (__appControlViewType.Equals(VALUE_VIEW_TYPE_VCF, false) == true)
1431 result r = LaunchAppControl(PROVIDER_ID_FILEMANAGER, OPERATION_ID_PICK);
1432 TryReturnVoid(r == E_SUCCESS, "[%s] Unable to launch appcontrol", GetErrorMessage(r));
1434 else if (itemName.IsEmpty() == false)
1437 itemPoint.x = GetClientAreaBounds().width / 2;
1438 itemPoint.y = GetClientAreaBounds().y + pItem->GetY() + (pItem->GetHeight() / 2) - __scrolledDistance;
1440 __pContextMenuCall->SetName(itemName);
1441 __pContextMenuCall->SetAnchorPosition(itemPoint);
1442 __pContextMenuCall->SetShowState(true);
1443 __pContextMenuCall->Show();
1449 ContactDetailsForm::OnTableViewContextItemActivationStateChanged(Tizen::Ui::Controls::TableView& tableView, int itemIndex, Tizen::Ui::Controls::TableViewContextItem* pContextItem, bool activated)
1454 ContactDetailsForm::OnTableViewItemReordered(Tizen::Ui::Controls::TableView& tableView, int itemIndexFrom, int itemIndexTo)
1459 ContactDetailsForm::OnTouchPressed(const Tizen::Ui::Control& source, const Tizen::Graphics::Point& currentPosition, const Tizen::Ui::TouchEventInfo & touchInfo)
1464 ContactDetailsForm::OnTouchReleased(const Tizen::Ui::Control& source, const Tizen::Graphics::Point& currentPosition, const Tizen::Ui::TouchEventInfo& touchInfo)
1466 if (source.GetName().Equals(FAVORITE_LABEL, true))
1468 Label* pLabel = static_cast<Label*>(&const_cast<Control&>(source));
1474 __pPresentationModel->SetAsFavorite(!__pPresentationModel->IsFavorite());
1476 Bitmap* pBitmap = null;
1477 if (__pPresentationModel->IsFavorite())
1479 pBitmap = ResourceManager::GetBitmapN(IDB_DETAILS_FAVORITE_ON);
1483 pBitmap = ResourceManager::GetBitmapN(IDB_DETAILS_FAVORITE_OFF);
1486 if (pBitmap != null)
1488 pLabel->SetBackgroundBitmap(*pBitmap);
1491 pLabel->Invalidate(false);
1496 ContactDetailsForm::OnTouchMoved(const Tizen::Ui::Control& source, const Tizen::Graphics::Point& currentPosition, const Tizen::Ui::TouchEventInfo& touchInfo)
1501 ContactDetailsForm::OnTouchFocusIn(const Tizen::Ui::Control& source, const Tizen::Graphics::Point& currentPosition, const Tizen::Ui::TouchEventInfo& touchInfo)
1506 ContactDetailsForm::OnTouchFocusOut(const Tizen::Ui::Control& source, const Tizen::Graphics::Point& currentPosition, const Tizen::Ui::TouchEventInfo& touchInfo)
1511 ContactDetailsForm::OnTouchCanceled(const Tizen::Ui::Control& source, const Tizen::Graphics::Point& currentPosition, const Tizen::Ui::TouchEventInfo& touchInfo)
1516 ContactDetailsForm::OnScrollEndReached (Tizen::Ui::Control &source, Tizen::Ui::Controls::ScrollEndEvent type)
1521 ContactDetailsForm::OnScrollPositionChanged (Tizen::Ui::Control &source, int scrollPos)
1523 __scrolledDistance = scrollPos;
1527 ContactDetailsForm::OnScrollStopped (Tizen::Ui::Control &source)
1532 ContactDetailsForm::OnContactsChanged(void)
1534 if (__pPresentationModel->IsContactRemoved())
1536 if (__appControlViewType.IsEmpty() == true)
1538 SceneManager* pSceneManager = SceneManager::GetInstance();
1540 result r = pSceneManager->GoBackward(BackwardSceneTransition(SCENE_TRANSITION_ANIMATION_TYPE_RIGHT));
1541 TryReturnVoid(r == E_SUCCESS, "[%s] Unable to go backward", GetErrorMessage(r));
1545 UiApp::GetInstance()->Terminate();
1550 ContactsApp* pContactsApp = static_cast<ContactsApp*>(ContactsApp::GetInstance());
1551 TryReturnVoid(pContactsApp != null, "Unable to get ContactsApp instance.");
1553 if (pContactsApp->GetAppUiState() == APP_UI_STATE_BACKGROUND)
1555 __pTableView->UpdateTableView();
1559 delete __pDefaultSelectorPopup;
1560 __pDefaultSelectorPopup = null;
1564 ContactDetailsForm::OnCategoriesChanged(void)
1569 ContactDetailsForm::LaunchAppControl(const Tizen::App::AppId& appId, const Tizen::Base::String& operationId, const Tizen::Base::String& launchType, const Tizen::Base::String& value)
1571 result r = E_SUCCESS;
1573 if (__pAppControl != null)
1581 extraData.Construct();
1582 IAppControlResponseListener* pEvent = null;
1584 if (appId.Equals(String(PROVIDER_ID_PHONE)) && operationId.Equals(String(OPERATION_ID_CALL)))
1586 uri.Append(INPUT_URI_TEL);
1588 if (value.IsEmpty())
1590 uri.Append(__pPresentationModel->GetValue(DETAIL_PROPERTY_DEFAULT_PHONE_NUMBER));
1597 extraData.Add(new (std::nothrow) String(INPUT_KEY_CALL_TYPE), new (std::nothrow) String(launchType));
1599 else if (appId.Equals(String(PROVIDER_ID_MESSAGE)) && operationId.Equals(String(OPERATION_ID_COMPOSE)))
1601 String recipientAddress;
1603 if (value.IsEmpty())
1605 recipientAddress.Append(__pPresentationModel->GetValue(DETAIL_PROPERTY_DEFAULT_PHONE_NUMBER));
1609 recipientAddress.Append(value);
1611 extraData.Add(new (std::nothrow) String(INPUT_KEY_MESSAGE_TO), new (std::nothrow) String(recipientAddress));
1612 extraData.Add(new (std::nothrow) String(INPUT_KEY_MESSAGE_TYPE), new (std::nothrow) String(INPUT_TYPE_SMS));
1614 else if (appId.Equals(String(PROVIDER_ID_FILEMANAGER)) && operationId.Equals(String(OPERATION_ID_PICK)))
1616 mimeType.Append(INPUT_MIME_TYPE_AUDIO);
1617 extraData.Add(new (std::nothrow) String(INPUT_KEY_SELECTION_MODE), new (std::nothrow) String(INPUT_DATA_SELECTION_MODE_SINGLE));
1621 else if (appId.Equals(String(PROVIDER_ID_EMAIL)) && operationId.Equals(String(OPERATION_ID_COMPOSE)))
1623 ArrayList* pArgList = new (std::nothrow) ArrayList();
1624 pArgList->Construct();
1626 pArgList->Add(new (std::nothrow) String(__pPresentationModel->GetValue(DETAIL_PROPERTY_EMAIL, 0)));
1627 extraData.Add(new (std::nothrow) String(INPUT_KEY_MESSAGE_TO), pArgList);
1630 __pAppControl = AppManager::FindAppControlN(appId, operationId);
1631 if (__pAppControl != null)
1633 r = __pAppControl->Start(&uri, &mimeType, &extraData, pEvent);
1634 TryCatch(r == E_SUCCESS, , "[%s] Unable to launch app control", GetErrorMessage(r));
1636 if (operationId.Equals(String(OPERATION_ID_PICK)))
1644 extraData.RemoveAll(true);
1650 ContactDetailsForm::OnAppControlCompleteResponseReceived(const Tizen::App::AppId& appId, const Tizen::Base::String& operationId, Tizen::App::AppCtrlResult appControlResult, const Tizen::Base::Collection::IMap* pExtraData)
1652 AppLogDebug("ENTER");
1657 if (pExtraData == null)
1662 if (appId.Equals(String(PROVIDER_ID_FILEMANAGER)) && operationId.Equals(String(OPERATION_ID_PICK)))
1664 if (appControlResult == APP_CTRL_RESULT_SUCCEEDED)
1666 const String *pResultString = null;
1667 const ArrayList* pResultList = dynamic_cast<const ArrayList*>(pExtraData->GetValue(String(OUTPUT_KEY_SELECTED)));
1668 if (pResultList != null)
1670 pResultString = static_cast<const String*>(pResultList->GetAt(0));
1674 pResultString = static_cast<const String*>(pExtraData->GetValue(String(OUTPUT_KEY_SELECTED)));
1677 if (pResultString != null && pResultString->IsEmpty() == false)
1679 __pPresentationModel->SetValue(DETAIL_PROPERTY_RINGTONE, *pResultString);
1680 __pPresentationModel->UpdateContact();
1681 __pTableView->RefreshItem(__pItemList->GetCount() - 1, TABLE_VIEW_REFRESH_TYPE_ITEM_MODIFY);
1686 AppLogDebug("EXIT");
1690 ContactDetailsForm::AddGroupStylePanel(int itemWidth, Tizen::Ui::Controls::TableViewItem* pItem, Tizen::Ui::Controls::GroupStyle groupStyle)
1692 Panel* pGroupStyle = new (std::nothrow) Panel();
1693 pGroupStyle->Construct(Rectangle(W_GROUP_STYLE_MARGIN, 0, itemWidth - W_GROUP_STYLE_MARGIN * 2, H_ITEM_DOUBLE_LINE), groupStyle);
1694 pGroupStyle->SetBackgroundColor(COLOR_GROUP_STYLE);
1695 pItem->AddControl(*pGroupStyle);
1699 ContactDetailsForm::ParseAppControlArgument(const Tizen::Base::String& argument, Tizen::Base::String& type, Tizen::Base::String& content)
1701 result r = E_SUCCESS;
1703 if (argument.IsEmpty() || argument.Contains(DELIMITER) == false)
1708 StringTokenizer stringToken(argument, DELIMITER);
1710 r = stringToken.GetNextToken(type);
1711 TryReturn(r == E_SUCCESS, r, "[%s] Unable to get type", GetErrorMessage(r));
1713 r = stringToken.GetNextToken(content);
1714 TryReturn(r == E_SUCCESS, r, "[%s] Unable to get content", GetErrorMessage(r));
1720 ContactDetailsForm::ShowDefaultSelectorPopup(void)
1722 ArrayList* pList = new (std::nothrow) ArrayList();
1725 String numberWithType;
1726 int numberCount = __pPresentationModel->GetMultiValuesCount(DETAIL_PROPERTY_PHONE_NUMBER);
1727 for (int index = 0; index < numberCount; index++)
1729 numberWithType = __pPresentationModel->GetType(DETAIL_PROPERTY_PHONE_NUMBER, index) + L" ";
1730 numberWithType += __pPresentationModel->GetValue(DETAIL_PROPERTY_PHONE_NUMBER, index);
1732 pList->Add(*(new (std::nothrow) String(numberWithType)));
1734 ContactValueListItemProvider* pProvider = new (std::nothrow) ContactValueListItemProvider(pList);
1736 delete __pDefaultSelectorPopup;
1737 __pDefaultSelectorPopup = new (std::nothrow) Popup();
1738 __pDefaultSelectorPopup->Construct(true, Dimension(W_POPUP, H_POPUP));
1739 __pDefaultSelectorPopup->SetTitleText(ResourceManager::GetString(L"IDS_PB_BODY_MARK_AS_DEFAULT_NUMBER"));
1741 Rectangle popupClientBounds = __pDefaultSelectorPopup->GetClientAreaBounds();
1743 ListView* pOtherNumberList = new (std::nothrow) ListView();
1744 pOtherNumberList->Construct(Rectangle(0, 0, popupClientBounds.width, H_POPUP_LIST_VIEW));
1745 pOtherNumberList->AddListViewItemEventListener(*this);
1746 pOtherNumberList->SetItemProvider(*pProvider);
1748 __pDefaultSelectorPopup->AddControl(*pOtherNumberList);
1750 Button* pCloseButton = new (std::nothrow) Button();
1751 pCloseButton->Construct(Rectangle((popupClientBounds.width - W_POPUP_BUTTON) / 2, Y_POPUP_BUTTON,
1752 W_POPUP_BUTTON, H_POPUP_BUTTON), ResourceManager::GetString(L"IDS_COM_POP_CLOSE"));
1753 pCloseButton->SetActionId(IDA_POPUP_CLOSE);
1754 pCloseButton->AddActionEventListener(*this);
1756 __pDefaultSelectorPopup->AddControl(*pCloseButton);
1757 __pDefaultSelectorPopup->SetShowState(true);
1758 __pDefaultSelectorPopup->Show();
1762 ContactDetailsForm::HideDefaultSelectorPopup(void)
1764 __pDefaultSelectorPopup->SetShowState(false);
1770 ContactDetailsForm::ShowInvalidFilePopup(void)
1772 if (__pInvalidFilePopup != null)
1774 delete __pInvalidFilePopup;
1777 __pInvalidFilePopup = new (std::nothrow) Popup();
1778 __pInvalidFilePopup->Construct(false, Dimension(W_POPUP, H_INVALID_FILE_POPUP));
1780 Rectangle clientBounds = __pInvalidFilePopup->GetClientAreaBounds();
1782 Label* pLabelText = new (std::nothrow) Label();
1783 pLabelText->Construct(Rectangle(0, Y_POPUP_TEXT_LABEL, clientBounds.width, H_POPUP_TEXT_LABEL), ResourceManager::GetString(L"IDS_RSSR_BODY_INVALID_FORMAT"));
1784 pLabelText->SetTextColor(COLOR_POPUP_TEXT);
1785 pLabelText->SetTextConfig(FONT_SIZE_POPUP_TEXT, LABEL_TEXT_STYLE_BOLD);
1786 pLabelText->SetTextHorizontalAlignment(ALIGNMENT_CENTER);
1788 __pInvalidFilePopup->AddControl(*pLabelText);
1790 Button* pButtonClose = new (std::nothrow) Button();
1791 pButtonClose->Construct(Rectangle((clientBounds.width - W_POPUP_BUTTON) / 2, pLabelText->GetY() + pLabelText->GetHeight(), W_POPUP_BUTTON, H_POPUP_BUTTON));
1792 pButtonClose->SetText(ResourceManager::GetString("IDS_COM_SK_OK"));
1793 pButtonClose->SetActionId(IDA_INVALID_FILE_POPUP_CLOSE);
1794 pButtonClose->AddActionEventListener(*this);
1796 __pInvalidFilePopup->AddControl(*pButtonClose);
1798 __pInvalidFilePopup->Show();
1802 ContactDetailsForm::OnListViewItemStateChanged(Tizen::Ui::Controls::ListView& listView, int index, int elementId, Tizen::Ui::Controls::ListItemStatus status)
1804 __pPresentationModel->SetValue(DETAIL_PROPERTY_DEFAULT_PHONE_NUMBER, L"", index);
1805 __pPresentationModel->AddAddressBook();
1806 InitializeDetailItemList();
1807 __pTableView->UpdateTableView();
1809 HideDefaultSelectorPopup();
1813 ContactDetailsForm::OnListViewItemSwept(Tizen::Ui::Controls::ListView& listView, int index, Tizen::Ui::Controls::SweepDirection direction)
1818 ContactDetailsForm::OnListViewContextItemStateChanged(Tizen::Ui::Controls::ListView& listView, int index, int elementId, Tizen::Ui::Controls::ListContextItemStatus status)
1823 ContactDetailsForm::OnForeground(void)
1825 if (IsEnabled() == false)
1831 delete __pAppControl;
1832 __pAppControl = null;
1836 ContactDetailsForm::OnBackground(void)