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 CtContactsApp.cpp
19 * @brief This is the implementation file for the ContactsApp class.
23 #include "CtContactsApp.h"
24 #include "CtContactListPresentationModel.h"
25 #include "CtGroupContactListPresentationModel.h"
26 #include "CtGroupListPresentationModel.h"
27 #include "CtIContactsAppStateChangeEventListener.h"
28 #include "CtMainFrame.h"
29 #include "CtResourceManager.h"
32 using namespace Tizen::App;
33 using namespace Tizen::Base;
34 using namespace Tizen::Base::Collection;
35 using namespace Tizen::Base::Utility;
36 using namespace Tizen::Io;
37 using namespace Tizen::System;
38 using namespace Tizen::Ui;
39 using namespace Tizen::Ui::Controls;
41 static const wchar_t* SELECTION_MODE = L"selectionMode";
42 static const wchar_t* SELECTION_MODE_SINGLE = L"single";
43 static const wchar_t* SELECTION_MODE_MULTIPLE = L"multiple";
44 static const wchar_t* RETURN_TYPE = L"returnType";
45 static const wchar_t* PHONE = L"phone";
46 static const wchar_t* EMAIL = L"email";
47 static const wchar_t* URL = L"url";
48 static const wchar_t* VIEW_TYPE = L"viewType";
49 static const wchar_t* CONTACT_ID = L"contactId";
50 static const wchar_t* PATH = L"path";
51 static const wchar_t* VALUE_VIEW_TYPE_CONTACT = L"contact";
52 static const wchar_t* VALUE_VIEW_TYPE_VCF = L"vcf";
53 static const wchar_t* VIEW_MIME_TYPE_VCF = L"text/vcard";
54 static const wchar_t* VIEW_URI_VCF_PREFIX = L"file:///";
56 static const wchar_t* FONT_SIZE_STR_NORMAL = L"medium";
58 static const int LIST_ITEM_SINGLE_LINE_NORMAL_HEIGHT = 112;
59 static const int FONT_SIZE_NORMAL = 44;
61 ContactsApp::ContactsApp(void)
62 : __initialSceneId(IDSCN_CONTACT_LIST)
65 , __selectionMode(APP_CONTROL_SELECTION_MODE_NONE)
66 , __returnType(APP_CONTROL_RETURN_TYPE_NONE)
69 __listenerList.Construct();
72 ContactsApp::~ContactsApp(void)
77 ContactsApp::CreateInstance(void)
79 static ContactsApp* pContactsAppInstance = null;
80 if (pContactsAppInstance == null)
82 pContactsAppInstance = new (std::nothrow) ContactsApp();
85 return pContactsAppInstance;
89 ContactsApp::OnAppInitializing(Tizen::App::AppRegistry& appRegistry)
91 AppControlProviderManager* pProviderManager = AppControlProviderManager::GetInstance();
92 result r = pProviderManager->SetAppControlProviderEventListener(this);
93 TryReturn(r == E_SUCCESS, false, "[%s] Failed to set AppControlProviderEventListener", GetErrorMessage(r));
95 r = SettingInfo::AddSettingEventListener(*this);
98 AppLogDebug("[%s] Failed to add SettingEventListener", GetErrorMessage(r));
105 ContactsApp::OnAppInitialized(void)
107 InitializeFontSize();
109 MainFrame* pContactFrame = new (std::nothrow) MainFrame();
110 pContactFrame->Construct();
111 pContactFrame->SetName(ResourceManager::GetString(L"IDS_COM_BODY_CONTACTS"));
112 AddFrame(*pContactFrame);
118 ContactsApp::OnAppWillTerminate(void)
124 ContactsApp::OnAppTerminating(Tizen::App::AppRegistry& appRegistry, bool forcedTermination)
126 result r = SettingInfo::RemoveSettingEventListener(*this);
129 AppLogDebug("[%s] Failed to remove SettingEventListener", GetErrorMessage(r));
136 ContactsApp::OnForeground(void)
138 IEnumerator* pEnum = __listenerList.GetEnumeratorN();
140 while (pEnum->MoveNext() == E_SUCCESS)
142 IContactsAppStateChangeEventListener* pInterface = static_cast<IContactsAppStateChangeEventListener*>(pEnum->GetCurrent());
143 if (pInterface == null)
149 pInterface->OnForeground();
155 ContactsApp::OnBackground(void)
157 IEnumerator* pEnum = __listenerList.GetEnumeratorN();
158 while (pEnum->MoveNext() == E_SUCCESS)
160 IContactsAppStateChangeEventListener* pInterface = static_cast<IContactsAppStateChangeEventListener*>(pEnum->GetCurrent());
161 if (pInterface == null)
167 pInterface->OnBackground();
173 ContactsApp::OnLowMemory(void)
178 ContactsApp::OnBatteryLevelChanged(Tizen::System::BatteryLevel batteryLevel)
183 ContactsApp::OnScreenOn(void)
188 ContactsApp::OnScreenOff(void)
193 ContactsApp::OnAppCheckpointing(Tizen::App::AppRegistry& appRegistry)
198 ContactsApp::OnSettingChanged(Tizen::Base::String& key)
200 if (key.Equals(SETTING_KEY_LANGUAGE, false) == true || key.Equals(SETTING_KEY_COUNTRY, false) == true || key.Equals(SETTING_KEY_FONTSIZE, false) == true)
202 if (__operationId.Equals(OPERATION_ID_PICK, true))
204 result r = AppControlProviderManager::GetInstance()->SendAppControlResult(__requestId, APP_CTRL_RESULT_TERMINATED, null);
205 TryReturnVoid(r == E_SUCCESS, "[%s] Unable to return result.", GetErrorMessage(r));
212 ContactsApp::OnAppControlRequestReceived(RequestId reqId, const Tizen::Base::String& operationId, const Tizen::Base::String* pUriData,
213 const Tizen::Base::String* pMimeType, const Tizen::Base::Collection::IMap* pExtraData)
215 AppLogDebug("reqId : %ld, operationId : %ls", reqId, operationId.GetPointer());
217 if (pExtraData != null)
219 IMapEnumerator* pEnum = pExtraData->GetMapEnumeratorN();
220 while (pEnum->MoveNext() == E_SUCCESS)
222 String* pKey = static_cast<String*>(pEnum->GetKey());
223 String* pValue = static_cast<String*>(pEnum->GetValue());
225 AppLogDebug("extraData : %ls:%ls", pKey->GetPointer(), pValue->GetPointer());
230 result r = E_SUCCESS;
232 ArrayList* pArgs = new (std::nothrow) ArrayList();
235 if (operationId.Equals(CONTACT_OPERATION_ID_MAIN, true))
239 else if (operationId.Equals(CONTACT_OPERATION_ID_PICK, true))
241 if (pExtraData == null)
243 AppLogDebug("To launch AppControl by the pick operation, the (key,value) pairs should be input.");
244 r = AppControlProviderManager::GetInstance()->SendAppControlResult(reqId, APP_CTRL_RESULT_FAILED, null);
245 AppLogDebug("[%s] The return result from SendAppControlResult().", GetErrorMessage(r));
252 const String* pItemType = static_cast<const String*>(pExtraData->GetValue(String(CONTACT_KEY_ITEM_TYPE)));
253 if (pItemType == null || pItemType->Equals(ITEM_TYPE_PERSON, true) == false)
255 AppLogDebug("To launch AppControl by the pick operation, the item type should be input.");
256 r = AppControlProviderManager::GetInstance()->SendAppControlResult(reqId, APP_CTRL_RESULT_FAILED, null);
257 AppLogDebug("[%s] The return result from SendAppControlResult().", GetErrorMessage(r));
264 const String* pValue = null;
266 pValue = static_cast<const String*>(pExtraData->GetValue(String(CONTACT_KEY_SELECTION_MODE)));
267 if (pValue == null || pValue->GetPointer() == null)
269 AppLogDebug("To launch AppControl by the pick operation, the selection mode should be input.");
270 r = AppControlProviderManager::GetInstance()->SendAppControlResult(reqId, APP_CTRL_RESULT_FAILED, null);
271 AppLogDebug("[%s] The return result from SendAppControlResult().", GetErrorMessage(r));
278 String* pSelectionMode = new (std::nothrow) String(SELECTION_MODE);
279 pSelectionMode->Append(DELIMITER);
280 pSelectionMode->Append(*pValue);
281 pArgs->Add(pSelectionMode);
283 pValue = static_cast<const String*>(pExtraData->GetValue(String(CONTACT_KEY_RESULT_TYPE)));
284 if (pValue == null || pValue->GetPointer() == null)
286 AppLogDebug("To launch AppControl by the pick operation, the selection mode should be input.");
287 r = AppControlProviderManager::GetInstance()->SendAppControlResult(reqId, APP_CTRL_RESULT_FAILED, null);
288 AppLogDebug("[%s] The return result from SendAppControlResult().", GetErrorMessage(r));
294 String* pReturnType = new (std::nothrow) String(RETURN_TYPE);
295 pReturnType->Append(DELIMITER);
296 pReturnType->Append(*pValue);
297 pArgs->Add(pReturnType);
299 r = InitializeAppControl(pArgs);
302 AppLogDebug("[%s] initializing app control failed", GetErrorMessage(r));
303 r = AppControlProviderManager::GetInstance()->SendAppControlResult(reqId, APP_CTRL_RESULT_FAILED, null);
304 AppLogDebug("[%s] The return result from SendAppControlResult().", GetErrorMessage(r));
311 if (__selectionMode == APP_CONTROL_SELECTION_MODE_SINGLE)
313 __initialSceneId = IDSCN_CONTACT_LIST;
315 else if (__selectionMode == APP_CONTROL_SELECTION_MODE_MULTI)
317 __initialSceneId = IDSCN_CONTACT_LIST_EDITOR;
319 __operationId = OPERATION_ID_PICK;
321 else if (operationId.Equals(CONTACT_OPERATION_ID_ADD, true))
323 if (pExtraData == null)
325 AppLogDebug("To launch AppControl by the add operation, the (key,value) pairs should be input.");
326 r = AppControlProviderManager::GetInstance()->SendAppControlResult(reqId, APP_CTRL_RESULT_FAILED, null);
327 AppLogDebug("[%s] The return result from SendAppControlResult().", GetErrorMessage(r));
334 const String* pItemType = static_cast<const String*>(pExtraData->GetValue(String(CONTACT_KEY_ITEM_TYPE)));
335 if (pItemType == null || pItemType->Equals(ITEM_TYPE_CONTACT, true) == false)
337 AppLogDebug("To launch AppControl by the add operation, the item type should be input.");
338 r = AppControlProviderManager::GetInstance()->SendAppControlResult(reqId, APP_CTRL_RESULT_FAILED, null);
339 AppLogDebug("[%s] The return result from SendAppControlResult().", GetErrorMessage(r));
347 const String* pValue = null;
349 pValue = static_cast<const String*>(pExtraData->GetValue(String(CONTACT_KEY_PHONE)));
350 if (pValue && pValue->GetPointer())
352 pKey = new (std::nothrow) String(PHONE);
353 pKey->Append(DELIMITER);
354 pKey->Append(*pValue);
358 pValue = static_cast<const String*>(pExtraData->GetValue(String(CONTACT_KEY_EMAIL)));
359 if (pValue && pValue->GetPointer())
361 pKey = new (std::nothrow) String(EMAIL);
362 pKey->Append(DELIMITER);
363 pKey->Append(*pValue);
367 pValue = static_cast<const String*>(pExtraData->GetValue(String(CONTACT_KEY_URL)));
368 if (pValue && pValue->GetPointer())
370 pKey = new (std::nothrow) String(URL);
371 pKey->Append(DELIMITER);
372 pKey->Append(*pValue);
376 __initialSceneId = IDSCN_CONTACT_EDITOR;
377 __operationId = OPERATION_ID_ADD;
379 else if (operationId.Equals(CONTACT_OPERATION_ID_EDIT, true))
381 if (pExtraData == null)
383 AppLogDebug("To launch AppControl by the edit operation, the (key,value) pairs should be input.");
389 const String* pItemType = static_cast<const String*>(pExtraData->GetValue(String(CONTACT_KEY_ITEM_TYPE)));
390 if (pItemType == null || pItemType->Equals(ITEM_TYPE_PERSON, true) == false)
392 AppLogDebug("To launch AppControl by the edit operation, the item type should be input.");
393 r = AppControlProviderManager::GetInstance()->SendAppControlResult(reqId, APP_CTRL_RESULT_FAILED, null);
394 AppLogDebug("[%s] The return result from SendAppControlResult().", GetErrorMessage(r));
402 const String* pValue = null;
404 pValue = static_cast<const String*>(pExtraData->GetValue(String(CONTACT_KEY_ITEM_ID)));
405 if (pValue == null || pValue->GetPointer() == null)
407 AppLogDebug("To launch AppControl by the edit operation, the item_id should be input.");
408 r = AppControlProviderManager::GetInstance()->SendAppControlResult(reqId, APP_CTRL_RESULT_FAILED, null);
409 AppLogDebug("[%s] The return result from SendAppControlResult().", GetErrorMessage(r));
416 pKey = new (std::nothrow) String(RETURN_TYPE_ITEM_ID);
417 pKey->Append(DELIMITER);
418 pKey->Append(*pValue);
421 pValue = static_cast<const String*>(pExtraData->GetValue(String(CONTACT_KEY_PHONE)));
422 if (pValue && pValue->GetPointer())
424 pKey = new (std::nothrow) String(PHONE);
425 pKey->Append(DELIMITER);
426 pKey->Append(*pValue);
430 pValue = static_cast<const String*>(pExtraData->GetValue(String(CONTACT_KEY_EMAIL)));
431 if (pValue && pValue->GetPointer())
433 pKey = new (std::nothrow) String(EMAIL);
434 pKey->Append(DELIMITER);
435 pKey->Append(*pValue);
439 pValue = static_cast<const String*>(pExtraData->GetValue(String(CONTACT_KEY_URL)));
440 if (pValue && pValue->GetPointer())
442 pKey = new (std::nothrow) String(URL);
443 pKey->Append(DELIMITER);
444 pKey->Append(*pValue);
448 __initialSceneId = IDSCN_CONTACT_EDITOR;
449 __operationId = OPERATION_ID_EDIT;
451 else if (operationId.Equals(CONTACT_OPERATION_ID_CHOOSE, true))
453 if (pExtraData == null)
455 AppLogDebug("To launch AppControl by the choose operation, the (key,value) pairs should be input.");
461 const String* pItemType = static_cast<const String*>(pExtraData->GetValue(String(CONTACT_KEY_ITEM_TYPE)));
462 if (pItemType == null || pItemType->Equals(ITEM_TYPE_PERSON, true) == false)
464 AppLogDebug("To launch AppControl by the edit operation, the item type should be input.");
465 r = AppControlProviderManager::GetInstance()->SendAppControlResult(reqId, APP_CTRL_RESULT_FAILED, null);
466 AppLogDebug("[%s] The return result from SendAppControlResult().", GetErrorMessage(r));
474 const String* pValue = null;
476 pValue = static_cast<const String*>(pExtraData->GetValue(String(CONTACT_KEY_PHONE)));
477 if (pValue && pValue->GetPointer())
479 pKey = new (std::nothrow) String(PHONE);
480 pKey->Append(DELIMITER);
481 pKey->Append(*pValue);
485 pValue = static_cast<const String*>(pExtraData->GetValue(String(CONTACT_KEY_EMAIL)));
486 if (pValue && pValue->GetPointer())
488 pKey = new (std::nothrow) String(EMAIL);
489 pKey->Append(DELIMITER);
490 pKey->Append(*pValue);
494 pValue = static_cast<const String*>(pExtraData->GetValue(String(CONTACT_KEY_URL)));
495 if (pValue && pValue->GetPointer())
497 pKey = new (std::nothrow) String(URL);
498 pKey->Append(DELIMITER);
499 pKey->Append(*pValue);
503 __initialSceneId = IDSCN_CONTACT_LIST;
504 __operationId = OPERATION_ID_EDIT;
506 else if (operationId.Equals(CONTACT_OPERATION_ID_VIEW, true))
508 String* pErrorType = null;
509 if (pExtraData == null)
511 AppLogDebug("To launch AppControl by the view operation, the (key,value) pairs should be input.");
517 const String* pItemType = static_cast<const String*>(pExtraData->GetValue(String(CONTACT_KEY_ITEM_TYPE)));
518 if (pItemType == null || pItemType->Equals(ITEM_TYPE_PERSON, true) == false)
520 AppLogDebug("To launch AppControl by the view operation, the item type should be input.");
521 pErrorType = new (std::nothrow) String(ResourceManager::GetString(L"IDS_RSSR_BODY_INVALID_FORMAT"));
524 String* pViewType = new (std::nothrow) String(VIEW_TYPE);
525 pViewType->Append(DELIMITER);
526 pViewType->Append(VALUE_VIEW_TYPE_CONTACT);
527 pArgs->Add(pViewType);
529 const String* pValue = static_cast<const String*>(pExtraData->GetValue(String(CONTACT_KEY_ITEM_ID)));
530 if (pValue == null || pValue->GetPointer() == null)
532 AppLogDebug("To launch AppControl by the view operation, the itemId should be input.");
533 if (pErrorType == null)
535 pErrorType = new (std::nothrow) String(ResourceManager::GetString(L"IDS_RSSR_BODY_INVALID_FORMAT"));
539 String* pKey = new (std::nothrow) String(CONTACT_ID);
540 pKey->Append(DELIMITER);
543 pKey->Append(*pValue);
546 pArgs->Add(pErrorType);
548 __initialSceneId = IDSCN_CONTACT_DETAILS;
549 __operationId = OPERATION_ID_VIEW;
551 else if (operationId.Equals(OPERATION_ID_VIEW, true))
553 String* pErrorType = null;
554 String vcfPrefix(VIEW_URI_VCF_PREFIX);
558 if (pUriData == null)
560 AppLogDebug("To launch AppControl by the view operation, the uri data should be input.");
561 pErrorType = new (std::nothrow) String(ResourceManager::GetString(L"IDS_RSSR_BODY_INVALID_FORMAT"));
565 if (pMimeType != null)
567 mimeType.Append(*pMimeType);
570 if (pUriData->StartsWith(vcfPrefix, 0))
572 pUriData->SubString(vcfPrefix.GetLength() - 1, pUriData->GetLength() - vcfPrefix.GetLength() + 1, path);
574 mimeType.Append(VIEW_MIME_TYPE_VCF);
578 path.Append(*pUriData);
581 if (mimeType.Equals(VIEW_MIME_TYPE_VCF, true) == false)
583 AppLogDebug("The MIME type is wrong.");
584 pErrorType = new (std::nothrow) String(ResourceManager::GetString(L"IDS_RSSR_BODY_INVALID_FORMAT"));
586 else if (File::IsFileExist(path) == false)
588 AppLogDebug("The vcf file does not exist.");
589 pErrorType = new (std::nothrow) String(ResourceManager::GetString(L"IDS_MP_POP_INVALID_FILE"));
593 String* pViewType = new (std::nothrow) String(VIEW_TYPE);
594 pViewType->Append(DELIMITER);
595 pViewType->Append(VALUE_VIEW_TYPE_VCF);
597 pArgs->Add(pViewType);
599 String* pKey = new (std::nothrow) String(PATH);
600 pKey->Append(DELIMITER);
605 pArgs->Add(pErrorType);
607 __initialSceneId = IDSCN_CONTACT_DETAILS;
608 __operationId = OPERATION_ID_VIEW;
610 else if (operationId.Equals(OPERATION_ID_CONFIGURE, true))
612 __initialSceneId = IDSCN_SETTINGS;
613 __operationId = OPERATION_ID_CONFIGURE;
617 AppLogDebug("Invalid OperationId");
626 ContactsApp::InitializeAppControl(Tizen::Base::Collection::IList* pArgs)
628 TryReturn(pArgs != null, E_INVALID_ARG, "[E_INVALID_ARG] app control argument is invalid");
632 String* pArgString = static_cast<String*>(pArgs->GetAt(0));
633 TryReturn(pArgString, E_FAILURE, "[E_FAILURE] Unable to cast argument string");
634 result r = ParseAppControlArgument(*pArgString, key, value);
635 TryReturn(r == E_SUCCESS, r, "[%s] Unable to parse the argument", GetErrorMessage(r));
637 if (key.Equals(SELECTION_MODE, true))
639 if (value.Equals(SELECTION_MODE_SINGLE, true))
641 __selectionMode = APP_CONTROL_SELECTION_MODE_SINGLE;
643 else if (value.Equals(SELECTION_MODE_MULTIPLE, true))
645 __selectionMode = APP_CONTROL_SELECTION_MODE_MULTI;
649 AppLogDebug("selectionMode of AppControl[PICK] should be either single or multiple. [%ls] has been input", value.GetPointer());
654 pArgString = static_cast<String*>(pArgs->GetAt(1));
655 TryReturn(pArgString, E_FAILURE, "[E_FAILURE] Unable to cast argument string");
656 r = ParseAppControlArgument(*pArgString, key, value);
657 TryReturn(r == E_SUCCESS, r, "[%s] Unable to parse the argument", GetErrorMessage(r));
659 if (key.Equals(RETURN_TYPE, true))
661 if (value.Equals(RETURN_TYPE_PHONE, true))
663 __returnType = APP_CONTROL_RETURN_TYPE_PHONE;
665 else if (value.Equals(RETURN_TYPE_EMAIL, true))
667 __returnType = APP_CONTROL_RETURN_TYPE_EMAIL;
669 else if (value.Equals(RETURN_TYPE_ITEM_ID, true))
671 __returnType = APP_CONTROL_RETURN_TYPE_ITEM_ID;
673 else if (value.Equals(RETURN_TYPE_VCARD, true))
675 __returnType = APP_CONTROL_RETURN_TYPE_VCARD;
679 AppLogDebug("returnType of AppControl[PICK] should be one of {phone, email, contactId, and vcard}. [%ls] has been input", value.GetPointer());
684 if (__returnType == APP_CONTROL_RETURN_TYPE_VCARD && __selectionMode == APP_CONTROL_SELECTION_MODE_MULTI)
693 ContactsApp::ParseAppControlArgument(const Tizen::Base::String& argument, Tizen::Base::String& type, Tizen::Base::String& content)
695 result r = E_SUCCESS;
697 if (argument.IsEmpty() || argument.Contains(DELIMITER) == false)
702 StringTokenizer stringToken(argument, DELIMITER);
704 r = stringToken.GetNextToken(type);
705 TryReturn(r == E_SUCCESS, r, "[%s] Unable to get type", GetErrorMessage(r));
707 r = stringToken.GetNextToken(content);
708 TryReturn(r == E_SUCCESS, r, "[%s] Unable to get content", GetErrorMessage(r));
714 ContactsApp::GetOperationId(void)
716 return __operationId;
719 AppControlSelectionMode
720 ContactsApp::GetSelectionMode(void)
722 return __selectionMode;
726 ContactsApp::GetReturnType(void)
732 ContactsApp::GetRequestId(void)
737 Tizen::Ui::Scenes::SceneId
738 ContactsApp::GetInitialSceneId(void)
740 return __initialSceneId;
743 Tizen::Base::Collection::IList*
744 ContactsApp::GetArguments(void)
750 ContactsApp::InitializeFontSize(void)
752 String fontSizeStr = "";
753 SettingInfo::GetValue("http://tizen.org/setting/font.size", fontSizeStr);
754 __fontSize = Tizen::Ui::UiConfiguration::GetFontSize(fontSizeStr);
757 __fontSize = FONT_SIZE_NORMAL;
759 AppLogDebug("__fontSize = %d", __fontSize);
763 ContactsApp::GetFontSize(void)
769 ContactsApp::GetListItemSingleLineHeight(void)
771 int listItemHeight = LIST_ITEM_SINGLE_LINE_NORMAL_HEIGHT;
772 listItemHeight += (__fontSize - Tizen::Ui::UiConfiguration::GetFontSize(FONT_SIZE_STR_NORMAL));
773 return listItemHeight;
777 ContactsApp::GetFontHeightOffset(void)
779 return (__fontSize - Tizen::Ui::UiConfiguration::GetFontSize(FONT_SIZE_STR_NORMAL));
784 ContactsApp::AddContactsAppChangeEventListener(const IContactsAppStateChangeEventListener& listener)
786 __listenerList.Add(listener);
790 ContactsApp::RemoveContactsAppChangeEventListener(const IContactsAppStateChangeEventListener& listener)
792 __listenerList.Remove(listener);