TizenRefApp-8427 [Call UI] Refactor project folders structure 57/126657/2
authorIgor Olshevskyi <i.olshevskyi@samsung.com>
Fri, 21 Apr 2017 13:28:03 +0000 (16:28 +0300)
committerIgor Olshevskyi <i.olshevskyi@samsung.com>
Tue, 25 Apr 2017 05:39:23 +0000 (08:39 +0300)
Change-Id: I606168e00d0fa8536b6a4b584c04ae735d182ab6

inc/main/Instance.h [deleted file]
inc/main/InstanceManager.h [deleted file]
inc/presenters/Instance.h [new file with mode: 0644]
inc/presenters/InstanceManager.h [new file with mode: 0644]
src/main.cpp [new file with mode: 0644]
src/main/Instance.cpp [deleted file]
src/main/InstanceManager.cpp [deleted file]
src/main/main.cpp [deleted file]
src/presenters/Instance.cpp [new file with mode: 0644]
src/presenters/InstanceManager.cpp [new file with mode: 0644]

diff --git a/inc/main/Instance.h b/inc/main/Instance.h
deleted file mode 100644 (file)
index 40b2b54..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * Copyright 2017 Samsung Electronics Co., Ltd
- *
- * Licensed under the Flora License, Version 1.1 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://floralicense.org/license/
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef __CALLUI_MAIN_INSTANCE_H__
-#define __CALLUI_MAIN_INSTANCE_H__
-
-#include "types.h"
-
-#include "ucl/appfw/IInstance.h"
-#include "ucl/appfw/IInstanceAppControlExt.h"
-
-#include "ucl/appfw/SysEventProvider.h"
-
-#include "model/ICall.h"
-
-namespace callui {
-
-       class Instance :
-                       public ucl::IInstance,
-                       public ucl::IInstanceAppControlExt {
-       public:
-               Instance(ucl::SysEventProvider &sysEventProvider);
-
-               // For testing
-               ucl::WindowWRef getWindow();
-               ucl::IInstanceContext *getContext();
-               ICallWRef getCall();
-
-               // IInstance //
-
-               virtual ucl::Result onCreate(
-                               ucl::IInstanceContext *context) final override;
-               virtual void onPause() final override;
-               virtual void onResume() final override;
-
-               // IInstanceAppControlExt //
-
-               virtual void onAppControl(app_control_h appControl) final override;
-
-       private:
-               void onBack(Evas_Object *obj, void *event_info);
-               void onSysEvent(const ucl::SysEvent sysEvent);
-
-       private:
-               ucl::SysEventProvider &m_sysEventProvider;
-               ucl::IInstanceContext *m_context;
-               ucl::WindowSRef m_win;
-               ICallSRef m_call;
-       };
-}
-
-#endif // __CALLUI_MAIN_INSTANCE_H__
diff --git a/inc/main/InstanceManager.h b/inc/main/InstanceManager.h
deleted file mode 100644 (file)
index 9bca1da..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Copyright 2017 Samsung Electronics Co., Ltd
- *
- * Licensed under the Flora License, Version 1.1 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://floralicense.org/license/
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef __CALLUI_MAIN_INSTANCE_MANAGER_H__
-#define __CALLUI_MAIN_INSTANCE_MANAGER_H__
-
-#include "types.h"
-
-#include "ucl/appfw/InstanceManagerBase.h"
-
-namespace callui {
-
-       class InstanceManager : public ucl::InstanceManagerBase {
-       public:
-               InstanceManager();
-
-               // ucl::InstanceManagerBase //
-
-               virtual ucl::IInstanceSRef newInstance() const final override;
-       };
-}
-
-#endif // __CALLUI_MAIN_INSTANCE_MANAGER_H__
diff --git a/inc/presenters/Instance.h b/inc/presenters/Instance.h
new file mode 100644 (file)
index 0000000..b1e316f
--- /dev/null
@@ -0,0 +1,65 @@
+/*
+ * Copyright 2017 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://floralicense.org/license/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef __CALLUI_PRESENTERS_INSTANCE_H__
+#define __CALLUI_PRESENTERS_INSTANCE_H__
+
+#include "types.h"
+
+#include "ucl/appfw/IInstance.h"
+#include "ucl/appfw/IInstanceAppControlExt.h"
+
+#include "ucl/appfw/SysEventProvider.h"
+
+#include "model/ICall.h"
+
+namespace callui {
+
+       class Instance :
+                       public ucl::IInstance,
+                       public ucl::IInstanceAppControlExt {
+       public:
+               Instance(ucl::SysEventProvider &sysEventProvider);
+
+               // For testing
+               ucl::WindowWRef getWindow();
+               ucl::IInstanceContext *getContext();
+               ICallWRef getCall();
+
+               // IInstance //
+
+               virtual ucl::Result onCreate(
+                               ucl::IInstanceContext *context) final override;
+               virtual void onPause() final override;
+               virtual void onResume() final override;
+
+               // IInstanceAppControlExt //
+
+               virtual void onAppControl(app_control_h appControl) final override;
+
+       private:
+               void onBack(Evas_Object *obj, void *event_info);
+               void onSysEvent(const ucl::SysEvent sysEvent);
+
+       private:
+               ucl::SysEventProvider &m_sysEventProvider;
+               ucl::IInstanceContext *m_context;
+               ucl::WindowSRef m_win;
+               ICallSRef m_call;
+       };
+}
+
+#endif // __CALLUI_PRESENTERS_INSTANCE_H__
diff --git a/inc/presenters/InstanceManager.h b/inc/presenters/InstanceManager.h
new file mode 100644 (file)
index 0000000..c58389e
--- /dev/null
@@ -0,0 +1,36 @@
+/*
+ * Copyright 2017 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://floralicense.org/license/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef __CALLUI_PRESENTERS_INSTANCE_MANAGER_H__
+#define __CALLUI_PRESENTERS_INSTANCE_MANAGER_H__
+
+#include "types.h"
+
+#include "ucl/appfw/InstanceManagerBase.h"
+
+namespace callui {
+
+       class InstanceManager : public ucl::InstanceManagerBase {
+       public:
+               InstanceManager();
+
+               // ucl::InstanceManagerBase //
+
+               virtual ucl::IInstanceSRef newInstance() const final override;
+       };
+}
+
+#endif // __CALLUI_PRESENTERS_INSTANCE_MANAGER_H__
diff --git a/src/main.cpp b/src/main.cpp
new file mode 100644 (file)
index 0000000..b00dae0
--- /dev/null
@@ -0,0 +1,32 @@
+/*
+ * Copyright 2017 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://floralicense.org/license/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "ucl/appfw/UIApp.h"
+
+#include "presenters/InstanceManager.h"
+
+#include "common.h"
+
+using namespace ucl;
+using namespace callui;
+
+int main(int argc, char *argv[])
+{
+       InstanceManager mgr;
+       const int ret = UIApp(mgr).run(argc, argv);
+       ILOG("ret: %d", ret);
+       return ret;
+}
diff --git a/src/main/Instance.cpp b/src/main/Instance.cpp
deleted file mode 100644 (file)
index d54e7ee..0000000
+++ /dev/null
@@ -1,233 +0,0 @@
-/*
- * Copyright 2017 Samsung Electronics Co., Ltd
- *
- * Licensed under the Flora License, Version 1.1 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://floralicense.org/license/
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "main/Instance.h"
-
-#include "ucl/util/memory.h"
-
-#include <system_settings.h>
-#include <efl_extension.h>
-
-#include "model/CallBuilder.h"
-#include "model/ICallManager.h"
-#include "model/IIncomingCall.h"
-#include "model/IActiveCall.h"
-#include "model/IHeldCall.h"
-#include "model/IEndCall.h"
-#include "model/ICallInfo.h"
-#include "model/ICallListener.h"
-
-#include "../common.h"
-
-namespace callui {
-
-       using namespace ucl;
-
-       // For testing
-       UCL_DECLARE_REF_ALIASES(Listener);
-       class Listener : public ICallListener {
-       public:
-               static ListenerSRef newInstance(Instance &instance)
-               {
-                       return makeShared<Listener>(instance);
-               }
-
-               virtual void onCallEvent(CallEventType type) override final
-               {
-                       WindowWRef win = m_instance.getWindow();
-                       ICallWRef call = m_instance.getCall();
-                       ICallManagerSRef callMng = {};
-                       if (call) {
-                               callMng = call->getCallManager();
-                       }
-
-                       if (win && !win->isVisible()) {
-                               show(*win);
-                       }
-
-                       IIncomingCallWRef incom = callMng->getIncomingCall();
-                       IActiveCallWRef active = callMng->getActiveCall();
-                       IHeldCallWRef held = callMng->getHeldCall();
-                       IEndCallWRef end = callMng->getEndCall();
-
-                       ILOG(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>");
-                       if (incom) {
-                               ILOG("Incoming call available");
-                               logCallInfo(incom->getInfo());
-                       } else {
-                               ILOG("No incoming call");
-                       }
-
-                       if (active) {
-                               ILOG("Active call available");
-                               logCallInfo(active->getInfo());
-                       } else {
-                               ILOG("No active call");
-                       }
-
-                       if (held) {
-                               ILOG("Held call available");
-                               logCallInfo(held->getInfo());
-                       } else {
-                               ILOG("No held call");
-                       }
-
-                       if (end) {
-                               ILOG("End call available");
-                               logCallInfo(end->getInfo());
-                       } else {
-                               ILOG("No end call");
-                       }
-                       ILOG("<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<");
-
-                       if (type == CallEventType::END) {
-                               if (!callMng->getIncomingCall()
-                                               && !callMng->getActiveCall()
-                                               && !callMng->getHeldCall()) {
-                                       IInstanceContext *ctx = m_instance.getContext();
-                                       if (ctx) {
-                                               ctx->exitApp();
-                                       }
-                               }
-                       }
-               }
-
-               virtual void onError(CallErr err) override final
-               {
-                       ILOG();
-               }
-
-       private:
-               friend class ucl::RefCountObj<Listener>;
-               Listener(Instance &instance):
-                       m_instance(instance)
-               {
-                       ILOG();
-               }
-
-               void logCallInfo(ICallInfoSCRef info)
-               {
-                       ILOG("* call id [%d]", info->getCallId());
-                       ILOG("* phone number [%s]", info->getPhoneNumber().c_str());
-                       ILOG("* conference member count [%d]", info->getConferenceMemberCount());
-               }
-
-       private:
-               Instance &m_instance;
-       };
-
-       Instance::Instance(SysEventProvider &sysEventProvider) :
-               m_sysEventProvider(sysEventProvider),
-               m_context(nullptr)
-       {
-       }
-
-       Result Instance::onCreate(IInstanceContext *const context)
-       {
-               m_context = context;
-
-               m_win = m_context->getWindow();
-
-               m_sysEventProvider.addEventHandler(
-                               DELEGATE(Instance::onSysEvent, this));
-
-               eext_object_event_callback_add(*m_win, EEXT_CALLBACK_BACK,
-                               CALLBACK_A(Instance::onBack), this);
-
-               // For testing
-               m_call = CallBuilder().build();
-               if (!m_call) {
-                       LOG_RETURN(RES_FAIL, "m_call is NULL");
-               }
-
-               static ListenerSRef listener = Listener::newInstance(*this);
-               m_call->setListener(listener);
-
-               return RES_OK;
-       }
-
-       void Instance::onPause()
-       {
-               ILOG("PAUSED");
-       }
-
-       void Instance::onResume()
-       {
-               ILOG("RESUMED");
-       }
-
-       void Instance::onAppControl(app_control_h appControl)
-       {
-               char *op = {};
-               app_control_get_operation(appControl, &op);
-               ILOG("operation: %s", op);
-               free(op);
-
-               // For testing
-               Result res = m_call->processAppControl(appControl);
-               if (res != RES_OK) {
-                       ELOG("processAppControl() failed!");
-                       ICallManagerSRef callManager = m_call->getCallManager();
-                       if (!callManager->getIncomingCall()
-                                       && !callManager->getActiveCall()
-                                       && !callManager->getHeldCall()
-                                       && !callManager->getEndCall()) {
-                               ILOG("No calls. Exit application");
-                               m_context->exitApp();
-                       }
-               }
-       }
-
-       void Instance::onBack(Evas_Object *obj, void *event_info)
-       {
-               ILOG("Exiting the application...");
-               m_context->exitApp();
-       }
-
-       void Instance::onSysEvent(const SysEvent sysEvent)
-       {
-               switch(sysEvent) {
-               case SysEvent::LANGUAGE_CHANGED:
-                       ILOG("SysEvent::LANGUAGE_CHANGED");
-                       {
-                               char *locale = NULL;
-                               system_settings_get_value_string(
-                                               SYSTEM_SETTINGS_KEY_LOCALE_LANGUAGE, &locale);
-                               elm_language_set(locale);
-                               free(locale);
-                       }
-                       break;
-               default:
-                       ILOG("sysEvent: %d", sysEvent);
-                       break;
-               }
-       }
-
-       WindowWRef Instance::getWindow()
-       {
-               return m_win;
-       }
-
-       IInstanceContext *Instance::getContext()
-       {
-               return m_context;
-       }
-
-       ICallWRef Instance::getCall()
-       {
-               return m_call;
-       }
-}
diff --git a/src/main/InstanceManager.cpp b/src/main/InstanceManager.cpp
deleted file mode 100644 (file)
index 92e6dfa..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Copyright 2017 Samsung Electronics Co., Ltd
- *
- * Licensed under the Flora License, Version 1.1 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://floralicense.org/license/
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "main/InstanceManager.h"
-
-#include "main/Instance.h"
-
-namespace callui {
-
-       using namespace ucl;
-
-       InstanceManager::InstanceManager() :
-               InstanceManagerBase(AppParams().
-                               set(AppParam::WINDOW_NAME, WINDOW_NAME).
-                               set(AppParam::BASE_SCALE, BASE_SCALE))
-       {
-       }
-
-       IInstanceSRef InstanceManager::newInstance() const
-       {
-               return makeShared<Instance>(getSysEventProvider());
-       }
-}
diff --git a/src/main/main.cpp b/src/main/main.cpp
deleted file mode 100644 (file)
index 6133677..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Copyright 2017 Samsung Electronics Co., Ltd
- *
- * Licensed under the Flora License, Version 1.1 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://floralicense.org/license/
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "ucl/appfw/UIApp.h"
-
-#include "main/InstanceManager.h"
-
-#include "../common.h"
-
-using namespace ucl;
-using namespace callui;
-
-int main(int argc, char *argv[])
-{
-       InstanceManager mgr;
-       const int ret = UIApp(mgr).run(argc, argv);
-       ILOG("ret: %d", ret);
-       return ret;
-}
diff --git a/src/presenters/Instance.cpp b/src/presenters/Instance.cpp
new file mode 100644 (file)
index 0000000..26a9ed0
--- /dev/null
@@ -0,0 +1,232 @@
+/*
+ * Copyright 2017 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://floralicense.org/license/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "presenters/Instance.h"
+
+#include "ucl/util/memory.h"
+
+#include <system_settings.h>
+#include <efl_extension.h>
+
+#include "model/CallBuilder.h"
+#include "model/ICallManager.h"
+#include "model/IIncomingCall.h"
+#include "model/IActiveCall.h"
+#include "model/IHeldCall.h"
+#include "model/IEndCall.h"
+#include "model/ICallInfo.h"
+#include "model/ICallListener.h"
+
+#include "../common.h"
+
+namespace callui {
+
+       using namespace ucl;
+
+       // For testing
+       UCL_DECLARE_REF_ALIASES(CallListener);
+       class CallListener : public ICallListener {
+       public:
+               static CallListenerSRef newInstance(Instance &instance)
+               {
+                       return makeShared<CallListener>(instance);
+               }
+
+               virtual void onCallEvent(CallEventType type) override final
+               {
+                       WindowWRef win = m_instance.getWindow();
+                       ICallWRef call = m_instance.getCall();
+                       ICallManagerSRef callMng = {};
+                       if (call) {
+                               callMng = call->getCallManager();
+                       }
+
+                       if (win && !win->isVisible()) {
+                               show(*win);
+                       }
+
+                       IIncomingCallWRef incom = callMng->getIncomingCall();
+                       IActiveCallWRef active = callMng->getActiveCall();
+                       IHeldCallWRef held = callMng->getHeldCall();
+                       IEndCallWRef end = callMng->getEndCall();
+
+                       ILOG(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>");
+                       if (incom) {
+                               ILOG("Incoming call available");
+                               logCallInfo(incom->getInfo());
+                       } else {
+                               ILOG("No incoming call");
+                       }
+
+                       if (active) {
+                               ILOG("Active call available");
+                               logCallInfo(active->getInfo());
+                       } else {
+                               ILOG("No active call");
+                       }
+
+                       if (held) {
+                               ILOG("Held call available");
+                               logCallInfo(held->getInfo());
+                       } else {
+                               ILOG("No held call");
+                       }
+
+                       if (end) {
+                               ILOG("End call available");
+                               logCallInfo(end->getInfo());
+                       } else {
+                               ILOG("No end call");
+                       }
+                       ILOG("<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<");
+
+                       if (type == CallEventType::END) {
+                               if (!callMng->getIncomingCall()
+                                               && !callMng->getActiveCall()
+                                               && !callMng->getHeldCall()) {
+                                       IInstanceContext *ctx = m_instance.getContext();
+                                       if (ctx) {
+                                               ctx->exitApp();
+                                       }
+                               }
+                       }
+               }
+
+               virtual void onError(CallErr err) override final
+               {
+                       ILOG();
+               }
+
+       private:
+               friend class ucl::RefCountObj<CallListener>;
+               CallListener(Instance &instance):
+                       m_instance(instance)
+               {
+                       ILOG();
+               }
+
+               void logCallInfo(ICallInfoSCRef info)
+               {
+                       ILOG("* call id [%d]", info->getCallId());
+                       ILOG("* phone number [%s]", info->getPhoneNumber().c_str());
+                       ILOG("* conference member count [%d]", info->getConferenceMemberCount());
+               }
+
+       private:
+               Instance &m_instance;
+       };
+
+       Instance::Instance(SysEventProvider &sysEventProvider) :
+               m_sysEventProvider(sysEventProvider),
+               m_context(nullptr)
+       {
+       }
+
+       Result Instance::onCreate(IInstanceContext *const context)
+       {
+               m_context = context;
+
+               m_win = m_context->getWindow();
+
+               m_sysEventProvider.addEventHandler(
+                               DELEGATE(Instance::onSysEvent, this));
+
+               eext_object_event_callback_add(*m_win, EEXT_CALLBACK_BACK,
+                               CALLBACK_A(Instance::onBack), this);
+
+               // For testing
+               m_call = CallBuilder().build();
+               if (!m_call) {
+                       LOG_RETURN(RES_FAIL, "m_call is NULL");
+               }
+
+               static CallListenerSRef callListener =
+                               CallListener::newInstance(*this);
+               m_call->setListener(callListener);
+
+               return RES_OK;
+       }
+
+       void Instance::onPause()
+       {
+               ILOG("PAUSED");
+       }
+
+       void Instance::onResume()
+       {
+               ILOG("RESUMED");
+       }
+
+       void Instance::onAppControl(app_control_h appControl)
+       {
+               char *op = {};
+               app_control_get_operation(appControl, &op);
+               ILOG("operation: %s", op);
+               free(op);
+
+               // For testing
+               Result res = m_call->processAppControl(appControl);
+               if (res != RES_OK) {
+                       ELOG("processAppControl() failed!");
+                       ICallManagerSRef callManager = m_call->getCallManager();
+                       if (!callManager->getAvailableCalls()) {
+                               ILOG("No calls. Exit application");
+                               m_context->exitApp();
+                       }
+               }
+       }
+
+       void Instance::onBack(Evas_Object *obj, void *event_info)
+       {
+               ILOG("Exiting the application...");
+               m_context->exitApp();
+       }
+
+       void Instance::onSysEvent(const SysEvent sysEvent)
+       {
+               switch(sysEvent) {
+               case SysEvent::LANGUAGE_CHANGED:
+                       ILOG("SysEvent::LANGUAGE_CHANGED");
+                       {
+                               char *locale = NULL;
+                               system_settings_get_value_string(
+                                               SYSTEM_SETTINGS_KEY_LOCALE_LANGUAGE, &locale);
+                               elm_language_set(locale);
+                               free(locale);
+                       }
+                       break;
+               default:
+                       ILOG("sysEvent: %d", sysEvent);
+                       break;
+               }
+       }
+
+       WindowWRef Instance::getWindow()
+       {
+               return m_win;
+       }
+
+       IInstanceContext *Instance::getContext()
+       {
+               return m_context;
+       }
+
+       ICallWRef Instance::getCall()
+       {
+               return m_call;
+       }
+
+}
diff --git a/src/presenters/InstanceManager.cpp b/src/presenters/InstanceManager.cpp
new file mode 100644 (file)
index 0000000..7022bed
--- /dev/null
@@ -0,0 +1,36 @@
+/*
+ * Copyright 2017 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://floralicense.org/license/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "presenters/InstanceManager.h"
+
+#include "presenters/Instance.h"
+
+namespace callui {
+
+       using namespace ucl;
+
+       InstanceManager::InstanceManager() :
+               InstanceManagerBase(AppParams().
+                               set(AppParam::WINDOW_NAME, WINDOW_NAME).
+                               set(AppParam::BASE_SCALE, BASE_SCALE))
+       {
+       }
+
+       IInstanceSRef InstanceManager::newInstance() const
+       {
+               return makeShared<Instance>(getSysEventProvider());
+       }
+}