TizenRefApp-8335 [Call UI] Implement RejectMsgProvider 60/123560/4
authorIgor Olshevskyi <i.olshevskyi@samsung.com>
Wed, 5 Apr 2017 11:42:48 +0000 (14:42 +0300)
committerIgor Olshevskyi <i.olshevskyi@samsung.com>
Fri, 7 Apr 2017 09:06:39 +0000 (12:06 +0300)
Change-Id: Id3dedd18a91f51ceb491d096928fd785ef4bd4b0

22 files changed:
.cproject
inc/model/Call.h
inc/model/IIncomingCall.h
inc/model/IRejectMsg.h [new file with mode: 0644]
inc/model/IRejectMsgProvider.h [new file with mode: 0644]
inc/model/types.h
src/model/Call.cpp
src/model/CallClient.h
src/model/CallInfo.cpp
src/model/CallManager.cpp
src/model/CallManager.h
src/model/IncomingCall.cpp
src/model/IncomingCall.h
src/model/MsgClient.cpp [new file with mode: 0644]
src/model/MsgClient.h [new file with mode: 0644]
src/model/RejectMsg.cpp [new file with mode: 0644]
src/model/RejectMsg.h [new file with mode: 0644]
src/model/RejectMsgProvider.cpp [new file with mode: 0644]
src/model/RejectMsgProvider.h [new file with mode: 0644]
src/model/helpers.h
src/model/helpers.hpp
src/model/implTypes.h

index de009a078ef6644202a6c723c9d326d3735eb7f0..7809432a0a5e3abf4f9fd2721c366582a62d2a09 100644 (file)
--- a/.cproject
+++ b/.cproject
@@ -3,6 +3,9 @@
        <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="&quot;${SBI_SYSROOT}/usr/include/libxml2&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/EGL&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/GLES&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/GLES2&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/GLES3&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/KHR&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/SDL2&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/appcore/&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/appcore-agent&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/appcore-watch&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/appfw&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/aul/&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/badge&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/base&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/cairo&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/calendar-service2&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/call-manager&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/chromium-ewk&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/ckm&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/contacts-svc&quot;"/>
@@ -73,6 +73,7 @@
                                                                        <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/efl-1&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/efl-extension&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/efreet-1&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/EGL&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/eina-1&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/eina-1/eina&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/eio-1&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/fontconfig&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/freetype2&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/gio-unix-2.0&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/GLES&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/GLES2&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/GLES3&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/glib-2.0&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/harfbuzz&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/iotcon&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/json-glib-1.0&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/KHR&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/location&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/maps&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/media&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/notification&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/nsd/&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/phonenumber-utils&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/pkgmgr&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/rua/&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/SDL2&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/sensor&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/storage&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/system&quot;"/>
                                                                        <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="&quot;${SBI_SYSROOT}/usr/include/libxml2&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/EGL&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/GLES&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/GLES2&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/GLES3&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/KHR&quot;"/>
-                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/SDL2&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/appcore/&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/appcore-agent&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/appcore-watch&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/appfw&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/aul/&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/badge&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/base&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/cairo&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/calendar-service2&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/call-manager&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/chromium-ewk&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/ckm&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/contacts-svc&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/efl-1&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/efl-extension&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/efreet-1&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/EGL&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/eina-1&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/eina-1/eina&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/eio-1&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/fontconfig&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/freetype2&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/gio-unix-2.0&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/GLES&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/GLES2&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/GLES3&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/glib-2.0&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/harfbuzz&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/iotcon&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/json-glib-1.0&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/KHR&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/location&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/maps&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/media&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/notification&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/nsd/&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/phonenumber-utils&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/pkgmgr&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/rua/&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/SDL2&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/sensor&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/storage&quot;"/>
                                                                        <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/system&quot;"/>
                                                                        <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">
index d3331e0240cbba8f3f542fe3405abfd28df66325..15183cf38cac6d16444a6692439c5b50c2d9f592 100644 (file)
@@ -41,7 +41,6 @@ namespace callui {
        private:
                CallManagerSRef m_callManager;
                SoundManagerSRef m_soundManager;
-
        };
 
 }
index caa0ff0a4d8739a82b340e6a3525d195cd0b5014..35d6b90563d2c8246ddd576a0311efa5dbc8a5b8 100644 (file)
@@ -24,8 +24,10 @@ namespace callui {
        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;
        };
 }
diff --git a/inc/model/IRejectMsg.h b/inc/model/IRejectMsg.h
new file mode 100644 (file)
index 0000000..364fc1c
--- /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.
+ */
+
+#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__
diff --git a/inc/model/IRejectMsgProvider.h b/inc/model/IRejectMsgProvider.h
new file mode 100644 (file)
index 0000000..15db628
--- /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.
+ */
+
+#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__
index b59db375522627e9fe8082c97148e35414135b68..5fb856ada107be3ac3fb0f91694a0efef8920a70 100644 (file)
@@ -17,7 +17,7 @@
 #ifndef __CALLUI_MODEL_TYPES_H__
 #define __CALLUI_MODEL_TYPES_H__
 
-#include <list>
+#include <vector>
 
 #include "../types.h"
 
@@ -108,6 +108,9 @@ namespace callui {
        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)>;
@@ -115,7 +118,8 @@ namespace callui {
        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__
index 7cc8828648274d905d417021dfe91c86051e0fad..b79724b13de41674ffed30952b0cfe62adbb842d 100644 (file)
@@ -43,17 +43,17 @@ namespace callui {
 
        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!");
                }
index 3bdea832a38d2f165ee4f6087cf221e6c8be558b..2e83d87fd5e956299d31ac60e8de58ff326105ff 100644 (file)
@@ -19,7 +19,6 @@
 
 #include <call-manager.h>
 
-#include "types.h"
 #include "implTypes.h"
 
 namespace callui {
index 31fddd6a3fbb83d8be67b58fc784d4508160c32d..ac307637e44fffdc2aa39724d1f93437e7470b6f 100644 (file)
@@ -119,9 +119,7 @@ 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);
                        }
index caeab72453606f5f1f1e37ac1989da847d876b73..810cf8a9250b5ee311f4e800d0f19d9e6e1458c0 100644 (file)
@@ -17,8 +17,8 @@
 #include "CallManager.h"
 
 #include "CallClient.h"
+#include "RejectMsgProvider.h"
 #include "CallDialer.h"
-
 #include "IncomingCall.h"
 #include "ActiveCall.h"
 #include "HeldCall.h"
@@ -33,8 +33,8 @@ namespace callui {
 
        using namespace ucl;
 
-       CallManager::CallManager(const CallClientSRef &client):
-                       m_client(client)
+       CallManager::CallManager(const CallClientSRef &callClient):
+                       m_callClient(callClient)
        {
        }
 
@@ -42,9 +42,9 @@ namespace callui {
        {
        }
 
-       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;
        }
@@ -59,7 +59,7 @@ namespace callui {
                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;
@@ -72,7 +72,7 @@ namespace callui {
                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!");
@@ -140,7 +140,7 @@ namespace callui {
 
        CallClientSRef CallManager::getCallClient()
        {
-               return m_client;
+               return m_callClient;
        }
 
        ICallDialerWRef CallManager::getDialer()
@@ -181,7 +181,7 @@ namespace callui {
        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)
@@ -199,6 +199,18 @@ namespace callui {
                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;
index 1470abc930c2509966170edb873359eb231ea594..56c2199c4005d02ff64915512e147f78152e13bc 100644 (file)
@@ -29,12 +29,14 @@ namespace callui {
 
        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
 
@@ -56,13 +58,14 @@ namespace callui {
                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;
index 4f803f24b352e1e68b8519a99f8c62ab53775711..0c05ccdfe67c2365b42cf7b60030b6853963234a 100644 (file)
@@ -20,6 +20,8 @@
 #include "CallManager.h"
 #include "CallClient.h"
 #include "CallInfo.h"
+#include "RejectMsgProvider.h"
+#include "RejectMsg.h"
 
 #include "common.h"
 
@@ -55,6 +57,7 @@ namespace callui {
                if (!m_callInfo) {
                        LOG_RETURN_VALUE(RES_FAIL, RES_FAIL, "CallInfo::newInstance() failed!");
                }
+
                return RES_OK;
        }
 
@@ -63,9 +66,14 @@ namespace callui {
                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()
@@ -73,8 +81,20 @@ namespace callui {
                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()));
        }
+
 }
index a7261a5d57eb1c6c2b8f2489dc9607f1e7a29145..f64f73e8f966a418feaebf719e029c6a0ea23b0d 100644 (file)
@@ -39,8 +39,10 @@ namespace callui {
                // 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:
diff --git a/src/model/MsgClient.cpp b/src/model/MsgClient.cpp
new file mode 100644 (file)
index 0000000..2a7b0fc
--- /dev/null
@@ -0,0 +1,78 @@
+/*
+ * 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();
+       }
+
+}
diff --git a/src/model/MsgClient.h b/src/model/MsgClient.h
new file mode 100644 (file)
index 0000000..3ce3e3e
--- /dev/null
@@ -0,0 +1,45 @@
+/*
+ * 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__
diff --git a/src/model/RejectMsg.cpp b/src/model/RejectMsg.cpp
new file mode 100644 (file)
index 0000000..0a658f7
--- /dev/null
@@ -0,0 +1,114 @@
+/*
+ * 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;
+       }
+
+}
diff --git a/src/model/RejectMsg.h b/src/model/RejectMsg.h
new file mode 100644 (file)
index 0000000..9df6e6e
--- /dev/null
@@ -0,0 +1,51 @@
+/*
+ * 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__
diff --git a/src/model/RejectMsgProvider.cpp b/src/model/RejectMsgProvider.cpp
new file mode 100644 (file)
index 0000000..fe33f19
--- /dev/null
@@ -0,0 +1,114 @@
+/*
+ * 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;
+       }
+}
diff --git a/src/model/RejectMsgProvider.h b/src/model/RejectMsgProvider.h
new file mode 100644 (file)
index 0000000..ed13cf6
--- /dev/null
@@ -0,0 +1,49 @@
+/*
+ * 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__
index 46448253bb9ae14458a71ae1a7243320221a7709..99b3df2403a2abd75291feb754db7c407d917b2e 100644 (file)
@@ -18,6 +18,7 @@
 #define __CALLUI_MODEL_HELPERS_H__
 
 #include <call-manager-ext.h>
+#include <type_traits>
 
 #include "model/types.h"
 
@@ -38,6 +39,12 @@ namespace callui {
        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"
index cf8598de3b8fd37c528d1a552d22386f8532f41e..a2f0524cf0da5e823e5559b3cf95bebf8d0658cb 100644 (file)
@@ -150,4 +150,5 @@ namespace callui {
                        return CALL_ANSWER_TYPE_NORMAL;
                }
        }
+
 }
index c943d140f29baabddc04843d60466fe47a3a3297..27edbe7b0e53a230e4ab7293e94e0f87b73b0c0e 100644 (file)
@@ -37,6 +37,10 @@ namespace callui {
        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>;