NABI_Issue Fix 53297 53607 53635 53606 53534
authorkamesh <kamesh.kvss@samsung.com>
Mon, 30 Sep 2013 13:58:34 +0000 (19:28 +0530)
committerkamesh <kamesh.kvss@samsung.com>
Mon, 30 Sep 2013 13:58:34 +0000 (19:28 +0530)
Change-Id: I645330f492c7f63ad096a0ad6c1b487e3d223a4b

inc/CtContactDetailsForm.h
inc/CtContactListPanel.h
src/CtContactDetailsForm.cpp
src/CtContactEditorForm.cpp
src/CtContactListEditorPanel.cpp
src/CtContactListPanel.cpp
src/CtGroupContactListForm.cpp
src/CtGroupEditorForm.cpp

index 68b657a..ac273b7 100644 (file)
@@ -26,6 +26,7 @@
 #include <FBase.h>
 #include <FIo.h>
 #include <FUi.h>
+#include <FSystem.h>
 #include "CtIContactEventListener.h"
 #include "CtIContactsAppStateChangeEventListener.h"
 
@@ -46,6 +47,7 @@ class ContactDetailsForm
        , 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
@@ -109,6 +111,8 @@ public:
        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);
index 410fed2..ce63b24 100644 (file)
@@ -25,6 +25,7 @@
 #include <FApp.h>
 #include <FBase.h>
 #include <FUi.h>
+#include <FSystem.h>
 #include "CtContactValueListItemProvider.h"
 #include "CtIContactEventListener.h"
 #include "CtIContactsAppStateChangeEventListener.h"
@@ -48,6 +49,7 @@ class ContactListPanel
        , public Tizen::Ui::Controls::IFormMenuEventListener
        , public Tizen::Ui::Controls::ISearchBarEventListener
        , public Tizen::Ui::Scenes::ISceneEventListener
+       , public Tizen::System::ISettingEventListener
        , public IContactEventListener
        , public IContactsAppStateChangeEventListener
 {
@@ -114,6 +116,8 @@ public:
        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);
index 415862b..1dbc3e6 100644 (file)
@@ -42,6 +42,7 @@ using namespace Tizen::Ui;
 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;
@@ -522,6 +523,7 @@ ContactDetailsForm::OnSceneActivatedN(const Tizen::Ui::Scenes::SceneId& previous
        TryReturnVoid(pContactsApp != null, "Unable to cast UiApp to ContactsApp");
 
        pContactsApp->AddContactsAppChangeEventListener(*this);
+       SettingInfo::AddSettingEventListener(*this);
 
        if (previousSceneId == IDSCN_GROUP_SELECTOR || previousSceneId == IDSCN_GROUP_EDITOR)
        {
@@ -560,6 +562,7 @@ ContactDetailsForm::OnSceneActivatedN(const Tizen::Ui::Scenes::SceneId& previous
                if (pContactsApp->GetOperationId() == OPERATION_ID_VIEW)
                {
                        __pPresentationModel->RemoveContactChangeListener(*this);
+                       SettingInfo::RemoveSettingEventListener(*this);
 
                        String *pError = static_cast<String*>(pArgs->GetAt(2));
                        if (pError != null)
@@ -695,6 +698,7 @@ ContactDetailsForm::OnSceneDeactivated(const Tizen::Ui::Scenes::SceneId& current
 {
        ContactsApp* pContactsApp = static_cast<ContactsApp*>(ContactsApp::GetInstance());
        pContactsApp->RemoveContactsAppChangeEventListener(*this);
+       SettingInfo::RemoveSettingEventListener(*this);
 
        delete __pAppControl;
        __pAppControl = null;
@@ -2265,3 +2269,16 @@ ContactDetailsForm::OnKeyLongPressed(const Tizen::Ui::Control& source, Tizen::Ui
 {
 
 }
+
+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();
+       }
+}
index a2e8e8f..039c2e5 100644 (file)
@@ -1052,14 +1052,11 @@ ContactEditorForm::OnKeypadOpened(Tizen::Ui::Control& source)
 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);
index c2ca40d..a0fb351 100644 (file)
@@ -24,6 +24,7 @@
 #include "CtContactListItem.h"
 #include "CtContactListPresentationModel.h"
 #include "CtContactsApp.h"
+#include "CtCommonUtil.h"
 #include "CtMainForm.h"
 #include "CtResourceManager.h"
 #include "CtSceneRegister.h"
@@ -1324,6 +1325,12 @@ ContactListEditorPanel::ReturnValues(RequestId requestId, Tizen::App::AppCtrlRes
 void
 ContactListEditorPanel::ReturnMultipleValues(void)
 {
+       if (CommonUtil::isMemoryAvailable() == false)
+       {
+               CommonUtil::showMemoryFullMessageBox();
+               return;
+       }
+
        ContactsApp* pContactsApp = static_cast<ContactsApp*>(ContactsApp::GetInstance());
 
        if (pContactsApp->GetOperationId() == OPERATION_ID_PICK)
index 385f6e1..3e233a3 100644 (file)
@@ -40,6 +40,7 @@ using namespace Tizen::Ui;
 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;
@@ -173,7 +174,6 @@ ContactListPanel::OnInitializing(void)
        __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();
@@ -457,6 +457,8 @@ ContactListPanel::OnSceneActivatedN(const Tizen::Ui::Scenes::SceneId& previousSc
 
        __pPresentationModel->AddContactChangeListener(*this);
 
+       SettingInfo::AddSettingEventListener(*this);
+
        if (pArgs != null)
        {
                pArgs->RemoveAll(true);
@@ -465,6 +467,42 @@ ContactListPanel::OnSceneActivatedN(const Tizen::Ui::Scenes::SceneId& previousSc
 }
 
 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)
 {
@@ -489,6 +527,7 @@ ContactListPanel::OnSceneDeactivated(const Tizen::Ui::Scenes::SceneId& currentSc
 
        __pPresentationModel->RemoveContactChangeListener(*this);
        pContactsApp->RemoveContactsAppChangeEventListener(*this);
+       SettingInfo::RemoveSettingEventListener(*this);
 
        delete __pAppControl;
        __pAppControl = null;
@@ -1079,13 +1118,56 @@ ContactListPanel::OnFocusGained(const Tizen::Ui::Control& source)
 {
        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();
+                       }
                }
        }
 }
index e1b4c07..64a7fd1 100644 (file)
@@ -891,13 +891,56 @@ GroupContactListForm::OnFocusGained(const Tizen::Ui::Control& source)
 {
        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();
+                       }
                }
        }
 }
index a1bd835..8262991 100644 (file)
@@ -1211,9 +1211,9 @@ GroupEditorForm::OnAppControlCompleteResponseReceived(const Tizen::App::AppId& a
                }
                __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");
 }