From 2d3c13ad4aa6f4006a36e60854cb391fb60719a7 Mon Sep 17 00:00:00 2001 From: Igor Olshevskyi Date: Fri, 21 Apr 2017 16:28:03 +0300 Subject: [PATCH] TizenRefApp-8427 [Call UI] Refactor project folders structure Change-Id: I606168e00d0fa8536b6a4b584c04ae735d182ab6 --- inc/{main => presenters}/Instance.h | 6 ++--- inc/{main => presenters}/InstanceManager.h | 6 ++--- src/{main => }/main.cpp | 4 ++-- src/{main => presenters}/Instance.cpp | 25 ++++++++++---------- src/{main => presenters}/InstanceManager.cpp | 4 ++-- 5 files changed, 22 insertions(+), 23 deletions(-) rename inc/{main => presenters}/Instance.h (92%) rename inc/{main => presenters}/InstanceManager.h (85%) rename src/{main => }/main.cpp (93%) rename src/{main => presenters}/Instance.cpp (89%) rename src/{main => presenters}/InstanceManager.cpp (92%) diff --git a/inc/main/Instance.h b/inc/presenters/Instance.h similarity index 92% rename from inc/main/Instance.h rename to inc/presenters/Instance.h index 40b2b54..b1e316f 100644 --- a/inc/main/Instance.h +++ b/inc/presenters/Instance.h @@ -14,8 +14,8 @@ * limitations under the License. */ -#ifndef __CALLUI_MAIN_INSTANCE_H__ -#define __CALLUI_MAIN_INSTANCE_H__ +#ifndef __CALLUI_PRESENTERS_INSTANCE_H__ +#define __CALLUI_PRESENTERS_INSTANCE_H__ #include "types.h" @@ -62,4 +62,4 @@ namespace callui { }; } -#endif // __CALLUI_MAIN_INSTANCE_H__ +#endif // __CALLUI_PRESENTERS_INSTANCE_H__ diff --git a/inc/main/InstanceManager.h b/inc/presenters/InstanceManager.h similarity index 85% rename from inc/main/InstanceManager.h rename to inc/presenters/InstanceManager.h index 9bca1da..c58389e 100644 --- a/inc/main/InstanceManager.h +++ b/inc/presenters/InstanceManager.h @@ -14,8 +14,8 @@ * limitations under the License. */ -#ifndef __CALLUI_MAIN_INSTANCE_MANAGER_H__ -#define __CALLUI_MAIN_INSTANCE_MANAGER_H__ +#ifndef __CALLUI_PRESENTERS_INSTANCE_MANAGER_H__ +#define __CALLUI_PRESENTERS_INSTANCE_MANAGER_H__ #include "types.h" @@ -33,4 +33,4 @@ namespace callui { }; } -#endif // __CALLUI_MAIN_INSTANCE_MANAGER_H__ +#endif // __CALLUI_PRESENTERS_INSTANCE_MANAGER_H__ diff --git a/src/main/main.cpp b/src/main.cpp similarity index 93% rename from src/main/main.cpp rename to src/main.cpp index 6133677..b00dae0 100644 --- a/src/main/main.cpp +++ b/src/main.cpp @@ -16,9 +16,9 @@ #include "ucl/appfw/UIApp.h" -#include "main/InstanceManager.h" +#include "presenters/InstanceManager.h" -#include "../common.h" +#include "common.h" using namespace ucl; using namespace callui; diff --git a/src/main/Instance.cpp b/src/presenters/Instance.cpp similarity index 89% rename from src/main/Instance.cpp rename to src/presenters/Instance.cpp index d54e7ee..26a9ed0 100644 --- a/src/main/Instance.cpp +++ b/src/presenters/Instance.cpp @@ -14,7 +14,7 @@ * limitations under the License. */ -#include "main/Instance.h" +#include "presenters/Instance.h" #include "ucl/util/memory.h" @@ -37,12 +37,12 @@ namespace callui { using namespace ucl; // For testing - UCL_DECLARE_REF_ALIASES(Listener); - class Listener : public ICallListener { + UCL_DECLARE_REF_ALIASES(CallListener); + class CallListener : public ICallListener { public: - static ListenerSRef newInstance(Instance &instance) + static CallListenerSRef newInstance(Instance &instance) { - return makeShared(instance); + return makeShared(instance); } virtual void onCallEvent(CallEventType type) override final @@ -111,8 +111,8 @@ namespace callui { } private: - friend class ucl::RefCountObj; - Listener(Instance &instance): + friend class ucl::RefCountObj; + CallListener(Instance &instance): m_instance(instance) { ILOG(); @@ -153,8 +153,9 @@ namespace callui { LOG_RETURN(RES_FAIL, "m_call is NULL"); } - static ListenerSRef listener = Listener::newInstance(*this); - m_call->setListener(listener); + static CallListenerSRef callListener = + CallListener::newInstance(*this); + m_call->setListener(callListener); return RES_OK; } @@ -181,10 +182,7 @@ namespace callui { if (res != RES_OK) { ELOG("processAppControl() failed!"); ICallManagerSRef callManager = m_call->getCallManager(); - if (!callManager->getIncomingCall() - && !callManager->getActiveCall() - && !callManager->getHeldCall() - && !callManager->getEndCall()) { + if (!callManager->getAvailableCalls()) { ILOG("No calls. Exit application"); m_context->exitApp(); } @@ -230,4 +228,5 @@ namespace callui { { return m_call; } + } diff --git a/src/main/InstanceManager.cpp b/src/presenters/InstanceManager.cpp similarity index 92% rename from src/main/InstanceManager.cpp rename to src/presenters/InstanceManager.cpp index 92e6dfa..7022bed 100644 --- a/src/main/InstanceManager.cpp +++ b/src/presenters/InstanceManager.cpp @@ -14,9 +14,9 @@ * limitations under the License. */ -#include "main/InstanceManager.h" +#include "presenters/InstanceManager.h" -#include "main/Instance.h" +#include "presenters/Instance.h" namespace callui { -- 2.34.1