<storageModule moduleId="org.eclipse.cdt.core.settings">
<cconfiguration id="org.tizen.nativecore.config.sbi.gcc45.app.debug.746875570">
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="org.tizen.nativecore.config.sbi.gcc45.app.debug.746875570" moduleId="org.eclipse.cdt.core.settings" name="Debug">
+ <macros>
+ <stringMacro name="_DEBUG" type="VALUE_TEXT" value=""/>
+ </macros>
<externalSettings/>
<extensions>
<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
<targetPlatform binaryParser="org.eclipse.cdt.core.ELF" id="org.tizen.nativeide.target.sbi.gnu.platform.base.299151930" osList="linux,win32" superClass="org.tizen.nativeide.target.sbi.gnu.platform.base"/>
<builder autoBuildTarget="all" buildPath="${workspace_loc:/call-ui}/Debug" enableAutoBuild="true" id="org.tizen.nativecore.target.sbi.gnu.builder.287909858" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="Tizen Application Builder" superClass="org.tizen.nativecore.target.sbi.gnu.builder"/>
<tool id="org.tizen.nativecore.tool.sbi.gnu.archiver.850939844" name="Archiver" superClass="org.tizen.nativecore.tool.sbi.gnu.archiver"/>
- <tool command="clang++" id="org.tizen.nativecore.tool.sbi.gnu.cpp.compiler.66050065" name="C++ Compiler" superClass="org.tizen.nativecore.tool.sbi.gnu.cpp.compiler">
+ <tool command="i386-linux-gnueabi-g++" id="org.tizen.nativecore.tool.sbi.gnu.cpp.compiler.66050065" name="C++ Compiler" superClass="org.tizen.nativecore.tool.sbi.gnu.cpp.compiler">
<option id="gnu.cpp.compiler.option.optimization.level.1977572256" name="Optimization Level" superClass="gnu.cpp.compiler.option.optimization.level" value="gnu.cpp.compiler.optimization.level.none" valueType="enumerated"/>
<option defaultValue="gnu.cpp.compiler.debugging.level.max" id="sbi.gnu.cpp.compiler.option.debugging.level.core.1003532466" name="Debug level" superClass="sbi.gnu.cpp.compiler.option.debugging.level.core" valueType="enumerated"/>
<option defaultValue="false" id="sbi.gnu.cpp.compiler.option.misc.pic.core.58197076" name="-fPIC option" superClass="sbi.gnu.cpp.compiler.option.misc.pic.core" valueType="boolean"/>
<option id="sbi.gnu.cpp.compiler.option.1780411914" name="Tizen-Target" superClass="sbi.gnu.cpp.compiler.option" valueType="userObjs">
- <listOptionValue builtIn="false" value="wearable-3.0-emulator.core.private_llvm37.i386.core.app"/>
+ <listOptionValue builtIn="false" value="wearable-3.0-emulator.core.private.20170330_1_gcc49.i386.core.app"/>
</option>
<option id="sbi.gnu.cpp.compiler.option.frameworks_inc.core.2060575755" name="Tizen-Frameworks-Include-Path" superClass="sbi.gnu.cpp.compiler.option.frameworks_inc.core" valueType="includePath">
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/libxml2""/>
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/EGL""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/GLES""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/GLES2""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/GLES3""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/KHR""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/SDL2""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/appcore/""/>
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/appcore-agent""/>
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/appcore-watch""/>
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/appfw""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/aul/""/>
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/badge""/>
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/base""/>
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/cairo""/>
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/calendar-service2""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/call-manager""/>
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/chromium-ewk""/>
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/ckm""/>
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/contacts-svc""/>
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/efl-1""/>
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/efl-extension""/>
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/efreet-1""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/EGL""/>
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/eina-1""/>
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/eina-1/eina""/>
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/eio-1""/>
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/fontconfig""/>
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/freetype2""/>
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/gio-unix-2.0""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/GLES""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/GLES2""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/GLES3""/>
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/glib-2.0""/>
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/harfbuzz""/>
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/iotcon""/>
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/json-glib-1.0""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/KHR""/>
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/location""/>
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/maps""/>
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/media""/>
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/notification""/>
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/nsd/""/>
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/phonenumber-utils""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/pkgmgr""/>
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/rua/""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/SDL2""/>
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/sensor""/>
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/storage""/>
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/system""/>
<listOptionValue builtIn="false" value="Native_API"/>
</option>
<option id="gnu.cpp.compiler.option.dialect.std.2098907038" name="Language standard" superClass="gnu.cpp.compiler.option.dialect.std" value="gnu.cpp.compiler.dialect.c++11" valueType="enumerated"/>
+ <option id="sbi.gnu.cpp.compiler.option.preprocessor.def.deprecation.1401781788" superClass="sbi.gnu.cpp.compiler.option.preprocessor.def.deprecation" valueType="definedSymbols">
+ <listOptionValue builtIn="false" value="TIZEN_DEPRECATION"/>
+ <listOptionValue builtIn="false" value="DEPRECATION_WARNING"/>
+ <listOptionValue builtIn="false" value="_DEBUG"/>
+ </option>
<inputType id="cdt.managedbuild.tool.gnu.cpp.compiler.input.27127097" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.input"/>
</tool>
- <tool command="clang" id="org.tizen.nativecore.tool.sbi.gnu.c.compiler.1049599195" name="C Compiler" superClass="org.tizen.nativecore.tool.sbi.gnu.c.compiler">
+ <tool command="i386-linux-gnueabi-gcc" id="org.tizen.nativecore.tool.sbi.gnu.c.compiler.1049599195" name="C Compiler" superClass="org.tizen.nativecore.tool.sbi.gnu.c.compiler">
<option defaultValue="gnu.c.optimization.level.none" id="gnu.c.compiler.option.optimization.level.1400861396" name="Optimization Level" superClass="gnu.c.compiler.option.optimization.level" valueType="enumerated"/>
<option defaultValue="gnu.c.debugging.level.max" id="sbi.gnu.c.compiler.option.debugging.level.core.1157370620" name="Debug level" superClass="sbi.gnu.c.compiler.option.debugging.level.core" valueType="enumerated"/>
<option defaultValue="false" id="sbi.gnu.c.compiler.option.misc.pic.core.1654013693" name="-fPIC option" superClass="sbi.gnu.c.compiler.option.misc.pic.core" valueType="boolean"/>
<option id="sbi.gnu.c.compiler.option.551225658" name="Tizen-Target" superClass="sbi.gnu.c.compiler.option" valueType="userObjs">
- <listOptionValue builtIn="false" value="wearable-3.0-emulator.core.private_llvm37.i386.core.app"/>
+ <listOptionValue builtIn="false" value="wearable-3.0-emulator.core.private.20170330_1_gcc49.i386.core.app"/>
</option>
<option id="sbi.gnu.c.compiler.option.frameworks_inc.core.1481628386" name="Tizen-Frameworks-Include-Path" superClass="sbi.gnu.c.compiler.option.frameworks_inc.core" valueType="includePath">
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/libxml2""/>
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/EGL""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/GLES""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/GLES2""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/GLES3""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/KHR""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/SDL2""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/appcore/""/>
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/appcore-agent""/>
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/appcore-watch""/>
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/appfw""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/aul/""/>
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/badge""/>
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/base""/>
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/cairo""/>
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/calendar-service2""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/call-manager""/>
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/chromium-ewk""/>
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/ckm""/>
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/contacts-svc""/>
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/efl-1""/>
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/efl-extension""/>
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/efreet-1""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/EGL""/>
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/eina-1""/>
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/eina-1/eina""/>
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/eio-1""/>
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/fontconfig""/>
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/freetype2""/>
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/gio-unix-2.0""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/GLES""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/GLES2""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/GLES3""/>
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/glib-2.0""/>
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/harfbuzz""/>
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/iotcon""/>
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/json-glib-1.0""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/KHR""/>
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/location""/>
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/maps""/>
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/media""/>
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/notification""/>
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/nsd/""/>
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/phonenumber-utils""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/pkgmgr""/>
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/rua/""/>
+ <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/SDL2""/>
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/sensor""/>
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/storage""/>
<listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/system""/>
<listOptionValue builtIn="false" value="Native_API"/>
</option>
<option id="gnu.c.compiler.option.dialect.std.1743559858" name="Language standard" superClass="gnu.c.compiler.option.dialect.std" value="gnu.c.compiler.dialect.default" valueType="enumerated"/>
+ <option id="sbi.gnu.c.compiler.option.preprocessor.def.symbols.deprecation.958464226" superClass="sbi.gnu.c.compiler.option.preprocessor.def.symbols.deprecation" valueType="definedSymbols">
+ <listOptionValue builtIn="false" value="TIZEN_DEPRECATION"/>
+ <listOptionValue builtIn="false" value="DEPRECATION_WARNING"/>
+ <listOptionValue builtIn="false" value="_DEBUG"/>
+ </option>
<inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.890993403" superClass="cdt.managedbuild.tool.gnu.c.compiler.input"/>
</tool>
<tool id="org.tizen.nativeide.tool.sbi.gnu.c.linker.base.1743186514" name="C Linker" superClass="org.tizen.nativeide.tool.sbi.gnu.c.linker.base"/>
- <tool command="clang++" id="org.tizen.nativecore.tool.sbi.gnu.cpp.linker.1743878166" name="C++ Linker" superClass="org.tizen.nativecore.tool.sbi.gnu.cpp.linker">
+ <tool command="i386-linux-gnueabi-g++" id="org.tizen.nativecore.tool.sbi.gnu.cpp.linker.1743878166" name="C++ Linker" superClass="org.tizen.nativecore.tool.sbi.gnu.cpp.linker">
<option defaultValue="false" id="sbi.gnu.cpp.linker.option.shared_flag.core.1017885244" name="Linker.Shared" superClass="sbi.gnu.cpp.linker.option.shared_flag.core" valueType="boolean"/>
<option defaultValue="false" id="sbi.gnu.cpp.linker.option.noundefined.core.219138009" name="Report unresolved symbol references (-Wl,--no-undefined)" superClass="sbi.gnu.cpp.linker.option.noundefined.core" valueType="boolean"/>
<option id="sbi.gnu.cpp.linker.option.frameworks_lflags.core.588492684" name="Tizen-Frameworks-Other-Lflags" superClass="sbi.gnu.cpp.linker.option.frameworks_lflags.core" valueType="stringList">
private:
CallManagerSRef m_callManager;
SoundManagerSRef m_soundManager;
-
};
}
class IIncomingCall : public ucl::Polymorphic {
public:
virtual ICallInfoSCRef getInfo() const = 0;
+ virtual IRejectMsgProviderSRef getRejectMsgProvider() const = 0;
virtual ucl::Result answer(CallAnswerType type) = 0;
virtual ucl::Result reject() = 0;
+ virtual ucl::Result rejectWithMessage(IRejectMsgSRef message) = 0;
virtual ucl::Result stopAlert() = 0;
};
}
--- /dev/null
+/*
+ * 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_MODEL_I_REJECT_MSG_H__
+#define __CALLUI_MODEL_I_REJECT_MSG_H__
+
+#include "types.h"
+
+namespace callui {
+
+ class IRejectMsg : public ucl::Polymorphic {
+ public:
+ virtual std::string getText() const = 0;
+
+ };
+
+}
+
+#endif // __CALLUI_I_REJECT_MSG_H__
--- /dev/null
+/*
+ * 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_MODEL_I_REJECT_MSG_PROVIDER_H__
+#define __CALLUI_MODEL_I_REJECT_MSG_PROVIDER_H__
+
+#include "types.h"
+
+namespace callui {
+
+ class IRejectMsgProvider : public ucl::Polymorphic {
+ public:
+ virtual RejectMsgList getMsgList() const = 0;
+ virtual int getMsgCount() const = 0;
+ };
+
+}
+
+#endif // __CALLUI_MODEL_I_REJECT_MSG_PROVIDER_H__
#ifndef __CALLUI_MODEL_TYPES_H__
#define __CALLUI_MODEL_TYPES_H__
-#include <list>
+#include <vector>
#include "../types.h"
UCL_DECLARE_REF_ALIASES(IContactInfo);
UCL_DECLARE_REF_ALIASES(IConferenceCallInfo);
+ UCL_DECLARE_REF_ALIASES(IRejectMsgProvider);
+ UCL_DECLARE_REF_ALIASES(IRejectMsg);
+
using CallStateHandler = ucl::Delegate<void(CallEventType)>;
using DialStatusHandler = ucl::Delegate<void(DialStatus)>;
using AudioStateHandler = ucl::Delegate<void(AudioStateType)>;
using MuteStateHandler = ucl::Delegate<void(bool)>;
- using ConfMemberCallList = std::list<IConferenceCallInfoSCRef>;
+ using ConfMemberCallList = std::vector<IConferenceCallInfoSCRef>;
+ using RejectMsgList = std::vector<IRejectMsgSRef>;
}
#endif // __GALLERY_MODEL_TYPES_H__
ucl::Result Call::prepare()
{
- CallClientSRef client = CallClient::newInstance();
- if (!client) {
+ CallClientSRef callClient = CallClient::newInstance();
+ if (!callClient) {
LOG_RETURN(RES_FAIL, "Client::newInstance() failed!");
}
- m_callManager = CallManager::newInstance(client);
+ m_callManager = CallManager::newInstance(callClient);
if (!m_callManager) {
LOG_RETURN(RES_FAIL, "CallManager::newInstance() failed!");
}
- m_soundManager = SoundManager::newInstance(client);
+ m_soundManager = SoundManager::newInstance(callClient);
if (!m_soundManager) {
LOG_RETURN(RES_FAIL, "SoundManage::newInstance() failed!");
}
#include <call-manager.h>
-#include "types.h"
#include "implTypes.h"
namespace callui {
for (; l != nullptr; l = g_slist_next(l)) {
auto confCallInfo = ConferenceCallInfo::newInstance(static_cast<cm_conf_call_data_t *>(l->data));
if (!confCallInfo) {
- ELOG("ConferenceCallInfo::newInstance() failed!");
- res = RES_OUT_OF_MEMORY;
- break;
+ LOG_BREAK(res = RES_OUT_OF_MEMORY, "ConferenceCallInfo::newInstance() failed!");
}
m_confMemberList.push_back(confCallInfo);
}
#include "CallManager.h"
#include "CallClient.h"
+#include "RejectMsgProvider.h"
#include "CallDialer.h"
-
#include "IncomingCall.h"
#include "ActiveCall.h"
#include "HeldCall.h"
using namespace ucl;
- CallManager::CallManager(const CallClientSRef &client):
- m_client(client)
+ CallManager::CallManager(const CallClientSRef &callClient):
+ m_callClient(callClient)
{
}
{
}
- CallManagerSRef CallManager::newInstance(const CallClientSRef &client)
+ CallManagerSRef CallManager::newInstance(const CallClientSRef &callClient)
{
- auto result = makeShared<CallManager>(client);
+ auto result = makeShared<CallManager>(callClient);
FAIL_RETURN_VALUE(result->prepare(), {}, "result->prepare() failed!");
return result;
}
FAIL_RETURN(initCalls(), "initCalls() failed!");
FAIL_RETURN(convertCallManagerResult(
- cm_set_call_event_cb(*m_client, CALLBACK_B(CallManager::callEventCb), this)),
+ cm_set_call_event_cb(*m_callClient, CALLBACK_B(CallManager::callEventCb), this)),
"cm_set_call_event_cb() failed!");
return RES_OK;
cm_call_data_h held = nullptr;
FAIL_RETURN(convertCallManagerResult(
- cm_get_all_calldata(*m_client, &incom, &active, &held)),
+ cm_get_all_calldata(*m_callClient, &incom, &active, &held)),
"cm_get_all_calldata() failed!");
FAIL_RETURN(updateIncomingCall(incom), "updateIncomingCall() failed!");
CallClientSRef CallManager::getCallClient()
{
- return m_client;
+ return m_callClient;
}
ICallDialerWRef CallManager::getDialer()
Result CallManager::endCall(unsigned int callId, CallReleaseType type)
{
return convertCallManagerResult(
- cm_end_call(*m_client, callId, convertCallAppReleaseType(type)));
+ cm_end_call(*m_callClient, callId, convertCallAppReleaseType(type)));
}
Result CallManager::splitCalls(CallInfoSRef callInfo, const IConferenceCallInfoSRef &confCallInfo)
return endCall((*iter)->getCallId(), CallReleaseType::BY_CALL_HANDLE);
}
+ RejectMsgProviderSRef CallManager::getRejectMsgProvider()
+ {
+ if (!m_rejectMsgProvider) {
+ m_rejectMsgProvider = RejectMsgProvider::newInstance();
+ if (!m_rejectMsgProvider) {
+ LOG_RETURN_VALUE(RES_FAIL, {}, "RejectMsgProvider::newInstance() failed!");
+ }
+ }
+
+ return m_rejectMsgProvider;
+ }
+
Result CallManager::processEndCallEvent(cm_call_event_data_h callEventData, SimSlot simSlot)
{
unsigned int callId = 0;
class CallManager final : public ICallManager {
public:
- static CallManagerSRef newInstance(const CallClientSRef &client);
+ static CallManagerSRef newInstance(const CallClientSRef &callClient);
virtual ~CallManager();
CallClientSRef getCallClient();
ucl::Result endCall(unsigned int callId, CallReleaseType type);
- ucl::Result splitCalls(CallInfoSRef callInfo, const IConferenceCallInfoSRef &confCallInfo);
+ ucl::Result splitCalls(CallInfoSRef callInfo,
+ const IConferenceCallInfoSRef &confCallInfo);
+ RejectMsgProviderSRef getRejectMsgProvider();
// ICallManager
ucl::Result updateActiveCall(cm_call_data_h active);
ucl::Result updateHeldCall(cm_call_data_h active);
ucl::Result updateEndCall(cm_call_data_h end, SimSlot slot = SimSlot::DEFAULT);
-
ucl::Result processEndCallEvent(cm_call_event_data_h callEventData, SimSlot slot);
- ucl::Result processCommonCallEvent(cm_call_event_data_h callEventData, CallEventType type, SimSlot simSlot);
+ ucl::Result processCommonCallEvent(cm_call_event_data_h callEventData,
+ CallEventType type, SimSlot simSlot);
void callEventCb(cm_call_event_e call_event, cm_call_event_data_h call_state_data);
private:
- CallClientSRef m_client;
+ CallClientSRef m_callClient;
+ RejectMsgProviderSRef m_rejectMsgProvider;
CallDialerSRef m_dialer;
IncomingCallSRef m_incomingCall;
ActiveCallSRef m_activeCall;
#include "CallManager.h"
#include "CallClient.h"
#include "CallInfo.h"
+#include "RejectMsgProvider.h"
+#include "RejectMsg.h"
#include "common.h"
if (!m_callInfo) {
LOG_RETURN_VALUE(RES_FAIL, RES_FAIL, "CallInfo::newInstance() failed!");
}
+
return RES_OK;
}
return m_callInfo;
}
+ IRejectMsgProviderSRef IncomingCall::getRejectMsgProvider() const
+ {
+ return m_cm.getRejectMsgProvider();
+ }
+
Result IncomingCall::answer(CallAnswerType type)
{
- return convertCallManagerResult(cm_answer_call(*m_cm.getCallClient(),convertCallAppAnswerType(type)));
+ return convertCallManagerResult(cm_answer_call(*m_cm.getCallClient(), convertCallAppAnswerType(type)));
}
Result IncomingCall::reject()
return convertCallManagerResult(cm_reject_call(*m_cm.getCallClient()));
}
+ Result IncomingCall::rejectWithMessage(IRejectMsgSRef message)
+ {
+ FAIL_RETURN(reject(), "reject() failed!");
+
+ auto msg = dynamicRefCast<RejectMsg>(message);
+ if (!msg) {
+ LOG_RETURN(RES_FAIL, "message is not RejectMsg type!");
+ }
+ return msg->send(m_callInfo->getPhoneNumber(), m_simSlot);
+ }
+
Result IncomingCall::stopAlert()
{
return convertCallManagerResult(cm_stop_alert(*m_cm.getCallClient()));
}
+
}
// IIncomingCall
virtual ICallInfoSCRef getInfo() const override final;
+ virtual IRejectMsgProviderSRef getRejectMsgProvider() const override final;
virtual ucl::Result answer(CallAnswerType type) override final;
virtual ucl::Result reject() override final;
+ virtual ucl::Result rejectWithMessage(IRejectMsgSRef message) override final;
virtual ucl::Result stopAlert() override final;
private:
--- /dev/null
+/*
+ * 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 "MsgClient.h"
+
+#include <msg.h>
+#include <msg_transport.h>
+
+#include "common.h"
+
+namespace callui {
+
+ using namespace ucl;
+
+ MsgClient::MsgClient():
+ m_handle(nullptr)
+ {
+ }
+
+ MsgClient::~MsgClient()
+ {
+ msg_close_msg_handle(&m_handle);
+ }
+
+ MsgClientSRef MsgClient::newInstance()
+ {
+ auto result = makeShared<MsgClient>();
+ FAIL_RETURN_VALUE(result->prepare(), {}, "result->prepare() failed!");
+ return result;
+ }
+
+ Result MsgClient::prepare()
+ {
+ msg_error_t err = msg_open_msg_handle(&m_handle);
+ if (err != MSG_SUCCESS) {
+ LOG_RETURN(RES_FAIL, "msg_open_msg_handle() failed! res[%d]", err);
+ }
+
+ err = msg_reg_sent_status_callback(m_handle, [](msg_handle_t msgHandle, msg_struct_t status, void *data)
+ {
+ if(!status)
+ LOG_RETURN_VOID(RES_FAIL, "status is NULL");
+
+ int msgNetworkStatus = MSG_NETWORK_SEND_FAIL;
+ msg_get_int_value(status, MSG_SENT_STATUS_NETWORK_STATUS_INT, &msgNetworkStatus);
+ DLOG("Message sent status [%d]", msgNetworkStatus);
+ }, NULL);
+ if (err != MSG_SUCCESS) {
+ LOG_RETURN(RES_FAIL, "msg_reg_sent_status_callback() failed! res[%d]", err);
+ }
+
+ return RES_OK;
+ }
+
+ msg_handle_t MsgClient::getMsgHandle() const
+ {
+ return m_handle;
+ }
+
+ MsgClient::operator msg_handle_t() const
+ {
+ return getMsgHandle();
+ }
+
+}
--- /dev/null
+/*
+ * 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_MODEL_MSG_CLIENT_H__
+#define __CALLUI_MODEL_MSG_CLIENT_H__
+
+#include <msg_types.h>
+
+#include "implTypes.h"
+
+namespace callui {
+
+ class MsgClient {
+ public:
+ static MsgClientSRef newInstance();
+ virtual ~MsgClient();
+ msg_handle_t getMsgHandle() const;
+ operator msg_handle_t() const;
+
+ private:
+ friend class ucl::RefCountObj<MsgClient>;
+ MsgClient();
+
+ ucl::Result prepare();
+
+ private:
+ msg_handle_t m_handle;
+ };
+
+}
+
+#endif // __CALLUI_MODEL_MSG_CLIENT_H__
--- /dev/null
+/*
+ * 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 "RejectMsg.h"
+
+#include <msg.h>
+#include <msg_transport.h>
+
+#include "MsgClient.h"
+
+#include "common.h"
+
+namespace callui {
+
+ using namespace ucl;
+
+ RejectMsg::RejectMsg(MsgClientSRef client, const TString &string):
+ m_msgClient(client),
+ m_msg(string)
+ {
+ }
+
+ RejectMsg::~RejectMsg()
+ {
+ }
+
+ RejectMsgSRef RejectMsg::newInstance(MsgClientSRef client, const TString &string)
+ {
+ return makeShared<RejectMsg>(client, string);
+ }
+
+ std::string RejectMsg::getText() const
+ {
+ return m_msg;
+ }
+
+ Result RejectMsg::send(const std::string &phoneNumber, SimSlot slot)
+ {
+ if (phoneNumber.empty()) {
+ LOG_RETURN(RES_FAIL, "Phone Number is NULL");
+ }
+
+ if (!m_msgClient) {
+ LOG_RETURN(RES_FAIL, "Client is NULL");
+ }
+
+ Result res = RES_FAIL;
+
+ msg_struct_t msgInfo = msg_create_struct(MSG_STRUCT_MESSAGE_INFO);
+ msg_struct_t sendOpt = msg_create_struct(MSG_STRUCT_SENDOPT);
+ msg_struct_t reqInfo = msg_create_struct(MSG_STRUCT_REQUEST_INFO);
+ const char *msgText = m_msg.translate();
+
+ // Set message type to SMS reject
+ msg_set_int_value(msgInfo, MSG_MESSAGE_TYPE_INT, MSG_TYPE_SMS_REJECT);
+
+ int slotId = convertEnumValueToInt(slot);
+ DLOG("msg_sms_send_message() Sim slot [%d]", slotId);
+ // TODO: need to investigate whether this is needed
+ slotId++;
+ msg_set_int_value(msgInfo, MSG_MESSAGE_SIM_INDEX_INT, slotId);
+
+ // No setting send option
+ msg_set_bool_value(sendOpt, MSG_SEND_OPT_SETTING_BOOL, false);
+
+ // Set message body
+ if (msg_set_str_value(msgInfo, MSG_MESSAGE_SMS_DATA_STR, msgText, strlen(msgText)) != MSG_SUCCESS) {
+ ELOG("msg_set_str_value() failed!");
+ } else {
+ // Create address list
+ msg_struct_list_s *addrList = nullptr;
+ msg_get_list_handle(msgInfo, MSG_MESSAGE_ADDR_LIST_STRUCT, (void **)&addrList);
+ msg_struct_t addrInfo = addrList->msg_struct_info[0];
+ const char *number = phoneNumber.c_str();
+
+ // Set message address
+ msg_set_int_value(addrInfo, MSG_ADDRESS_INFO_RECIPIENT_TYPE_INT, MSG_RECIPIENTS_TYPE_TO);
+ msg_set_str_value(addrInfo, MSG_ADDRESS_INFO_ADDRESS_VALUE_STR, number, strlen(number));
+ addrList->nCount = 1;
+
+ // Set message struct to Request
+ msg_set_struct_handle(reqInfo, MSG_REQUEST_MESSAGE_HND, msgInfo);
+ msg_set_struct_handle(reqInfo, MSG_REQUEST_SENDOPT_HND, sendOpt);
+
+ // Send message
+ int err = msg_sms_send_message(*m_msgClient, reqInfo);
+ if (err != MSG_SUCCESS) {
+ ELOG("msg_sms_send_message() failed. err[%d]", err);
+ } else {
+ DLOG("Sending...");
+ res = RES_OK;
+ }
+ }
+ msg_release_struct(&reqInfo);
+ msg_release_struct(&msgInfo);
+ msg_release_struct(&sendOpt);
+
+ return res;
+ }
+
+}
--- /dev/null
+/*
+ * 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_MODEL_REJECT_MSG_H__
+#define __CALLUI_MODEL_REJECT_MSG_H__
+
+#include "model/IRejectMsg.h"
+
+#include "ucl/misc/TString.h"
+
+#include "implTypes.h"
+
+namespace callui {
+
+ class RejectMsg : public IRejectMsg {
+ public:
+ static RejectMsgSRef newInstance(MsgClientSRef client, const ucl::TString &string);
+ virtual ~RejectMsg();
+
+ ucl::Result send(const std::string &number, SimSlot slot);
+
+ // IRejectMsg
+ std::string getText() const override final;
+
+ private:
+ friend class ucl::RefCountObj<RejectMsg>;
+ RejectMsg(MsgClientSRef client, const ucl::TString &string);
+
+ ucl::Result prepare();
+
+ private:
+ MsgClientWRef m_msgClient;
+ ucl::TString m_msg;
+ };
+
+}
+
+#endif // __CALLUI_MODEL_REJECT_MSG_H__
--- /dev/null
+/*
+ * 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 "RejectMsgProvider.h"
+
+#include <vconf.h>
+
+#include "MsgClient.h"
+#include "RejectMsg.h"
+
+#include "common.h"
+
+namespace callui {
+
+ using namespace ucl;
+
+ RejectMsgProvider::RejectMsgProvider()
+ {
+ }
+
+ RejectMsgProvider::~RejectMsgProvider()
+ {
+ }
+
+ RejectMsgProviderSRef RejectMsgProvider::newInstance()
+ {
+ auto result = makeShared<RejectMsgProvider>();
+ FAIL_RETURN_VALUE(result->prepare(), {}, "result->prepare() failed!");
+ return result;
+ }
+
+ Result RejectMsgProvider::prepare()
+ {
+ m_msgClient = MsgClient::newInstance();
+ if (!m_msgClient) {
+ LOG_RETURN(RES_FAIL, "msgClient::newInstance() failed!");
+ }
+
+ return RES_OK;
+ }
+
+ const char *getVconfKey(int index)
+ {
+ switch (index) {
+ case 0: return VCONFKEY_CISSAPPL_USER_CREATE_MSG1_STR;
+ case 1: return VCONFKEY_CISSAPPL_USER_CREATE_MSG2_STR;
+ case 2: return VCONFKEY_CISSAPPL_USER_CREATE_MSG3_STR;
+ case 3: return VCONFKEY_CISSAPPL_USER_CREATE_MSG4_STR;
+ case 4: return VCONFKEY_CISSAPPL_USER_CREATE_MSG5_STR;
+ case 5: return VCONFKEY_CISSAPPL_USER_CREATE_MSG6_STR;
+ default:
+ return nullptr;
+ }
+ }
+
+ IRejectMsgSRef RejectMsgProvider::getRejectMsgByIndex(int index) const
+ {
+ const char *vconfKey = getVconfKey(index);
+ if(!vconfKey) {
+ LOG_RETURN_VALUE(RES_FAIL, {}, "Key not found");
+ }
+
+ char *message = vconf_get_str(vconfKey);
+ if (!message) {
+ LOG_RETURN_VALUE(RES_FAIL, {}, "message is empty");
+ }
+
+ RejectMsgSRef msg = RejectMsg::newInstance(m_msgClient, {message, true});
+ if (!msg) {
+ ELOG("RejectMsg::newInstance() failed!");
+ }
+ free(message);
+ return msg;
+ }
+
+ RejectMsgList RejectMsgProvider::getMsgList() const
+ {
+ RejectMsgList list;
+ int count = getMsgCount();
+ int i = 0;
+
+ while (count) {
+ IRejectMsgSRef ref = getRejectMsgByIndex(i);
+ if (ref) {
+ list.push_back(ref);
+ count--;
+ }
+ i++;
+ }
+ return list;
+ }
+
+ int RejectMsgProvider::getMsgCount() const
+ {
+ int count = 0;
+ if (vconf_get_int(VCONFKEY_CISSAPPL_REJECT_CALL_MSG_INT, &count) != 0) {
+ LOG_RETURN_VALUE(RES_FAIL, 0, "vconf_get_int() failed!");
+ }
+ return count;
+ }
+}
--- /dev/null
+/*
+ * 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_MODEL_REJECT_MSG_PROVIDER_H__
+#define __CALLUI_MODEL_REJECT_MSG_PROVIDER_H__
+
+#include "model/IRejectMsgProvider.h"
+
+#include "implTypes.h"
+
+namespace callui {
+
+ class RejectMsgProvider : public IRejectMsgProvider {
+ public:
+ static RejectMsgProviderSRef newInstance();
+ virtual ~RejectMsgProvider();
+
+ // IRejectMsgProvider
+
+ virtual RejectMsgList getMsgList() const override final;
+ virtual int getMsgCount() const override final;
+
+ private:
+ friend class ucl::RefCountObj<RejectMsgProvider>;
+ RejectMsgProvider();
+
+ ucl::Result prepare();
+ IRejectMsgSRef getRejectMsgByIndex(int index) const;
+
+ private:
+ MsgClientSRef m_msgClient;
+ };
+
+}
+
+#endif // __CALLUI_MODEL_REJECT_MSG_PROVIDER_H__
#define __CALLUI_MODEL_HELPERS_H__
#include <call-manager-ext.h>
+#include <type_traits>
#include "model/types.h"
ucl::Result convertCallManagerEventType(cm_call_event_e cmEvent, CallEventType *appEvent);
cm_call_answer_type_e convertCallAppAnswerType(CallAnswerType type);
+
+ template<typename TYPE>
+ constexpr auto convertEnumValueToInt(TYPE e) -> typename std::underlying_type<TYPE>::type
+ {
+ return static_cast<typename std::underlying_type<TYPE>::type>(e);
+ }
}
#include "helpers.hpp"
return CALL_ANSWER_TYPE_NORMAL;
}
}
+
}
UCL_DECLARE_REF_ALIASES(ContactInfo);
UCL_DECLARE_REF_ALIASES(ConferenceCallInfo);
+ UCL_DECLARE_REF_ALIASES(MsgClient);
+ UCL_DECLARE_REF_ALIASES(RejectMsgProvider);
+ UCL_DECLARE_REF_ALIASES(RejectMsg);
+
using CallStateEvent = ucl::Event<CallStateHandler>;
using AudioStateEvent = ucl::Event<AudioStateHandler>;
using MuteStateEvent = ucl::Event<MuteStateHandler>;