#include <FBase.h>
#include <FIo.h>
#include <FUi.h>
+#include <FSystem.h>
#include "CtIContactEventListener.h"
#include "CtIContactsAppStateChangeEventListener.h"
, public Tizen::Ui::Controls::ITableViewItemEventListener
, public Tizen::Ui::Controls::ITableViewItemProvider
, public Tizen::Ui::Scenes::ISceneEventListener
+ , public Tizen::System::ISettingEventListener
, public IContactEventListener
, public IContactsAppStateChangeEventListener
, public Tizen::Ui::IKeyEventListener
virtual void OnKeyPressed(const Tizen::Ui::Control& source, Tizen::Ui::KeyCode keyCode);
virtual void OnKeyReleased(const Tizen::Ui::Control& source, Tizen::Ui::KeyCode keyCode);
virtual void OnKeyLongPressed(const Tizen::Ui::Control& source, Tizen::Ui::KeyCode keyCode);
+
+ virtual void OnSettingChanged(Tizen::Base::String &key);
private:
void InitializeDetailItemList(void);
result InitializeAppControl(Tizen::Base::Collection::IList* pArgs);
#include <FApp.h>
#include <FBase.h>
#include <FUi.h>
+#include <FSystem.h>
#include "CtContactValueListItemProvider.h"
#include "CtIContactEventListener.h"
#include "CtIContactsAppStateChangeEventListener.h"
, public Tizen::Ui::Controls::IFormMenuEventListener
, public Tizen::Ui::Controls::ISearchBarEventListener
, public Tizen::Ui::Scenes::ISceneEventListener
+ , public Tizen::System::ISettingEventListener
, public IContactEventListener
, public IContactsAppStateChangeEventListener
{
virtual bool OnPreviewKeyPressed(Tizen::Ui::Control& source, const Tizen::Ui::KeyEventInfo& keyEventInfo);
virtual bool OnPreviewKeyReleased(Tizen::Ui::Control& source, const Tizen::Ui::KeyEventInfo& keyEventInfo);
+ virtual void OnSettingChanged(Tizen::Base::String &key);
+
private:
void ShowDeletePopup(void);
void HideDeletePopup(void);
using namespace Tizen::Ui::Controls;
using namespace Tizen::Ui::Scenes;
using namespace Tizen::Social;
+using namespace Tizen::System;
static const int IDA_FOOTER_EDIT = 10;
static const int IDA_FOOTER_DELETE = 11;
TryReturnVoid(pContactsApp != null, "Unable to cast UiApp to ContactsApp");
pContactsApp->AddContactsAppChangeEventListener(*this);
+ SettingInfo::AddSettingEventListener(*this);
if (previousSceneId == IDSCN_GROUP_SELECTOR || previousSceneId == IDSCN_GROUP_EDITOR)
{
if (pContactsApp->GetOperationId() == OPERATION_ID_VIEW)
{
__pPresentationModel->RemoveContactChangeListener(*this);
+ SettingInfo::RemoveSettingEventListener(*this);
String *pError = static_cast<String*>(pArgs->GetAt(2));
if (pError != null)
{
ContactsApp* pContactsApp = static_cast<ContactsApp*>(ContactsApp::GetInstance());
pContactsApp->RemoveContactsAppChangeEventListener(*this);
+ SettingInfo::RemoveSettingEventListener(*this);
delete __pAppControl;
__pAppControl = null;
{
}
+
+void
+ContactDetailsForm::OnSettingChanged(Tizen::Base::String &key)
+{
+ ContactsApp* pContactsApp = static_cast<ContactsApp*>(ContactsApp::GetInstance());
+ TryReturnVoid(pContactsApp != null, "Unable to get ContactsApp instance.");
+
+ if(key == L"http://tizen.org/setting/contacts.order.firstname")
+ {
+ InitializeDetailItemList();
+ __pTableView->UpdateTableView();
+ }
+}
void
ContactEditorForm::OnKeypadClosed(Tizen::Ui::Control& source)
{
- if (__pCurrentFocusedItem != null)
- {
- Rectangle clientBounds = GetClientAreaBounds();
+ Rectangle clientBounds = GetClientAreaBounds();
+ AppLogDebug("Contacts::OnKeypadclosed bounds are width:(%d), height:(%d)", clientBounds.width, clientBounds.height);
+ __pTableView->SetSize(clientBounds.width, clientBounds.height);
- AppLogDebug("Contacts::OnKeypadclosed bounds are width:(%d), height:(%d)", clientBounds.width, clientBounds.height);
- __pTableView->SetSize(clientBounds.width, clientBounds.height);
- }
- else if (__isMoreInformationContextMenuShowing)
+ if (__isMoreInformationContextMenuShowing)
{
Point anchorPosition = __pMoreInformationContextMenu->GetAnchorPosition();
__pTableView->ScrollToItem(TABLE_VIEW_MORE_INFORMATION_FIELD_INDEX, 0, TABLE_VIEW_SCROLL_ITEM_ALIGNMENT_BOTTOM);
#include "CtContactListItem.h"
#include "CtContactListPresentationModel.h"
#include "CtContactsApp.h"
+#include "CtCommonUtil.h"
#include "CtMainForm.h"
#include "CtResourceManager.h"
#include "CtSceneRegister.h"
void
ContactListEditorPanel::ReturnMultipleValues(void)
{
+ if (CommonUtil::isMemoryAvailable() == false)
+ {
+ CommonUtil::showMemoryFullMessageBox();
+ return;
+ }
+
ContactsApp* pContactsApp = static_cast<ContactsApp*>(ContactsApp::GetInstance());
if (pContactsApp->GetOperationId() == OPERATION_ID_PICK)
using namespace Tizen::Ui::Controls;
using namespace Tizen::Ui::Scenes;
using namespace Tizen::Social;
+using namespace Tizen::System;
static const int IDA_FOOTER_CREATE = 1;
__pSearchListView->AddTouchEventListener(*this);
__pSearchListView->SetTextOfEmptyList(ResourceManager::GetString(L"IDS_PB_BODY_NO_CONTACTS"));
__pSearchListView->SetShowState(false);
- __pListView->AddTouchEventListener(*this);
AddControl(__pSearchListView);
__pEmptyImageLabel = new (std::nothrow) Label();
__pPresentationModel->AddContactChangeListener(*this);
+ SettingInfo::AddSettingEventListener(*this);
+
if (pArgs != null)
{
pArgs->RemoveAll(true);
}
void
+ContactListPanel::OnSettingChanged(Tizen::Base::String &key)
+{
+ ContactsApp* pContactsApp = static_cast<ContactsApp*>(ContactsApp::GetInstance());
+ TryReturnVoid(pContactsApp != null, "Unable to get ContactsApp instance.");
+
+ if(key == L"http://tizen.org/setting/contacts.order.firstname")
+ {
+ __pPresentationModel->InitializeContactList();
+
+ __pListView->SetFastScrollIndex(__pPresentationModel->GetAllKeys(), false);
+ __pListView->UpdateList();
+
+ if (__pSearchBar->GetMode() == SEARCH_BAR_MODE_INPUT)
+ {
+ String searchText = __pSearchBar->GetText();
+ searchText.Trim();
+
+ ContactsApp* pContactsApp = static_cast<ContactsApp*>(ContactsApp::GetInstance());
+ if (pContactsApp->GetReturnType() == APP_CONTROL_RETURN_TYPE_PHONE)
+ {
+ __pPresentationModel->SetSearchText(searchText, SEARCH_TYPE_HAS_PHONE_ONLY);
+ }
+ else if (pContactsApp->GetReturnType() == APP_CONTROL_RETURN_TYPE_EMAIL)
+ {
+ __pPresentationModel->SetSearchText(searchText, SEARCH_TYPE_HAS_EMAIL_ONLY);
+ }
+ else
+ {
+ __pPresentationModel->SetSearchText(searchText, SEARCH_TYPE_NORMAL);
+ }
+ __pSearchListView->UpdateList();
+ }
+ }
+}
+
+void
ContactListPanel::OnSceneDeactivated(const Tizen::Ui::Scenes::SceneId& currentSceneId,
const Tizen::Ui::Scenes::SceneId& nextSceneId)
{
__pPresentationModel->RemoveContactChangeListener(*this);
pContactsApp->RemoveContactsAppChangeEventListener(*this);
+ SettingInfo::RemoveSettingEventListener(*this);
delete __pAppControl;
__pAppControl = null;
{
if (source.Equals(*__pSearchBar))
{
- if (__pListView->GetShowState() == true)
+ if (__pListView->GetShowState() == true )
{
- __pListView->UpdateList();
+ int groupCount = __pPresentationModel->GetKeyCount();
+ bool isContextItemOpenend = false;
+
+ for (int i = 0; i < groupCount; i++)
+ {
+ int contactCount = __pPresentationModel->GetContactCount(i);
+ for (int j = 0; j < contactCount; j++)
+ {
+ if (__pListView->IsContextItemOpened(i, j) == true)
+ {
+ isContextItemOpenend = true;
+ break;
+ }
+ }
+ }
+
+ if (isContextItemOpenend == true)
+ {
+ __pListView->UpdateList();
+ }
}
- else if (__pSearchListView->GetShowState() == true)
+ else if (__pSearchListView->GetShowState() == true )
{
- __pSearchListView->UpdateList();
+ int groupCount = 0;
+ bool isContextItemOpenend = false;
+
+ if (__pSearchListEvent == null)
+ {
+ return;
+ }
+ groupCount = __pSearchListEvent->GetGroupCount();
+ for (int i = 0; i < groupCount; i++)
+ {
+ int contactCount = __pSearchListEvent->GetItemCount(i);
+ for (int j = 0; j < contactCount; j++)
+ {
+ if (__pSearchListView->IsContextItemOpened(i, j) == true)
+ {
+ isContextItemOpenend = true;
+ break;
+ }
+ }
+ }
+
+ if (isContextItemOpenend == true)
+ {
+ __pSearchListView->UpdateList();
+ }
}
}
}
{
if (source.Equals(*__pSearchBar))
{
- if (__pListView->GetShowState() == true)
+ if (__pListView->GetShowState() == true )
{
- __pListView->UpdateList();
+ int groupCount = __pPresentationModel->GetKeyCount();
+ bool isContextItemOpenend = false;
+
+ for (int i = 0; i < groupCount; i++)
+ {
+ int contactCount = __pPresentationModel->GetContactCount(i);
+ for (int j = 0; j < contactCount; j++)
+ {
+ if (__pListView->IsContextItemOpened(i, j) == true)
+ {
+ isContextItemOpenend = true;
+ break;
+ }
+ }
+ }
+
+ if (isContextItemOpenend == true)
+ {
+ __pListView->UpdateList();
+ }
}
- else if(__pSearchListView->GetShowState() == true)
+ else if (__pSearchListView->GetShowState() == true )
{
- __pSearchListView->UpdateList();
+ int groupCount = 0;
+ bool isContextItemOpenend = false;
+
+ if (__pSearchListEvent == null)
+ {
+ return;
+ }
+ groupCount = __pSearchListEvent->GetGroupCount();
+ for (int i = 0; i < groupCount; i++)
+ {
+ int contactCount = __pSearchListEvent->GetItemCount(i);
+ for (int j = 0; j < contactCount; j++)
+ {
+ if (__pSearchListView->IsContextItemOpened(i, j) == true)
+ {
+ isContextItemOpenend = true;
+ break;
+ }
+ }
+ }
+
+ if (isContextItemOpenend == true)
+ {
+ __pSearchListView->UpdateList();
+ }
}
}
}
}
__pFileEventManager->AddPath(*pResultString, FILE_EVENT_TYPE_DELETE | FILE_EVENT_TYPE_DELETE_SELF | FILE_EVENT_TYPE_MODIFY | FILE_EVENT_TYPE_MOVE_SELF);
__isGroupsChanged = true;
- }
- __pTableView->RefreshItem(1, TABLE_VIEW_REFRESH_TYPE_ITEM_MODIFY);
+ __pTableView->RefreshItem(0, TABLE_VIEW_REFRESH_TYPE_ITEM_MODIFY);
+ }
AppLogDebug("EXIT");
}