Tizen 2.1 base
authorJinkun Jang <jinkun.jang@samsung.com>
Tue, 12 Mar 2013 16:50:59 +0000 (01:50 +0900)
committerJinkun Jang <jinkun.jang@samsung.com>
Tue, 12 Mar 2013 16:50:59 +0000 (01:50 +0900)
58 files changed:
CMakeLists.txt [new file with mode: 0755]
LICENSE.APLv2 [new file with mode: 0644]
NOTICE [new file with mode: 0644]
inc/FTelCallInfo.h [new file with mode: 0755]
inc/FTelCallManager.h [new file with mode: 0755]
inc/FTelITelephonyCallEventListener.h [new file with mode: 0644]
inc/FTelITelephonyCallForwardListener.h [new file with mode: 0755]
inc/FTelITelephonyNetworkEventListener.h [new file with mode: 0644]
inc/FTelITelephonyNetworkSettingListener.h [new file with mode: 0755]
inc/FTelNetworkInfo.h [new file with mode: 0755]
inc/FTelNetworkManager.h [new file with mode: 0755]
inc/FTelNetworkStatus.h [new file with mode: 0755]
inc/FTelSimInfo.h [new file with mode: 0755]
inc/FTelTypes.h [new file with mode: 0644]
inc/FTelephony.h [new file with mode: 0644]
osp-telephony.manifest [new file with mode: 0644]
osp-telephony.pc.in [new file with mode: 0755]
packaging/osp-telephony.spec [new file with mode: 0644]
src/FTelCallInfo.cpp [new file with mode: 0644]
src/FTelCallManager.cpp [new file with mode: 0644]
src/FTelNetworkInfo.cpp [new file with mode: 0644]
src/FTelNetworkManager.cpp [new file with mode: 0644]
src/FTelNetworkStatus.cpp [new file with mode: 0644]
src/FTelSimInfo.cpp [new file with mode: 0644]
src/FTel_CallForwardEvent.cpp [new file with mode: 0644]
src/FTel_CallForwardEvent.h [new file with mode: 0644]
src/FTel_CallForwardEventArg.cpp [new file with mode: 0644]
src/FTel_CallForwardEventArg.h [new file with mode: 0644]
src/FTel_CallInfoImpl.cpp [new file with mode: 0644]
src/FTel_CallInfoImpl.h [new file with mode: 0644]
src/FTel_CallManagerEvent.cpp [new file with mode: 0644]
src/FTel_CallManagerEvent.h [new file with mode: 0644]
src/FTel_CallManagerEventArg.cpp [new file with mode: 0644]
src/FTel_CallManagerEventArg.h [new file with mode: 0644]
src/FTel_CallManagerImpl.cpp [new file with mode: 0644]
src/FTel_CallManagerImpl.h [new file with mode: 0644]
src/FTel_NetworkInfoImpl.cpp [new file with mode: 0644]
src/FTel_NetworkInfoImpl.h [new file with mode: 0644]
src/FTel_NetworkManagerEvent.cpp [new file with mode: 0644]
src/FTel_NetworkManagerEvent.h [new file with mode: 0644]
src/FTel_NetworkManagerEventArg.cpp [new file with mode: 0644]
src/FTel_NetworkManagerEventArg.h [new file with mode: 0644]
src/FTel_NetworkManagerImpl.cpp [new file with mode: 0755]
src/FTel_NetworkManagerImpl.h [new file with mode: 0644]
src/FTel_NetworkSettingEvent.cpp [new file with mode: 0644]
src/FTel_NetworkSettingEvent.h [new file with mode: 0644]
src/FTel_NetworkSettingEventArg.cpp [new file with mode: 0644]
src/FTel_NetworkSettingEventArg.h [new file with mode: 0644]
src/FTel_NetworkStatusImpl.cpp [new file with mode: 0644]
src/FTel_NetworkStatusImpl.h [new file with mode: 0644]
src/FTel_SimInfoImpl.cpp [new file with mode: 0644]
src/FTel_SimInfoImpl.h [new file with mode: 0644]
src/FTel_TelephonyIpcMessages.cpp [new file with mode: 0644]
src/FTel_TelephonyIpcProxy.cpp [new file with mode: 0644]
src/FTel_TelephonyIpcProxy.h [new file with mode: 0644]
src/FTel_TelephonyUtility.cpp [new file with mode: 0644]
src/FTel_TelephonyUtility.h [new file with mode: 0644]
src/inc/FTel_ConnectivityIpcMessages.h [new file with mode: 0644]

diff --git a/CMakeLists.txt b/CMakeLists.txt
new file mode 100755 (executable)
index 0000000..2bfb286
--- /dev/null
@@ -0,0 +1,110 @@
+CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
+
+SET (this_target osp-telephony)
+
+SET(LIBRARY_OUTPUT_PATH ${CMAKE_SOURCE_DIR}/cmake_build_tmp/output)
+
+INCLUDE_DIRECTORIES(
+       inc
+       src
+       src/inc
+       /usr/include/chromium
+       /usr/include/glib-2.0 
+       /usr/lib/glib-2.0/include
+       /usr/include/telephony
+       /usr/include/telephony-client
+       /usr/include/network
+       /usr/include/osp
+       /usr/include/osp/app
+       /usr/include/osp/base
+       /usr/include/osp/io
+       /usr/include/osp/net
+       /usr/include/osp/security
+       )
+
+SET (${this_target}_SOURCE_FILES
+  src/FTelCallInfo.cpp
+  src/FTelCallManager.cpp
+       src/FTelNetworkInfo.cpp
+       src/FTelNetworkManager.cpp
+       src/FTelNetworkStatus.cpp
+       src/FTelSimInfo.cpp
+       src/FTel_SimInfoImpl.cpp
+       src/FTel_NetworkInfoImpl.cpp
+       src/FTel_NetworkManagerImpl.cpp
+       src/FTel_NetworkStatusImpl.cpp
+       src/FTel_TelephonyIpcProxy.cpp
+       src/FTel_TelephonyIpcMessages.cpp
+       src/FTel_TelephonyUtility.cpp
+       src/FTel_CallInfoImpl.cpp
+  src/FTel_CallManagerImpl.cpp
+  src/FTel_NetworkManagerEvent.cpp
+  src/FTel_NetworkManagerEventArg.cpp
+  src/FTel_NetworkSettingEvent.cpp
+  src/FTel_NetworkSettingEventArg.cpp
+  src/FTel_NetworkManagerEvent.cpp
+  src/FTel_NetworkManagerEventArg.cpp
+  src/FTel_CallManagerEvent.cpp
+  src/FTel_CallManagerEventArg.cpp
+  src/FTel_CallForwardEvent.cpp
+  src/FTel_CallForwardEventArg.cpp    
+)
+
+SET(EXTRA_CFLAGS  "${EXTRA_CFLAGS} -Wall" )
+
+## SET C COMPILER FLAGS
+SET(CMAKE_C_FLAGS "${OSP_DEBUG_FLAGS} ${OSP_OPT_FLAGS} ${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} ${OSP_COMPILER_FLAGS}")
+
+## SET CPP COMPILER FLAGS
+SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden")
+SET(CMAKE_CXX_FLAGS "${OSP_DEBUG_FLAGS} ${OSP_OPT_FLAGS} ${CMAKE_CXX_FLAGS} ${EXTRA_CFLAGS} ${OSP_COMPILER_FLAGS}")
+
+## Create Library
+ADD_LIBRARY (${this_target} SHARED ${${this_target}_SOURCE_FILES})
+
+## SET DEPENDENCY FLAGS
+ADD_DEPENDENCIES(${this_target} chromium osp-appfw)
+
+## SET LINKER FLAGS
+SET(CMAKE_SHARED_LINKER_FLAGS -Wl,--no-undefined)
+
+TARGET_LINK_LIBRARIES(${this_target} "-lchromium" )
+TARGET_LINK_LIBRARIES(${this_target} "-L/usr/lib/osp -losp-appfw -losp-net" )
+TARGET_LINK_LIBRARIES(${this_target} "-lcapi-telephony-network-info" )
+TARGET_LINK_LIBRARIES(${this_target} "-lcapi-telephony-sim" )
+TARGET_LINK_LIBRARIES(${this_target} "-lSLP-tapi" )
+TARGET_LINK_LIBRARIES(${this_target} "-lcapi-network-connection" )
+TARGET_LINK_LIBRARIES(${this_target} "-lpthread" )
+
+SET_TARGET_PROPERTIES(${this_target} 
+       PROPERTIES 
+       VERSION ${FULLVER}
+       SOVERSION ${MAJORVER}
+       CLEAN_DIRECT_OUTPUT 1
+       )
+
+ADD_CUSTOM_COMMAND(TARGET ${this_target}
+    POST_BUILD
+               COMMAND ${CMAKE_COMMAND} -E copy ${LIBRARY_OUTPUT_PATH}/${CMAKE_SHARED_LIBRARY_PREFIX}${this_target}${CMAKE_SHARED_LIBRARY_SUFFIX} ${LIBRARY_OUTPUT_PATH}/debug/${CMAKE_SHARED_LIBRARY_PREFIX}${this_target}${CMAKE_SHARED_LIBRARY_SUFFIX}.${FULLVER} 
+               COMMAND ${CMAKE_COMMAND} -E create_symlink ${CMAKE_SHARED_LIBRARY_PREFIX}${this_target}${CMAKE_SHARED_LIBRARY_SUFFIX}.${FULLVER} ${LIBRARY_OUTPUT_PATH}/debug/${CMAKE_SHARED_LIBRARY_PREFIX}${this_target}${CMAKE_SHARED_LIBRARY_SUFFIX}.${MAJORVER}
+               COMMAND ${CMAKE_STRIP} --strip-unneeded ${LIBRARY_OUTPUT_PATH}/${CMAKE_SHARED_LIBRARY_PREFIX}${this_target}${CMAKE_SHARED_LIBRARY_SUFFIX}
+    COMMENT "strip ${this_target}"
+               )   
+
+INSTALL(DIRECTORY ${LIBRARY_OUTPUT_PATH}/ DESTINATION lib/osp 
+                               FILES_MATCHING PATTERN "*.so*" 
+                               PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ                                          
+                                                                               GROUP_EXECUTE GROUP_READ
+                                                                               WORLD_EXECUTE WORLD_READ)
+INSTALL(DIRECTORY ${LIBRARY_OUTPUT_PATH}/debug/ DESTINATION lib/osp/debug 
+                               FILES_MATCHING PATTERN "*.so*" 
+                               PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ                                          
+                                                                               GROUP_EXECUTE GROUP_READ
+                                                                               WORLD_EXECUTE WORLD_READ)
+
+INSTALL(DIRECTORY ${CMAKE_SOURCE_DIR}/inc/ DESTINATION include/osp FILES_MATCHING PATTERN "*.h")
+INSTALL(DIRECTORY ${CMAKE_SOURCE_DIR}/src/inc/ DESTINATION include/osp/telephony FILES_MATCHING PATTERN "*.h")
+
+# pkgconfig file
+CONFIGURE_FILE(${this_target}.pc.in ${CMAKE_SOURCE_DIR}/${this_target}.pc @ONLY)
+INSTALL(FILES ${CMAKE_SOURCE_DIR}/${this_target}.pc DESTINATION lib/pkgconfig)
diff --git a/LICENSE.APLv2 b/LICENSE.APLv2
new file mode 100644 (file)
index 0000000..d645695
--- /dev/null
@@ -0,0 +1,202 @@
+
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright [yyyy] [name of copyright owner]
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   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.
diff --git a/NOTICE b/NOTICE
new file mode 100644 (file)
index 0000000..cbdf92f
--- /dev/null
+++ b/NOTICE
@@ -0,0 +1,3 @@
+Copyright (c) 2012-2013 Samsung Electronics Co., Ltd. All rights reserved.
+Except as noted, this software is licensed under Apache License, Version 2.
+Please, see the LICENSE.APLv2 file for Apache License terms and conditions.
diff --git a/inc/FTelCallInfo.h b/inc/FTelCallInfo.h
new file mode 100755 (executable)
index 0000000..efd3734
--- /dev/null
@@ -0,0 +1,135 @@
+//
+// Open Service Platform
+// Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Apache License, Version 2.0 (the License);
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// 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.
+//
+/**
+ * @file    FTelCallInfo.h
+ * @brief   This is the header file for the %CallInfo class.
+ *
+ * This header file contains the declarations of the %CallInfo class.
+ */
+#ifndef _FTEL_CALL_INFO_H_
+#define _FTEL_CALL_INFO_H_
+
+#include <FBase.h>
+#include <FTelTypes.h>
+
+namespace Tizen { namespace Telephony
+{
+class _CallInfoImpl;
+
+/**
+ * @class   CallInfo
+ * @brief   This class provides methods to obtain detailed information about a call.
+ *
+ * @since   2.0
+ *
+ * The %CallInfo class provides methods to obtain detailed call information, such as the call type and number.
+ */
+class _OSP_EXPORT_ CallInfo
+       : public Tizen::Base::Object
+{
+public:
+       /**
+     * This is the default constructor for this class.
+     *
+     * @since   2.0
+     */
+       CallInfo(void);
+
+       /**
+     * Copying of objects using this copy constructor is allowed.
+     *
+     * @since   2.0
+     *
+     * @param[in] rhs The call information
+     */
+       CallInfo(const CallInfo& rhs);
+
+       /**
+     * This destructor overrides Tizen::Base::Object::~Object().        
+     *
+     * @since   2.0
+     */
+       virtual ~CallInfo(void);
+
+       /**
+     * Gets the call type of a call.
+     *
+     * @since   2.0
+     *
+     * @return  The current call type
+     * @see Tizen::Telephony::CallType
+     */
+       CallType GetCallType(void) const;
+
+       /**
+     * Gets the correspondent's phone number.
+     *
+     * @since   2.0
+        *
+     * @return  The phone number
+     * @remarks This information is valid only for an incoming event.
+     */
+       Tizen::Base::String GetNumber(void) const;
+
+       /**
+    * Checks whether the specified instance of %CallInfo equals the current instance.
+    *
+    * @since    2.0
+       *
+    * @return   @c true if the specified instance equals the current instance, @n
+    *           else @c false
+    * @param[in]    obj An instance of %CallInfo
+    * @remarks The method returns @c false if the specified object is not %CallInfo.
+    */
+       virtual bool Equals(const Tizen::Base::Object& obj) const;
+
+       /**
+     * Gets the hash value of the current instance.
+     *
+     * @since   2.0
+     *
+     * @return  The hash value of the current instance
+     */
+       virtual int GetHashCode(void) const;
+
+       /**
+     * Copying of objects using this copy assignment operator is allowed.       
+     *
+     * @since 2.0
+     *
+     * @return  The reference of this instance
+     * @param[in]   rhs   An instance of %CallInfo to copy
+     */
+       CallInfo& operator=(const CallInfo& rhs);
+
+private:
+       /**
+     * This constructor is intentionally declared as private so that only the platform can create an instance.
+     *
+     * @param[in]   type   The call type
+     * @param[in]   number The phone number @n
+     */
+       CallInfo(CallType type, const Tizen::Base::String& number);
+
+private:
+       _CallInfoImpl* __pCallInfoImpl;
+
+       friend class _CallInfoImpl;
+}; // CallInfo
+
+} } // Tizen::Telephony
+#endif // _FTEL_CALL_INFO_H_
diff --git a/inc/FTelCallManager.h b/inc/FTelCallManager.h
new file mode 100755 (executable)
index 0000000..aa7b61d
--- /dev/null
@@ -0,0 +1,273 @@
+//
+// Open Service Platform
+// Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Apache License, Version 2.0 (the License);
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// 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.
+//
+/**
+ * @file  FTelCallManager.h
+ * @brief This is the header file for the %CallManager class.
+ *
+ * This header file contains the declarations of the %CallManager class.
+ */
+#ifndef _FTEL_CALL_MANAGER_H_
+#define _FTEL_CALL_MANAGER_H_
+
+
+#include <FBase.h>
+#include <FTelTypes.h>
+#include <FTelCallInfo.h>
+#include <FTelITelephonyCallEventListener.h>
+#include <FTelITelephonyCallForwardListener.h>
+
+
+namespace Tizen { namespace Telephony
+{
+class _CallManagerImpl;
+
+/**
+ * @class      CallManager
+ * @brief      This class provides methods to obtain information about the current call.
+ *
+ * @since      2.0
+ *
+ * The %CallManager class provides methods to obtain information about the current call type and its status.
+ *
+ * The following example demonstrates how to use the %CallManager class to obtain information about a call.
+ *
+ * @code
+ *
+ *     result
+ *     MyClass::GetCallInfo(void)
+ *     {
+ *             CallType callType = TYPE_UNDEFINED_CALL;
+ *             CallStatus callStatus = CALL_STATUS_UNDEFINED;
+ *
+ *             CallManager* pCallManager = new CallManager();
+ *
+ *             result r = pCallManager->Construct(*this);
+ *             if (IsFailed(r))
+ *             {
+ *                     delete pCallManager;
+ *                     return r;
+ *             }
+ *
+ *             callStatus = pCallManager->GetCurrentCallStatus();
+ *
+ *             if (callStatus == CALL_STATUS_COMMUNICATING)
+ *             {
+ *                     callType = pCallManager->GetCurrentCallType();
+ *             }
+ *
+ *             delete pCallManager;
+ *             return E_SUCCESS;
+ *     }
+ *
+ *     void
+ *     MyClass::OnTelephonyCallStatusChangedN(CallStatus  callStatus,CallInfo *  pCallInfo)
+ *     {
+ *             CallType        callType;
+ *             String          number;
+ *
+ *             if (callStatus == CALL_STATUS_RINGING)
+ *             {
+ *                     callType  = pCallInfo->GetCallType();
+ *                     number = pCallInfo->GetNumber();
+ *             }
+ *
+ *             delete pCallInfo;
+ *     }
+ *
+ *
+ * @endcode
+ */
+class _OSP_EXPORT_ CallManager
+       : public Tizen::Base::Object
+{
+public:
+       /**
+     *          The object is not fully constructed after this constructor is called. For full construction, the Construct() method must be called right after calling this constructor.
+     *
+     * @since   2.0
+     */
+       CallManager(void);
+
+       /**
+     * This destructor overrides Tizen::Base::Object::~Object().
+     *
+     * @since   2.0
+     */
+       virtual ~CallManager(void);
+
+       /**
+     * Initializes a new instance of this class. @n
+     * This is the two phase construction.
+     *
+     * @since   2.0
+        *
+     * @return  An error code
+     * @exception   E_SUCCESS          The method is successful.
+     * @exception   E_SYSTEM           A system error has occurred.
+     */
+       result Construct(void);
+
+       /**
+     * Initializes a new instance of this class. @n
+     * This is the two phase construction.
+     *
+     * @since   2.0
+        *
+     * @return  An error code
+     * @param[in]   listener  The listener for change in status of a call
+     * @exception   E_SUCCESS The method is successful.
+     * @exception   E_SYSTEM  A system error has occurred.
+     * @see ITelephonyCallEventListener
+     */
+       result Construct(ITelephonyCallEventListener& listener);
+
+       /**
+     * @if VISPARTNER-OPERATOR
+     * Sets the listener that listens to the call forwarding request.
+     *
+     * @since   2.0
+        *
+     * @visibility  partner-operator
+     * @privilege   %http://tizen.org/privilege/callforward
+     *
+     * @return  An error code
+     * @param[in]   pListener           An ITelephonyCallForwardListener instance @n
+     *                                  The parameter can be set to @c null to remove listener.
+     * @exception   E_SUCCESS           The method is successful.
+     * @exception   E_PRIVILEGE_DENIED  The application does not have the privilege to call this method.
+     * @exception   E_SYSTEM            A system error has occurred.
+     *
+     * @endif
+     */
+       result SetCallForwardListener(ITelephonyCallForwardListener* pListener);
+
+       /**
+     * @if VISPARTNER-OPERATOR
+     * Requests call forwarding with the specified number. @n
+     * This method sends the request to the network, and receives the response asynchronously.
+     *
+     * @since   2.0
+        *
+     * @visibility  partner-operator
+     * @privilege   %http://tizen.org/privilege/callforward
+     *
+     * @return  An error code
+     * @param[in]   phoneNumber The phone number for call forwarding
+     * @exception   E_SUCCESS               The method is successful.
+     * @exception   E_INVALID_STATE         This instance is in an invalid state.
+     * @exception   E_INVALID_FORMAT        The specified phone number is in an invalid format.
+     * @exception   E_IN_PROGRESS           The previous request is in progress.
+     * @exception   E_PRIVILEGE_DENIED      The application does not have the privilege to call this method.
+     * @exception   E_NETWORK_UNAVAILABLE   The operation has failed because the device is in the offline mode.
+     * @exception   E_SERVICE_UNAVAILABLE   The operation has failed because the device is out of the coverage area or in the emergency mode.
+     * @exception   E_SYSTEM                A system error has occurred.
+     * @remarks The call will be forwarded unconditionally. Voice call only. @n
+     *          The phone number can start with plus(+) and the remaining part must be number.
+     * @see ITelephonyCallForwardListener::OnTelephonyCallForwardResponseReceived()
+     *
+     * @endif
+     */
+       result RequestCallForward(const Tizen::Base::String& phoneNumber);
+
+    /**
+     * @if VISPARTNER-OPERATOR
+     * Stops call forwarding.
+     *
+     * @since   2.0
+        *
+     * @visibility  partner-operator
+     * @privilege   %http://tizen.org/privilege/callforward
+     *
+     * @return  An error code
+     * @exception   E_SUCCESS               The method is successful.
+      @exception    E_INVALID_STATE         This instance is in an invalid state.
+     * @exception   E_IN_PROGRESS           The previous request is in progress.
+     * @exception   E_PRIVILEGE_DENIED      The application does not have the privilege to call this method.
+     * @exception   E_NETWORK_UNAVAILABLE   The operation has failed because the device is in the offline mode.
+     * @exception   E_SERVICE_UNAVAILABLE   The operation has failed because the device is out of the coverage area or in the emergency mode.
+     * @exception   E_SYSTEM                A system error has occurred.
+     * @see ITelephonyCallForwardListener::OnTelephonyCallForwardStopped()
+     *
+     * @endif
+     */
+       result StopCallForward(void);
+
+       /**
+     * @if VISPARTNER-OPERATOR
+     * Gets the phone number to which the call must be forwarded.
+     *
+     * @since   2.0
+        *
+     * @visibility  partner-operator
+     * @privilege   %http://tizen.org/privilege/callforward
+     *
+     * @return  An error code
+     * @exception   E_SUCCESS               The method is successful.
+     * @exception   E_IN_PROGRESS           The previous request is in progress.
+     * @exception   E_PRIVILEGE_DENIED      The application does not have the privilege to call this method.
+     * @exception   E_NETWORK_UNAVAILABLE   The operation has failed because the device is in the offline mode.
+     * @exception   E_SERVICE_UNAVAILABLE   The operation has failed because the device is out of the coverage area or in the emergency mode.
+     * @exception   E_SYSTEM                A system error has occurred.
+     * @see ITelephonyCallForwardListener::OnTelephonyCallForwardNumberReceived
+     *
+     * @endif
+     */
+       result GetCallForwardNumber(void) const;
+
+       /**
+     * Gets the call type of the current call.
+     *
+     * @since                  2.0
+        *
+     * @return      The current call type, @n
+     *              else Telephony::TYPE_UNDEFINED_CALL if the method fails
+     */
+       CallType GetCurrentCallType(void) const;
+
+       /**
+     * Gets the call status of the current call.
+     *
+     * @since                  2.0
+        *
+     * @return      The current call status, @n
+     *              else Telephony::CALL_STATUS_UNDEFINED if the method fails
+     */
+       CallStatus GetCurrentCallStatus(void) const;
+
+private:
+       /**
+     * The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.
+     *
+     * @param[in]      rhs     An instance of %CallManager
+     */
+       CallManager(const CallManager& rhs);
+
+       /**
+     * The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects.
+     *
+     * @param[in]      rhs     An instance of %CallManager
+     */
+       CallManager& operator =(const CallManager& rhs);
+
+private:
+       _CallManagerImpl* __pCallManagerImpl;
+
+       friend class _CallManagerImpl;
+}; // CallManager
+
+} } // Tizen::Telephony
+#endif // _FTEL_CALL_MANAGER_H_
diff --git a/inc/FTelITelephonyCallEventListener.h b/inc/FTelITelephonyCallEventListener.h
new file mode 100644 (file)
index 0000000..00237d2
--- /dev/null
@@ -0,0 +1,99 @@
+//
+// Open Service Platform
+// Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Apache License, Version 2.0 (the License);
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// 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.
+//
+/**
+ * @file    FTelITelephonyCallEventListener.h
+ * @brief   This is the header file for the %ITelephonyCallEventListener interface.
+ *
+ * This header file contains the declarations of the %ITelephonyCallEventListener interface.
+ *
+ */
+#ifndef _FTEL_ITELEPHONY_CALL_EVENT_LISTENER_H_
+#define _FTEL_ITELEPHONY_CALL_EVENT_LISTENER_H_
+
+
+#include <FBase.h>
+#include <FTelTypes.h>
+#include <FTelCallInfo.h>
+
+
+namespace Tizen { namespace Telephony
+{
+/**
+ * @interface   ITelephonyCallEventListener
+ * @brief       This interface provides methods to listen to the change in status of a call.
+ *
+ * @since       2.0
+ *
+ * The %ITelephonyCallEventListener interface checks for the change in status of a call.
+ *
+ */
+class _OSP_EXPORT_ ITelephonyCallEventListener
+       : virtual public Tizen::Base::Runtime::IEventListener
+{
+public:
+    /**
+     * This polymorphic destructor should be overridden if required. This way, the destructors of the derived classes are called when the destructor of this interface is called.
+     *
+     * @since   2.0
+     */
+       virtual ~ITelephonyCallEventListener(void) {}
+
+       /**
+    * Called when the status of a call is changed.
+    *
+    * @since    2.0
+       *
+    * @param[in]    callStatus The new status of a call
+    * @param[in]    pCallInfo  The detailed information of a call
+    * @see  Tizen::Telephony::CallStatus
+    */
+       virtual void OnTelephonyCallStatusChangedN(CallStatus callStatus, CallInfo* pCallInfo) = 0;
+
+protected:
+       //
+       // This method is for internal use only. Using this method can cause behavioral, security-related,
+       // and consistency-related issues in the application.
+       //
+       // This method is reserved and may change its name at any time without prior notice.
+       //
+       // @since    2.0
+       //
+       virtual void ITelephonyCallEventListener_Reserved1(void) {}
+
+       //
+       // This method is for internal use only. Using this method can cause behavioral, security-related,
+       // and consistency-related issues in the application.
+       //
+       // This method is reserved and may change its name at any time without prior notice.
+       //
+       // @since    2.0
+       //
+       virtual void ITelephonyCallEventListener_Reserved2(void) {}
+
+       //
+       // This method is for internal use only. Using this method can cause behavioral, security-related,
+       // and consistency-related issues in the application.
+       //
+       // This method is reserved and may change its name at any time without prior notice.
+       //
+       // @since    2.0
+       //
+       virtual void ITelephonyCallEventListener_Reserved3(void) {}
+}; // ITelephonyCallEventListener
+
+}} // Tizen::Telephony
+#endif // _FTEL_ITELEPHONY_CALL_EVENT_LISTENER_H_
diff --git a/inc/FTelITelephonyCallForwardListener.h b/inc/FTelITelephonyCallForwardListener.h
new file mode 100755 (executable)
index 0000000..face22a
--- /dev/null
@@ -0,0 +1,152 @@
+//
+// Open Service Platform
+// Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Apache License, Version 2.0 (the License);
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// 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.
+//
+/**
+ * @if VISPARTNER
+ *
+ * @file    FTelITelephonyCallForwardListener.h
+ * @brief   This is the header file for the %ITelephonyCallForwardListener interface.
+ * @visibility  partner
+ *
+ * This header file contains the declarations of the %ITelephonyCallForwardListener interface.
+ *
+ * @endif
+ */
+#ifndef _FTEL_ITELEPHONY_CALL_FORWARD_LISTENER_H_
+#define _FTEL_ITELEPHONY_CALL_FORWARD_LISTENER_H_
+
+
+#include <FBase.h>
+
+
+namespace Tizen { namespace Telephony
+{
+/**
+ * @if VISPARTNER-OPERATOR
+ *
+ * @interface   ITelephonyCallForwardListener
+ * @brief       This interface provides methods to listen to the results of the call forwarding request.
+ *
+ * @since       2.0
+ *
+ * @visibility  partner-operator
+ *
+ * The %ITelephonyCallForwardListener interface provides methods to listen to the results of the call forwarding request.
+ *
+ * @endif
+ */
+class _OSP_EXPORT_ ITelephonyCallForwardListener
+       : virtual public Tizen::Base::Runtime::IEventListener
+{
+public:
+       /**
+     * @if VISPARTNER-OPERATOR
+     * This polymorphic destructor should be overridden if required. This way, the destructors of the derived classes are called when the destructor of this interface is called.
+     *
+     * @since   2.0
+     *
+     * @visibility  partner-operator
+     *
+     * @endif
+     */
+       virtual ~ITelephonyCallForwardListener(void) {}
+
+       /**
+     * @if VISPARTNER-OPERATOR
+     * Called when a response of the call forwarding request is received.
+     *
+     * @since   2.0
+        *
+     * @visibility  partner-operator
+     *
+     * @param[in]    phoneNumber         The phone number
+     * @param[in]    r                   The result of the call forwarding request
+     * @exception    E_SUCCESS           The method is successful.
+     * @exception    E_NOT_RESPONDING    The server on the telephony network is not responding.
+     * @exception    E_SYSTEM            A system error has occurred.
+     * @endif
+     */
+       virtual void OnTelephonyCallForwardResponseReceived(const Tizen::Base::String& phoneNumber, result r) = 0;
+
+       /**
+     * @if VISPARTNER-OPERATOR
+     * Called when a response of the call forwarding stop request is received.
+     *
+     * @since   2.0
+        *
+     * @visibility  partner-operator
+     *
+     * @param[in]    phoneNumber         The phone number
+     * @param[in]    r                   The result of the call forwarding request
+     * @exception    E_SUCCESS           The method is successful.
+     * @exception    E_NOT_RESPONDING    The server on the telephony network is not responding.
+     * @exception    E_SYSTEM            A system error has occurred.
+     * @endif
+        */
+       virtual void OnTelephonyCallForwardStopped(const Tizen::Base::String& phoneNumber, result r) = 0;
+
+       /**
+     * @if VISPARTNER-OPERATOR
+     * Called when a query for the call forwarding number is completed.
+     *
+     * @since   2.0
+        *
+     * @visibility  partner-operator
+     *
+     * @param[in]    phoneNumber             The phone number
+     * @param[in]    r                       The result of the query request
+     * @exception    E_SUCCESS               The method is successful.
+     * @exception    E_NOT_RESPONDING        The server on the telephony network is not responding.
+     * @exception    E_SERVICE_DEACTIVATED   The call forwarding service is not enabled.
+     * @exception    E_SYSTEM                A system error has occurred.
+     * @endif
+     */
+       virtual void OnTelephonyCallForwardNumberReceived(const Tizen::Base::String& phoneNumber, result r) = 0;
+
+protected:
+       //
+       // This method is for internal use only. Using this method can cause behavioral, security-related,
+       // and consistency-related issues in the application.
+       //
+       // This method is reserved and may change its name at any time without prior notice.
+       //
+       // @since    2.0
+       //
+       virtual void ITelephonyCallForwardListener_Reserved1(void) {}
+
+       //
+       // This method is for internal use only. Using this method can cause behavioral, security-related,
+       // and consistency-related issues in the application.
+       //
+       // This method is reserved and may change its name at any time without prior notice.
+       //
+       // @since    2.0
+       //
+       virtual void ITelephonyCallForwardListener_Reserved2(void) {}
+
+       //
+       // This method is for internal use only. Using this method can cause behavioral, security-related,
+       // and consistency-related issues in the application.
+       //
+       // This method is reserved and may change its name at any time without prior notice.
+       //
+       // @since    2.0
+       //
+       virtual void ITelephonyCallForwardListener_Reserved3(void) {}
+}; // ITelephonyCallForwardListener
+
+}} // Tizen::Telephony
+#endif // _FTEL_ITELEPHONY_CALL_FORWARD_LISTENER_H_
diff --git a/inc/FTelITelephonyNetworkEventListener.h b/inc/FTelITelephonyNetworkEventListener.h
new file mode 100644 (file)
index 0000000..7d33b37
--- /dev/null
@@ -0,0 +1,86 @@
+//
+// Open Service Platform
+// Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Apache License, Version 2.0 (the License);
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// 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.
+//
+/**
+ * @file       FTelITelephonyNetworkEventListener.h
+ * @brief      This is the header file for the %ITelephonyNetworkEventListener interface.
+ *
+ * This header file contains the declarations of the %ITelephonyNetworkEventListener interface.
+ */
+#ifndef _FTEL_ITELEPHONY_NETWORK_EVENT_LISTENER_H_
+#define _FTEL_ITELEPHONY_NETWORK_EVENT_LISTENER_H_
+
+
+#include <FBase.h>
+#include <FTelNetworkStatus.h>
+
+
+namespace Tizen { namespace Telephony
+{
+/**
+ * @interface   ITelephonyNetworkEventListener
+ * @brief       This interface provides methods to listen to the change in status of the telephony network.
+ *
+ * @since       2.0
+ *
+ * The %ITelephonyNetworkEventListener interface checks for status changes in the telephony network.
+ *
+ */
+class _OSP_EXPORT_ ITelephonyNetworkEventListener
+       : virtual public Tizen::Base::Runtime::IEventListener
+{
+public:
+       /**
+     * This polymorphic destructor should be overridden if required. This way, the destructors of the derived classes are called when the destructor of this interface is called.
+     *
+     * @since   2.0
+     */
+       virtual ~ITelephonyNetworkEventListener(void) {}
+
+       /**
+     * Called when the status of the telephony network is changed.
+     *
+     * @since   2.0
+        *
+     * @param[in]   networkStatus      The new network status
+     * @see    Tizen::Telephony::NetworkStatus
+     */
+       virtual void OnTelephonyNetworkStatusChanged(const NetworkStatus& networkStatus) = 0;
+
+protected:
+       //
+       // This method is for internal use only. Using this method can cause behavioral, security-related,
+       // and consistency-related issues in the application.
+       //
+       // This method is reserved and may change its name at any time without prior notice.
+       //
+       // @since 2.0
+       //
+       virtual void ITelephonyNetworkEventListener_Reserved1(void) {};
+
+       //
+       // This method is for internal use only. Using this method can cause behavioral, security-related,
+       // and consistency-related issues in the application.
+       //
+       // This method is reserved and may change its name at any time without prior notice.
+       //
+       // @since 2.0
+       //
+       virtual void ITelephonyNetworkEventListener_Reserved2(void) {};
+}; // ITelephonyNetworkEventListener
+
+}} // Tizen::Telephony
+#endif // _FTEL_ITELEPHONY_NETWORK_EVENT_LISTENER_H_
diff --git a/inc/FTelITelephonyNetworkSettingListener.h b/inc/FTelITelephonyNetworkSettingListener.h
new file mode 100755 (executable)
index 0000000..8c8bc4f
--- /dev/null
@@ -0,0 +1,154 @@
+//
+// Open Service Platform
+// Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Apache License, Version 2.0 (the License);
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// 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.
+//
+/**
+* @if VISPARTNER-MANUFACTURER
+* @file    FTelITelephonyNetworkSettingListener.h
+* @brief   This is the header file for the %ITelephonyNetworkSettingListener interface.
+* @visibility  partner-manufacturer
+*
+* This header file contains the declarations of the %ITelephonyNetworkSettingListener interface.
+*
+* @endif
+*/
+#ifndef _FTEL_ITELEPHONY_NETWORK_SETTING_LISTENER_H_
+#define _FTEL_ITELEPHONY_NETWORK_SETTING_LISTENER_H_
+
+#include <FBaseRtIEventListener.h>
+
+namespace Tizen { namespace Base { namespace Collection
+{
+class IList;
+} } } // Tizen::Base::Collection
+
+namespace Tizen { namespace Telephony
+{
+/**
+* @if VISPARTNER-MANUFACTURER
+* @interface   ITelephonyNetworkSettingListener
+* @brief       This interface provides result of the network settings.
+*
+* @since 2.0
+*
+* @visibility  partner-manufacturer
+*
+* The %ITelephonyNetworkSettingListener interface provides result of the network search and response by selection mode.
+*
+* @endif
+*/
+class _OSP_EXPORT_ ITelephonyNetworkSettingListener
+    : virtual public Tizen::Base::Runtime::IEventListener
+{
+public:
+    /**
+     * This polymorphic destructor should be overridden if required. This way, the destructors of the derived classes are called when the destructor of this interface is called.
+     *
+     * @since 2.0
+     */
+    virtual ~ITelephonyNetworkSettingListener(void) {}
+
+    /**
+     * @if VISPARTNER-MANUFACTURER
+     * Called when a response of the network selection mode request is received.
+     *
+     * @since 2.0
+     *
+     * @visibility  partner-manufacturer
+     *
+     * @param[in]   isManual    @c true if the network selection is in manual mode, @n
+     *                          else @c false
+     * @param[in]   r           An error code
+     * @exception   E_SUCCESS                  The method is successful.
+     * @exception   E_NOT_RESPONDING    The server on the telephony network is not responding.
+     * @exception   E_SYSTEM                     The method cannot proceed due to a severe telephony modem error.
+     * @see NetworkManager::GetNetworkSelectionMode()
+     *
+     * @endif
+     */
+    virtual void OnTelephonyNetworkSelectionModeReceived(bool isManual, result r) = 0;
+
+    /**
+     * @if VISPARTNER-MANUFACTURER
+     * Called when the network search process is completed.
+     *
+     * @since 2.0
+     *
+     * @visibility  partner-manufacturer
+     *
+     * @param[in]   pNetworkInfoList    The list of NetworkInfo information representing the network discovered by the search
+     * @param[in]   r                   An error code
+     * @exception   E_SUCCESS           The method is successful.
+     * @exception   E_NOT_RESPONDING    The server on the telephony network is not responding.
+     * @exception   E_SYSTEM            The method cannot proceed due to a severe telephony modem error.
+     * @see NetworkManager::SearchNetwork()
+     *
+     * @endif
+     */
+    virtual void OnTelephonyNetworkSearchCompletedN(Tizen::Base::Collection::IList* pNetworkInfoList, result r) = 0;
+
+    /**
+     * @if VISPARTNER-MANUFACTURER
+     * Called when a response of the network selection request is completed.
+     *
+     * @since 2.0
+     *
+     * @visibility  partner-manufacturer
+     *
+     * @param[in]   r   An error code
+     * @exception   E_SUCCESS           The method is successful.
+     * @exception   E_NOT_RESPONDING    The server on the telephony network is not responding.
+     * @exception   E_SYSTEM            The method cannot proceed due to a severe telephony modem error.
+     * @see NetworkManager::SelectNetwork()
+     *
+     * @endif
+     */
+    virtual void OnTelephonyNetworkSelectionCompleted(result r) = 0;
+
+protected:
+    //
+    // This method is for internal use only. Using this method can cause behavioral, security-related,
+    // and consistency-related issues in the application.
+    //
+    // This method is reserved and may change its name at any time without prior notice.
+    //
+    // @since 2.0
+    //
+    virtual void ITelephonyNetworkSettingListener_Reserved1(void) {}
+
+    //
+    // This method is for internal use only. Using this method can cause behavioral, security-related,
+    // and consistency-related issues in the application.
+    //
+    // This method is reserved and may change its name at any time without prior notice.
+    //
+    // @since 2.0
+    //
+    virtual void ITelephonyNetworkSettingListener_Reserved2(void) {}
+
+    //
+    // This method is for internal use only. Using this method can cause behavioral, security-related,
+    // and consistency-related issues in the application.
+    //
+    // This method is reserved and may change its name at any time without prior notice.
+    //
+    // @since 2.0
+    //
+    virtual void ITelephonyNetworkSettingListener_Reserved3(void) {}
+}; // ITelephonyNetworkSettingListener
+
+}} // Tizen::Telephony
+#endif // _FTEL_ITELEPHONY_NETWORK_SETTING_LISTENER_H_
+
diff --git a/inc/FTelNetworkInfo.h b/inc/FTelNetworkInfo.h
new file mode 100755 (executable)
index 0000000..0f67a86
--- /dev/null
@@ -0,0 +1,267 @@
+//
+// Open Service Platform
+// Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Apache License, Version 2.0 (the License);
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// 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.
+//
+/**
+ * @file       FTelNetworkInfo.h
+ * @brief      This is the header file for the %NetworkInfo class.
+ *
+ * This header file contains the declarations of the %NetworkInfo class.
+ */
+#ifndef _FTEL_NETWORK_INFO_H_
+#define _FTEL_NETWORK_INFO_H_
+
+
+#include <FBase.h>
+
+
+namespace Tizen { namespace Telephony
+{
+class _NetworkInfoImpl;
+
+/**
+ * @class      NetworkInfo
+ * @brief      This class provides information of the current network.
+ *
+ * @since      2.0
+ *
+ * The %NetworkInfo class provides methods to get information of the current network such as MNC, MCC, PLMN, cell ID, and operator name.
+ *
+ * The following example demonstrates how to use the %NetworkInfo class to get the network information.
+ *
+ * @code
+ *
+ *     result
+ *     MyClass::GetNetworkInfo(void)
+ *     {
+ *             result r = E_SUCCESS;
+ *             int mnc;
+ *             int mcc;
+ *             int cellId;
+ *             int lac;
+ *             String plmn;
+ *             String operatorName;
+ *
+ *             NetworkInfo networkInfo;
+ *
+ *             NetworkManager* pNetworkManager = new NetworkManager();
+ *
+ *             r = pNetworkManager->Construct(null);
+ *             if (IsFailed(r))
+ *             {
+ *                     delete pNetworkManager;
+ *                     return r;
+ *             }
+ *
+ *             r = pNetworkManager->GetNetworkInfo(networkInfo);
+ *             if (IsFailed(r))
+ *             {
+ *                     delete pNetworkManager;
+ *                     return r;
+ *             }
+ *
+ *             mnc = networkInfo.GetMnc();
+ *             mcc = networkInfo.GetMcc();
+ *             cellId = networkInfo.GetCellId();
+ *             lac = networkInfo.GetLac();
+ *             plmn = networkInfo.GetPlmn();
+ *             operatorName = networkInfo.GetOperatorName();
+ *
+ *             delete pNetworkManager;
+ *             return r;
+ *     }
+ *
+ * @endcode
+ */
+class _OSP_EXPORT_ NetworkInfo
+       : public Tizen::Base::Object
+{
+public:
+       /**
+     * This is the default constructor for this class.
+     *
+     * @since   2.0
+     */
+       NetworkInfo(void);
+
+       /**
+     * Copying of objects using this copy constructor is allowed.
+     *
+     * @since 2.0
+     *
+     * @param[in]   rhs   An instance of %NetworkInfo
+     */
+       NetworkInfo(const NetworkInfo& rhs);
+
+       /**
+     * This destructor overrides Tizen::Base::Object::~Object().
+     *
+     * @since  2.0
+     */
+       virtual ~NetworkInfo(void);
+
+       /**
+     * Gets the Mobile Network Code (MNC) of the network.
+     *
+     * @since   2.0
+     * @privilege   %http://tizen.org/privilege/systeminfo
+     *
+     * @return         The MNC of the network
+     * @exception      E_SUCCESS       The method is successful.
+     * @exception      E_PRIVILEGE_DENIED      The application does not have the privilege to call this method.
+     * @remarks                The specific error code can be accessed using the GetLastResult() method.
+     */
+       int GetMnc(void) const;
+
+       /**
+     * Gets the Mobile Country Code (MCC) of the network.
+     *
+     * @since   2.0
+     * @privilege   %http://tizen.org/privilege/systeminfo
+     *
+     * @return         The MCC of the network
+     * @exception      E_SUCCESS       The method is successful.
+     * @exception      E_PRIVILEGE_DENIED      The application does not have the privilege to call this method.
+     * @remarks                The specific error code can be accessed using the GetLastResult() method.
+     */
+       int GetMcc(void) const;
+
+    /**
+     * Gets the Public Land Mobile Network (PLMN).
+     *
+     * @if OSPCOMPAT
+     * @brief <i> [Compatibility] </i>
+     * @endif
+     * @since   2.0
+     * @if OSPCOMPAT
+     * @compatibility  This method has compatibility issues with OSP compatible applications. @n
+     *                  For more information, see the issue description for @ref CompNetworkInfoGetPlmnPage "here".
+     * @endif
+     * @privilege   %http://tizen.org/privilege/systeminfo
+     *
+     * @return         The PLMN name
+     * @exception      E_SUCCESS               The method is successful.
+     * @exception      E_PRIVILEGE_DENIED      The application does not have the privilege to call this method.
+     * @remarks                The specific error code can be accessed using the GetLastResult() method.
+     */
+       Tizen::Base::String GetPlmn(void) const;
+
+
+    /**
+     * @page    CompNetworkInfoGetPlmnPage Compatibility for GetPlmn()
+     * @section CompNetworkInfoGetPlmnPageIssueSection Issues
+     *          Implementing this method in OSP compatible applications has the following issues:   @n 
+     *          -# The method returns an alphabetic name of PLMN.
+     *
+     * @section CompNetworkInfoGetPlmnPageSolutionSection Resolutions
+     *          -# The method returns a numeric name of PLMN-ID(MCC+MNC).
+     *           To get the alphabetic name of PLMN, it is recommended to use Tizen::Telephony::GetOperatorName().
+     */
+
+    /**
+     * Gets the current cell ID.
+     *
+     * @since   2.0
+     * @privilege   %http://tizen.org/privilege/systeminfo
+     *
+     * @return         The current cell ID
+     * @exception      E_SUCCESS       The method is successful.
+     * @exception      E_PRIVILEGE_DENIED      The application does not have the privilege to call this method.
+     * @remarks     This cell ID is provided using only NetworkManager::GetNetworkInfo() when connected to a network.
+     * @remarks                The specific error code can be accessed using the GetLastResult() method.
+     */
+       int GetCellId(void) const;
+
+       /**
+     * Gets the current Location Area Code (LAC).
+     *
+     * @since   2.0
+     * @privilege   %http://tizen.org/privilege/systeminfo
+     *
+     * @return         The current LAC
+     * @exception      E_SUCCESS       The method is successful.
+     * @exception      E_PRIVILEGE_DENIED      The application does not have the privilege to call this method.
+     * @remarks     This LAC is provided using only NetworkManager::GetNetworkInfo() when connected to a network.
+     * @remarks                The specific error code can be accessed using the GetLastResult() method.
+     */
+       int GetLac(void) const;
+
+    /**
+     * Gets the operator name.
+     *
+     * @since 2.0
+     * @privilege   %http://tizen.org/privilege/systeminfo
+     *
+     * @return      The operator name
+     * @exception   E_SUCCESS   The method is successful.
+     * @exception   E_PRIVILEGE_DENIED  The application does not have the privilege to call this method.
+     * @remarks                The specific error code can be accessed using the GetLastResult() method.
+     */
+    Tizen::Base::String GetOperatorName(void) const;
+
+    /**
+     * Checks whether the specified instance of %NetworkInfo equals the current instance.
+     *
+     * @since   2.0
+        *
+     * @return  @c true if the specified instance equals the current instance, @n
+     *          else @c false
+     * @param[in]   rhs An instance of %NetworkInfo
+     * @remarks     The method returns @c false if the specified object is not %NetworkInfo.
+     */
+       virtual bool Equals(const Tizen::Base::Object& rhs) const;
+
+       /**
+     * Gets the hash value of the current instance.
+     *
+     * @since   2.0
+     *
+     * @return  The hash value of the current instance
+     */
+       virtual int GetHashCode(void) const;
+
+       /**
+     * Gets the received signal strength indication of a modem device.
+     *
+     * @since   2.0
+     * @privilege   %http://tizen.org/privilege/systeminfo
+     *
+     * @return  The current RSSI @n
+     *          The possible RSSI value ranges from @c 0 to @c 100.
+     * @exception   E_SUCCESS   The method is successful.
+     * @exception   E_PRIVILEGE_DENIED  The application does not have the privilege to call this method.
+     * @exception   E_SYSTEM    A system error has occurred.
+     * @remarks                The specific error code can be accessed using the GetLastResult() method.
+     */
+       static int GetRssi(void);
+
+       /**
+      * Copying of objects using this copy assignment operator is allowed.
+      *
+      * @since 2.0
+      *
+      * @return     The reference of this instance
+      * @param[in]  rhs   An instance of %NetworkInfo
+      */
+       NetworkInfo& operator=(const NetworkInfo& rhs);
+
+private:
+       _NetworkInfoImpl* __pNetworkInfoImpl;
+
+       friend class _NetworkInfoImpl;
+}; // NetworkInfo
+
+}} //Tizen::Telephony
+#endif // _FTEL_NETWORK_INFO_H_
diff --git a/inc/FTelNetworkManager.h b/inc/FTelNetworkManager.h
new file mode 100755 (executable)
index 0000000..0ad0d2a
--- /dev/null
@@ -0,0 +1,283 @@
+//
+// Open Service Platform
+// Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Apache License, Version 2.0 (the License);
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// 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.
+//
+/**
+ * @file       FTelNetworkManager.h
+ * @brief      This is the header file for the %NetworkManager class.
+ *
+ * This header file contains the declarations of the %NetworkManager class.
+ */
+#ifndef _FTEL_NETWORK_MANAGER_H_
+#define _FTEL_NETWORK_MANAGER_H_
+
+
+#include <FBase.h>
+#include <FTelNetworkInfo.h>
+#include <FTelNetworkStatus.h>
+
+
+namespace Tizen { namespace Telephony
+{
+class _NetworkManagerImpl;
+class ITelephonyNetworkEventListener;
+class ITelephonyNetworkSettingListener;
+
+/**
+ * @class      NetworkManager
+ * @brief      This class provides information about the current active network.
+ *
+ * @since      2.0
+ *
+ * The %NetworkManager class is used to register listeners who monitor network status changes,
+ * as well as get information about current active network.
+ *
+ * The following example demonstrates how to use the %NetworkManager class to get the network information.
+ *
+ * @code
+ *
+ *     result
+ *     MyClass::GetNetworkManagerInfo(void)
+ *     {
+ *             NetworkStatus networkStatus;
+ *             NetworkInfo networkInfo;
+ *
+ *             NetworkManager* pNetworkManager = new NetworkManager();
+ *
+ *             result r = pNetworkManager->Construct(this);
+ *             if (IsFailed(r))
+ *             {
+ *                     delete pNetworkManager;
+ *                     return r;
+ *             }
+ *
+ *             r = pNetworkManager->GetNetworkStatus(networkStatus);
+ *             if (IsFailed(r))
+ *             {
+ *                     delete pNetworkManager;
+ *                     return r;
+ *             }
+ *
+ *             r = pNetworkManager->GetNetworkInfo(networkInfo);
+ *             if (IsFailed(r))
+ *             {
+ *                     delete pNetworkManager;
+ *                     return r;
+ *             }
+ *
+ *             delete pNetworkManager;
+ *             return E_SUCCESS;
+ *     }
+ *
+ *     void
+ *     MyClass::OnTelephonyNetworkStatusChanged(const NetworkStatus& networkStatus)
+ *     {
+ *             bool isCallAvail = networkStatus.IsCallServiceAvailable();
+ *             bool isDataAvail = networkStatus.IsDataServiceAvailable();
+ *             bool isRoaming = networkStatus.IsRoaming();
+ *     }
+ *
+ * @endcode
+ */
+class _OSP_EXPORT_ NetworkManager
+       : public Tizen::Base::Object
+{
+public:
+       /**
+     * The object is not fully constructed after this constructor is called. For full construction, the Construct() method must be called right after calling this constructor.
+     *
+     * @since   2.0
+     */
+       NetworkManager(void);
+
+       /**
+     * This destructor overrides Tizen::Base::Object::~Object().
+     *
+     * @since  2.0
+     */
+       virtual ~NetworkManager(void);
+
+       /**
+     * Initializes a new instance of this class. @n
+     * This is the two phase construction.
+        * If a @c null pointer is passed during the construction, then there
+     * is no listener for telephony network status change callbacks.
+     *
+     * @since          2.0
+        *
+     * @return         An error code
+        * @param[in]   pListener       The listener for change in status of a telephony network
+     * @exception      E_SUCCESS               The method is successful.
+     * @exception      E_SYSTEM                A system error has occurred.
+     */
+       result Construct(ITelephonyNetworkEventListener* pListener);
+
+       /**
+     * Gets the network status.
+     *
+     * @since          2.0
+     * @privilege   %http://tizen.org/privilege/systeminfo
+     *
+     * @return         An error code
+     * @param[out]     networkStatus   The network status
+     * @exception      E_SUCCESS       The method is successful.
+     * @exception      E_NETWORK_UNAVAILABLE   The operation has failed because the device is in the offline mode.
+     * @exception      E_SERVICE_UNAVAILABLE   The operation has failed because the device is out of the coverage area or in the emergency mode.
+     * @exception      E_SYSTEM        A system error has occurred.
+     * @exception      E_PRIVILEGE_DENIED      The application does not have the privilege to call this method.
+     */
+       result GetNetworkStatus(NetworkStatus& networkStatus) const;
+
+       /**
+     * Gets the network information.
+     *
+     * @since  2.0
+     * @privilege   %http://tizen.org/privilege/systeminfo
+     *
+     * @return An error code
+     * @param[out]     networkInfo     The network information
+     * @exception      E_SUCCESS       The method is successful.
+     * @exception      E_NETWORK_UNAVAILABLE   The operation has failed because the device is in the offline mode.
+     * @exception      E_SERVICE_UNAVAILABLE   The operation has failed because the device is out of the coverage area or in the emergency mode.
+     * @exception      E_SYSTEM        A system error has occurred.
+     * @exception   E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
+     */
+       result GetNetworkInfo(NetworkInfo& networkInfo) const;
+
+    /**
+     * @if VISPARTNER-MANUFACTURER
+     * Sets the listener for receiving the responses of the search network and the network selection mode.
+     *
+     * @since 2.0
+     *
+     * @visibility  partner-manufacturer
+     * @privilege   %http://tizen.org/privilege/telephonymanager
+     *
+     * @return  An error code
+     * @param[in]   pListener           An instance of ITelephonyNetworkSettingListener @n
+     *                                  The parameter can be set to @c null to remove the listener.
+     * @exception   E_SUCCESS           The method is successful.
+     * @exception   E_SYSTEM            A system error has occurred.
+     * @exception   E_PRIVILEGE_DENIED  The application does not have the privilege to call this method.
+     *
+     * @endif
+     */
+    result SetNetworkSettingListener(ITelephonyNetworkSettingListener* pListener);
+
+    /**
+     * @if VISPARTNER-MANUFACTURER
+     * Gets the network selection mode.
+     *
+     * @since 2.0
+     *
+     * @visibility  partner-manufacturer
+     * @privilege   %http://tizen.org/privilege/telephonymanager
+     *
+     * @return  An error code
+     * @exception   E_SUCCESS   The method is successful.
+     * @exception   E_OPERATION_FAILED      This request operation has failed due to an internal error.
+     * @exception   E_SYSTEM                A system error has occurred.
+     * @exception   E_PRIVILEGE_DENIED      The application does not have the privilege to call this method.
+     * @see ITelephonyNetworkSettingListener::OnTelephonyNetworkSelectionModeReceived()
+     *
+     * @endif
+     */
+    result GetNetworkSelectionMode(void);
+
+    /**
+     * @if VISPARTNER-MANUFACTURER
+     * Selects the manually searched network.
+     *
+     * @since 2.0
+     *
+     * @visibility  partner-manufacturer
+     * @privilege   %http://tizen.org/privilege/telephonymanager
+     *
+     * @return  An error code
+     * @param[out]     networkInfo     The network information
+     * @exception   E_SUCCESS   The method is successful.
+     * @exception   E_OPERATION_FAILED      This request operation has failed due to an internal error.
+     * @exception   E_SYSTEM                A system error has occurred.
+     * @exception   E_PRIVILEGE_DENIED      The application does not have the privilege to call this method.
+     * @see ITelephonyNetworkSettingListener::OnTelephonyNetworkSelectionCompleted()
+     *
+     * @endif
+     */
+    result SelectNetwork(const NetworkInfo& networkInfo);
+
+    /**
+     * @if VISPARTNER-MANUFACTURER
+     * Selects the network automatically.
+     *
+     * @since 2.0
+     *
+     * @visibility  partner-manufacturer
+     * @privilege   %http://tizen.org/privilege/telephonymanager
+     *
+     * @return  An error code
+     * @exception   E_SUCCESS   The method is successful.
+     * @exception   E_OPERATION_FAILED      This request operation has failed due to an internal error.
+     * @exception   E_SYSTEM                A system error has occurred.
+     * @exception   E_PRIVILEGE_DENIED      The application does not have the privilege to call this method.
+     * @see ITelephonyNetworkSettingListener::OnTelephonyNetworkSelectionCompleted()
+     *
+     * @endif
+     */
+    result SelectNetwork(void);
+
+    /**
+     * @if VISPARTNER-MANUFACTURER
+     * Searches for an available network.
+     *
+     * @since 2.0
+     *
+     * @visibility  partner-manufacturer
+     * @privilege   %http://tizen.org/privilege/telephonymanager
+     *
+     * @return  An error code
+     * @exception   E_SUCCESS   The method is successful.
+     * @exception   E_OPERATION_FAILED      This request operation has failed due to an internal error.
+     * @exception   E_SYSTEM                A system error has occurred.
+     * @exception   E_PRIVILEGE_DENIED      The application does not have the privilege to call this method.
+     * @see ITelephonyNetworkSettingListener::OnTelephonyNetworkSearchCompletedN()
+     *
+     * @endif
+     */
+    result SearchNetwork(void);
+
+
+private:
+       /**
+     * The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.
+     *
+     * @param[in]      rhs     An instance of %NetworkManager
+     */
+       NetworkManager(const NetworkManager& rhs);
+
+       /**
+     * The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects.
+     *
+     * @param[in]      rhs     An instance of %NetworkManager
+     */
+       NetworkManager& operator =(const NetworkManager& rhs);
+
+private:
+       _NetworkManagerImpl * __pNetworkManagerImpl;
+
+       friend class _NetworkManagerImpl;
+}; // NetworkManager
+
+}} // Tizen::Telephony
+#endif // _FTEL_NETWORK_MANAGER_H_
diff --git a/inc/FTelNetworkStatus.h b/inc/FTelNetworkStatus.h
new file mode 100755 (executable)
index 0000000..8bbae70
--- /dev/null
@@ -0,0 +1,160 @@
+//
+// Open Service Platform
+// Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Apache License, Version 2.0 (the License);
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// 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.
+//
+/**
+ * @file       FTelNetworkStatus.h
+ * @brief      This is the header file for the %NetworkStatus class.
+ *
+ * This header file contains the declarations of the %NetworkStatus class.
+ */
+#ifndef _FTEL_NETWORK_STATUS_H_
+#define _FTEL_NETWORK_STATUS_H_
+
+#include <FBase.h>
+
+namespace Tizen { namespace Telephony
+{
+class _NetworkStatusImpl;
+
+/**
+ * @class      NetworkStatus`
+ * @brief      This class provides status information of the current network.
+ *
+ * @since      2.0
+ *
+ * The %NetworkStatus class provides methods to get status information of the current network, such as the roaming status, whether call service is available or not, and whether data service is available or not.
+ *
+ * The following example demonstrates how to use the %NetworkStatus class to get the network status information.
+ *
+ * @code
+ *
+ *     result
+ *     MyClass::GetNetworkStatus(void)
+ *     {
+ *             NetworkStatus networkStatus;
+ *
+ *             NetworkManager* pNetworkManager = new NetworkManager();
+ *
+ *             result r = pNetworkManager->Construct(this);
+ *             if (IsFailed(r))
+ *             {
+ *                     delete pNetworkManager;
+ *                     return r;
+ *             }
+ *
+ *             r = pNetworkManager->GetNetworkStatus(networkStatus);
+ *             if (IsFailed(r))
+ *             {
+ *                     delete pNetworkManager;
+ *                     return r;
+ *             }
+ *
+ *             bool isCallAvail = networkStatus.IsCallServiceAvailable();
+ *             bool isDataAvail = networkStatus.IsDataServiceAvailable();
+ *             bool isRoaming = networkStatus.IsRoaming();
+ *
+ *             delete pNetworkManager;
+ *             return E_SUCCESS;
+ *     }
+ *
+ * @endcode
+ */
+class _OSP_EXPORT_ NetworkStatus
+       : public Tizen::Base::Object
+{
+public:
+       /**
+     * This is the default constructor for this class.
+     *
+     * @since  2.0
+     */
+       NetworkStatus(void);
+
+       /**
+     * This destructor overrides Tizen::Base::Object::~Object().
+     *
+     * @since  2.0
+     */
+       virtual ~NetworkStatus(void);
+
+       /**
+     * Checks whether the current network is in roaming status or not.
+     *
+     * @since  2.0
+        *
+     * @privilege   %http://tizen.org/privilege/systeminfo
+     *
+     * @return @c true if the current network is in roaming status, @n
+     *                  else @c false
+     * @exception      E_SUCCESS       The method is successful.
+     * @exception      E_PRIVILEGE_DENIED      The application does not have the privilege to call this method.
+     * @remarks                The specific error code can be accessed using the GetLastResult() method.
+     */
+       bool IsRoaming(void) const;
+
+    /**
+     * Checks whether call service is available or not.
+     *
+     * @since  2.0
+        *
+     * @privilege   %http://tizen.org/privilege/systeminfo
+     *
+     * @return @c true if call service is available, @n
+     *          else @c false
+     * @exception      E_SUCCESS       The method is successful.
+     * @exception      E_PRIVILEGE_DENIED      The application does not have the privilege to call this method.
+     * @remarks                The specific error code can be accessed using the GetLastResult() method.
+     */
+       bool IsCallServiceAvailable(void) const;
+
+       /**
+     * Checks whether data service is available or not.
+     *
+     * @since  2.0
+        *
+     * @privilege   %http://tizen.org/privilege/systeminfo
+     *
+     * @return @c true if data service is available, @n
+     *          else @c false
+     * @exception      E_SUCCESS       The method is successful.
+     * @exception      E_PRIVILEGE_DENIED      The application does not have the privilege to call this method.
+     * @remarks                The specific error code can be accessed using the GetLastResult() method.
+     */
+       bool IsDataServiceAvailable(void) const;
+
+private:
+       /**
+     * The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.
+     *
+     * @param[in]      rhs     An instance of %NetworkStatus
+     */
+       NetworkStatus(const NetworkStatus& rhs);
+
+       /**
+     * The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects.
+     *
+     * @param[in]      rhs     An instance of %NetworkStatus
+     */
+       NetworkStatus& operator =(const NetworkStatus& rhs);
+
+private:
+       _NetworkStatusImpl* __pNetworkStatusImpl;
+
+       friend class _NetworkStatusImpl;
+}; // NetworkStatus
+
+}} // Tizen::Telephony
+#endif // _FTEL_NETWORK_STATUS_H_
diff --git a/inc/FTelSimInfo.h b/inc/FTelSimInfo.h
new file mode 100755 (executable)
index 0000000..53cbf09
--- /dev/null
@@ -0,0 +1,266 @@
+//
+// Open Service Platform
+// Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Apache License, Version 2.0 (the License);
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// 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.
+//
+/**
+ * @file       FTelSimInfo.h
+ * @brief      This is the header file for the %SimInfo class.
+ *
+ * This header file contains the declarations of the %SimInfo class.
+ */
+#ifndef _FTEL_SIM_INFO_H_
+#define _FTEL_SIM_INFO_H_
+
+
+#include <FBase.h>
+
+
+namespace Tizen { namespace Telephony
+{
+class _SimInfoImpl;
+
+/**
+ * @class      SimInfo
+ * @brief      This class provides information of the currently inserted SIM card.
+ * @since      2.0
+ *
+ * The %SimInfo class provides methods to get information from the SIM card such as MCC, MNC, SPN, ICC ID, the name of operator,
+ * and whether the SIM card is available or not.
+ *
+ * The following example demonstrates how to use the %SimInfo class to get the SIM information.
+ *
+ * @code
+ *
+ *     result
+ *     MyClass::GetSimInfo(void)
+ *     {
+ *             int mnc;
+ *             int mcc;
+ *             bool isAvailable;
+ *             String spn;
+ *             String iccId;
+ *             String operatorName;
+ *
+ *             SimInfo* pSimInfo = new SimInfo();
+ *
+ *             result r = pSimInfo->Construct();
+ *             if (IsFailed(r))
+ *             {
+ *                     delete pSimInfo;
+ *                     return r;
+ *             }
+ *
+ *             mnc = pSimInfo->GetMnc();
+ *             mcc = pSimInfo->GetMcc();
+ *             spn = pSimInfo->GetSpn();
+ *             iccId = pSimInfo->GetIccId();
+ *             operatorName = pSimInfo->GetOperatorName();
+ *             isAvailable = pSimInfo->IsAvailable();
+ *
+ *             delete pSimInfo;
+ *             return E_SUCCESS;
+ *     }
+ *
+ * @endcode
+ */
+class _OSP_EXPORT_ SimInfo
+       : public Tizen::Base::Object
+{
+public:
+       /**
+     * The object is not fully constructed after this constructor is called. For full construction, the Construct() method must be called right after calling this constructor.
+     *
+     * @since  2.0
+     */
+       SimInfo(void);
+
+       /**
+     * This destructor overrides Tizen::Base::Object::~Object().
+     *
+     * @since  2.0
+     */
+       virtual ~SimInfo(void);
+
+       /**
+     * Initializes this instance of %SimInfo.
+     *
+     * @since  2.0
+        *
+     * @return An error code
+     * @exception      E_SUCCESS       The method is successful.
+     * @exception      E_SYSTEM        A system error has occurred.
+     * @exception      E_DEVICE_UNAVAILABLE    The operation has failed due to a missing SIM card.
+     */
+       result Construct(void);
+
+       /**
+     * Gets the Mobile Network Code (MNC) of the SIM International Mobile Subscriber Identity (IMSI) information.
+     *
+     * @since  2.0
+        *
+     * @privilege   %http://tizen.org/privilege/systeminfo
+     *
+     * @return      The MNC of the SIM card, @n
+     *              else @c -1 if the method fails
+     * @exception      E_SUCCESS       The method is successful.
+     * @exception      E_DEVICE_UNAVAILABLE    The operation has failed due to a missing SIM card.
+     * @exception      E_PRIVILEGE_DENIED      The application does not have the privilege to call this method.
+     * @remarks                The specific error code can be accessed using the GetLastResult() method.
+     */
+       int GetMnc(void) const;
+
+       /**
+     * Gets the Mobile Country Code (MCC) of the SIM IMSI information.
+     *
+     * @since  2.0
+        *
+     * @privilege   %http://tizen.org/privilege/systeminfo
+     *
+     * @return      The MCC of the SIM card, @n
+     *              else @c -1 if the method fails
+     * @exception      E_SUCCESS       The method is successful.
+     * @exception      E_DEVICE_UNAVAILABLE    The operation has failed due to a missing SIM card.
+     * @exception      E_PRIVILEGE_DENIED      The application does not have the privilege to call this method.
+     * @remarks                The specific error code can be accessed using the GetLastResult() method.
+     */
+       int GetMcc(void) const;
+
+       /**
+     * Gets the Service Provider Name (SPN) string of the SIM card.
+     *
+     * @since  2.0
+        *
+     * @privilege   %http://tizen.org/privilege/systeminfo
+     *
+     * @return      The SPN of the SIM card, @n
+     *              else an empty string if there is no SIM card in the device, or if an SPN is not assigned to the SIM card
+     * @exception   E_SUCCESS  The method is successful.
+     * @exception   E_DEVICE_UNAVAILABLE       The operation has failed due to a missing SIM card.
+     * @exception   E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
+     * @remarks                The specific error code can be accessed using the GetLastResult() method.
+     */
+       Tizen::Base::String GetSpn(void) const;
+
+       /**
+     * Gets the Integrated Circuit Card Identifier (ICCID) of the SIM card. @n
+     * One useful case to detect the change of SIM cards is to store this value and compare it with the most recent value.
+     * This method provides a unique identification number for the SIM card.
+     *
+     * @since  2.0
+        *
+     * @privilege   %http://tizen.org/privilege/systeminfo
+     *
+     * @return  The ICCID of the SIM card, @n
+     *          else an empty string if the method fails
+     * @exception   E_SUCCESS  The method is successful.
+     * @exception   E_DEVICE_UNAVAILABLE       The operation has failed due to a missing SIM card.
+     * @exception   E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
+     * @remarks                The specific error code can be accessed using the GetLastResult() method.
+     */
+       Tizen::Base::String GetIccId(void) const;
+
+    /**
+     * Gets the operator name of Common PCN Handset Specification (CPHS) of the SIM card.
+     *
+     * @since  2.0
+        *
+     * @privilege   %http://tizen.org/privilege/systeminfo
+     *
+     * @return      The operator name of the SIM card, @n
+     *              else an empty string if there is no SIM card in the device, or if an operator name is not assigned to the SIM card
+     * @exception      E_SUCCESS       The method is successful.
+     * @exception      E_DEVICE_UNAVAILABLE    The operation has failed due to a missing SIM card.
+     * @exception      E_PRIVILEGE_DENIED      The application does not have the privilege to call this method.
+     * @remarks If this method has failed, then this method returns an empty string.
+     * @remarks                The specific error code can be accessed using the GetLastResult() method.
+     */
+       Tizen::Base::String GetOperatorName(void) const;
+
+       /**
+     * Gets the phone number of the SIM card.
+     *
+     * @since  2.0
+        *
+     * @privilege   %http://tizen.org/privilege/systeminfo
+     *
+     * @return      The phone number of the SIM card, @n
+     *              else an empty string if there is no SIM card in the device, or if a Mobile Station International Subscriber Directory Number
+     *              (MSISDN) is not assigned to the SIM card
+     * @exception      E_SUCCESS    The method is successful.
+     * @exception      E_DEVICE_UNAVAILABLE    The operation has failed due to a missing SIM card.
+     * @exception      E_PRIVILEGE_DENIED      The application does not have the privilege to call this method.
+     * @exception      E_SYSTEM        A system error has occurred.
+     * @remarks                The specific error code can be accessed using the GetLastResult() method.
+     */
+       Tizen::Base::String GetPhoneNumber(void) const;
+
+       /**
+     * @if VISPARTNER
+     * Gets the International Mobile Subscriber Identity (IMSI) of the SIM card.
+     *
+     * @since  2.0
+        *
+     * @visibility  partner
+     * @privilege   %http://tizen.org/privilege/useridentity
+     *
+     * @return      The IMSI of the SIM card, @n
+     *              else an empty string if the method fails
+     * @exception      E_SUCCESS       The method is successful.
+     * @exception      E_DEVICE_UNAVAILABLE    The operation has failed due to a missing SIM card.
+     * @exception      E_PRIVILEGE_DENIED      The application does not have the privilege to call this method.
+     * @exception      E_SYSTEM The method cannot proceed due to a severe system error.
+     * @remarks                The specific error code can be accessed using the GetLastResult() method.
+     * @endif
+     */
+       Tizen::Base::String GetImsi(void) const;
+
+       /**
+     * Checks whether a SIM card is present in the device or not.
+     *
+     * @since  2.0
+        *
+     * @privilege   %http://tizen.org/privilege/systeminfo
+     *
+     * @return  @c true if the SIM card is present in the device, @n
+     *          else @c false
+     * @exception      E_SUCCESS       The method is successful.
+     * @exception      E_PRIVILEGE_DENIED      The application does not have the privilege to call this method.
+     * @remarks                The specific error code can be accessed using the GetLastResult() method.
+     */
+       bool IsAvailable(void) const;
+
+private:
+       /**
+     * The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.
+     *
+     * @param[in]   rhs   An instance of %SimInfo
+     */
+       SimInfo(const SimInfo& rhs);
+
+       /**
+     * The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects.
+     *
+     * @param[in]   rhs An instance of %SimInfo
+     */
+       SimInfo& operator =(const SimInfo& rhs);
+
+private:
+       _SimInfoImpl* __pSimInfoImpl;
+
+       friend class _SimInfoImpl;
+}; // SimInfo
+
+}} // Tizen::Telephony
+#endif // _FTEL_SIM_INFO_H_
diff --git a/inc/FTelTypes.h b/inc/FTelTypes.h
new file mode 100644 (file)
index 0000000..5ccf836
--- /dev/null
@@ -0,0 +1,61 @@
+//
+// Open Service Platform
+// Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Apache License, Version 2.0 (the License);
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// 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.
+//
+/**
+ * @file    FTelTypes.h
+ * @brief   This is the header file for the enumerations of the Tizen::Telephony namespace.
+ *
+ * This header file contains the definitions of the enumerations of the Tizen::Telephony namespace.
+ */
+#ifndef _FTEL_ENUM_H_
+#define _FTEL_ENUM_H_
+
+namespace Tizen { namespace Telephony
+{
+/**
+ * @enum    CallType
+ *
+ * Defines the type of the current call.
+ *
+ * @since   2.0
+ */
+enum CallType
+{
+       TYPE_UNDEFINED_CALL = -1,   /**< No defined type */
+       TYPE_VOICE_CALL = 0,        /**< The voice call type */
+       TYPE_VIDEO_CALL             /**< The video call type */
+};
+
+/**
+ * @enum    CallStatus
+ *
+ * Defines the current status of calls.
+ *
+ * @since   2.0
+ */
+enum CallStatus
+{
+       CALL_STATUS_UNDEFINED = -1, /**< No defined type */
+       CALL_STATUS_IDLE = 0,       /**< No call is in progress */
+       CALL_STATUS_ACTIVE,         /**< @if OSPDEPREC @deprecated This enum value is deprecated because an active status is divided into three, that is, communicating, ringing, dialing, and holding @endif */
+       CALL_STATUS_COMMUNICATING,  /**< Voice or video calls are in progress */
+       CALL_STATUS_RINGING,        /**< An incoming voice or video call */
+       CALL_STATUS_DIALING,        /**< An outgoing voice or video call */
+       CALL_STATUS_HOLDING         /**< A call on holding status */
+};
+
+}} // Tizen::Telephony
+#endif // _FTEL_ENUM_H_
diff --git a/inc/FTelephony.h b/inc/FTelephony.h
new file mode 100644 (file)
index 0000000..2d57b16
--- /dev/null
@@ -0,0 +1,64 @@
+//
+// Open Service Platform
+// Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Apache License, Version 2.0 (the License);
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// 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.
+//
+/**
+ * @file    FTelephony.h
+ * @brief   This is the header file for the %Telephony namespace.
+ *
+ * This header file contains the declarations and descriptions of the %Telephony namespace.
+ */
+#ifndef _FTELEPHONY_H_
+#define _FTELEPHONY_H_
+
+
+#include <FTelTypes.h>
+#include <FTelCallInfo.h>
+#include <FTelCallManager.h>
+#include <FTelNetworkInfo.h>
+#include <FTelNetworkStatus.h>
+#include <FTelNetworkManager.h>
+#include <FTelSimInfo.h>
+#include <FTelITelephonyCallEventListener.h>
+#include <FTelITelephonyCallForwardListener.h>
+#include <FTelITelephonyNetworkEventListener.h>
+#include <FTelITelephonyNetworkSettingListener.h>
+
+
+/**
+ * @namespace   Tizen::Telephony
+ * @brief       This namespace contains classes and interfaces of the %Telephony service.
+ * @since       2.0
+ *
+ * @remarks     @b Header @b %file: @b \#include @b <FTelephony.h> @n
+ *              @b Library : @b osp-telephony
+ *
+ * The %Telephony namespace is one of the main namespaces of the Tizen framework.
+ * It provides classes and methods that enable an application to
+ * access the telephony capabilities of the device, such as call facility (call information and status),
+ * network query services, and SIM module.
+ *
+ * For more information on the %Telephony namespace features, see <a href="../org.tizen.native.appprogramming/html/guide/telephony/telephony.htm">Telephony Guide</a>.
+ *
+ *
+ * The following diagram illustrates the relationships between the classes belonging to the %Telephony namespace.
+ * @image html telephony_using_the_apis_classdiagram.png
+ *
+ **/
+
+namespace Tizen { namespace Telephony
+{
+}} // Tizen::Telephony
+#endif // _FTELEPHONY_H_
diff --git a/osp-telephony.manifest b/osp-telephony.manifest
new file mode 100644 (file)
index 0000000..ae3e6f7
--- /dev/null
@@ -0,0 +1,5 @@
+<manifest>
+       <request>
+               <domain name="_"/>
+       </request>
+</manifest>
\ No newline at end of file
diff --git a/osp-telephony.pc.in b/osp-telephony.pc.in
new file mode 100755 (executable)
index 0000000..eb6c3b7
--- /dev/null
@@ -0,0 +1,14 @@
+# Package Information for pkg-config
+
+prefix=@PREFIX@
+exec_prefix=/usr
+libdir=/usr/lib/osp
+includedir=/usr/include/osp
+
+Name: @PC_NAME@
+Description: @PACKAGE_DESCRIPTION@
+Version: @VERSION@
+Requires: @PC_REQUIRED@ 
+Libs: -L${libdir} @PC_LDFLAGS@
+Cflags: -I${includedir}
+
diff --git a/packaging/osp-telephony.spec b/packaging/osp-telephony.spec
new file mode 100644 (file)
index 0000000..7a5b60f
--- /dev/null
@@ -0,0 +1,92 @@
+%define debug_package %{nil}
+%define __strip /bin/true
+
+Name:          osp-telephony
+Summary:       osp telephony library
+Version:       1.2.0.0
+Release:       2
+Group:         System/Libraries
+License:       Apache License, Version 2.0
+Source0:       %{name}-%{version}.tar.gz
+BuildRequires:  cmake
+BuildRequires:  pkgconfig(chromium)
+BuildRequires:  pkgconfig(capi-telephony-sim)
+BuildRequires:  pkgconfig(capi-telephony-network-info)
+BuildRequires:  pkgconfig(capi-network-connection)
+BuildRequires:  pkgconfig(glib-2.0)
+BuildRequires:  pkgconfig(tapi)
+BuildRequires:  pkgconfig(osp-appfw)
+BuildRequires:  osp-appfw-internal-devel
+BuildRequires:  pkgconfig(osp-net)
+BuildRequires:  osp-net-internal-devel
+
+# runtime requires
+Requires: osp-appfw 
+Requires: osp-net
+
+%description
+osp telephony library
+
+%package devel
+Summary:    osp telephony library (Development)
+Group:      TO_BE/FILLED_IN
+Requires:   %{name} = %{version}-%{release}
+
+%description devel
+osp telephony library (DEV)
+
+%package internal-devel
+Summary:    osp telephony library (Internal)
+Group:      TO_BE/FILLED_IN
+Requires:   %{name} = %{version}-%{release}
+
+%description internal-devel
+osp telephony library (Internal-DEV)
+
+%package debug
+Summary:    osp telephony library (Development)
+Group:      TO_BE/FILLED_IN
+Requires:   %{name} = %{version}-%{release}
+
+%description debug
+osp telephony library (DEV)
+
+%prep
+%setup -q
+
+%build 
+MAJORVER=`echo %{version} | awk 'BEGIN {FS="."}{print $1}'`
+%ifarch %{ix86}
+CXXFLAGS="$CXXFLAGS -D_OSP_DEBUG_ -D_OSP_X86_ -D_OSP_EMUL_" cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} -DFULLVER=%{version} -DMAJORVER=${MAJORVER}
+%else
+CXXFLAGS="-O2 -g -pipe -Wall -fno-exceptions -Wformat -Wformat-security -Wl,--as-needed -fmessage-length=0 -march=armv7-a -mtune=cortex-a8 -mlittle-endian -mfpu=neon -mfloat-abi=softfp -D__SOFTFP__ -mthumb -Wa,-mimplicit-it=thumb -funwind-tables -D_OSP_DEBUG_ -D_OSP_ARMEL_" cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} -DFULLVER=%{version} -DMAJORVER=${MAJORVER}
+%endif
+
+# Call make instruction with smp support
+make %{?jobs:-j%jobs}
+
+%install
+rm -rf %{buildroot}
+mkdir -p %{buildroot}/usr/share/license
+cp %{_builddir}/%{name}-%{version}/LICENSE.APLv2  %{buildroot}/usr/share/license/%{name}
+
+%make_install
+
+%post -p /sbin/ldconfig
+
+%postun -p /sbin/ldconfig
+
+%files
+%manifest osp-telephony.manifest
+/usr/share/license/%{name}
+%{_libdir}/osp/*.so*
+
+%files devel
+%{_includedir}/osp/*.h
+%{_libdir}/pkgconfig/osp-telephony.pc
+
+%files internal-devel
+%{_includedir}/osp/telephony/*.h
+
+%files debug
+%{_libdir}/osp/debug/*.so*
diff --git a/src/FTelCallInfo.cpp b/src/FTelCallInfo.cpp
new file mode 100644 (file)
index 0000000..7400b1f
--- /dev/null
@@ -0,0 +1,106 @@
+//
+// Open Service Platform
+// Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Apache License, Version 2.0 (the License);
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// 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.
+//
+/**
+ * @file        FTelCallInfo.cpp
+ * @brief       This is the implementation file for CallInfo class.
+ */
+
+
+#include <FTelCallInfo.h>
+#include <FBaseSysLog.h>
+#include "FTel_CallInfoImpl.h"
+
+
+using namespace Tizen::Base;
+
+namespace Tizen { namespace Telephony
+{
+CallInfo::CallInfo(void)
+       : __pCallInfoImpl(null)
+{
+       __pCallInfoImpl = new (std::nothrow) _CallInfoImpl();
+       SysTryReturnVoidResult(NID_TEL, __pCallInfoImpl != null, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
+}
+
+CallInfo::CallInfo(const CallInfo& callInfo)
+       : __pCallInfoImpl(null)
+{
+       __pCallInfoImpl = new (std::nothrow) _CallInfoImpl(*callInfo.__pCallInfoImpl);
+       SysTryReturnVoidResult(NID_TEL, __pCallInfoImpl != null, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
+}
+
+CallInfo::~CallInfo(void)
+{
+       delete __pCallInfoImpl;
+}
+
+CallInfo&
+CallInfo::operator=(const CallInfo& rhs)
+{
+       if (this != &rhs)
+       {
+       *__pCallInfoImpl = *(rhs.__pCallInfoImpl);
+       }
+
+       return *this;
+}
+
+CallType
+CallInfo::GetCallType(void) const
+{
+       return __pCallInfoImpl->GetCallType();
+}
+
+String
+CallInfo::GetNumber(void) const
+{
+       return __pCallInfoImpl->GetNumber();
+}
+
+bool
+CallInfo::Equals(const Object& obj) const
+{
+       const CallInfo* pOther = dynamic_cast<const CallInfo*>(&obj);
+
+       if (pOther == null)
+       {
+       return false;
+       }
+
+       if (pOther == this)
+       {
+       return true;
+       }
+
+       return __pCallInfoImpl->Equals(*pOther->__pCallInfoImpl);
+}
+
+int
+CallInfo::GetHashCode(void) const
+{
+       return __pCallInfoImpl->GetHashCode();
+}
+
+CallInfo::CallInfo(CallType type, const String& number)
+{
+       SysLog(NID_TEL,"The CallType is %d and the number is %ls", type, number.GetPointer());
+
+       __pCallInfoImpl = new (std::nothrow) _CallInfoImpl(type, number);
+       SysTryReturnVoidResult(NID_TEL, __pCallInfoImpl != null, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
+}
+
+}} // Tizen::Telephony
diff --git a/src/FTelCallManager.cpp b/src/FTelCallManager.cpp
new file mode 100644 (file)
index 0000000..c80835f
--- /dev/null
@@ -0,0 +1,196 @@
+//
+// Open Service Platform
+// Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Apache License, Version 2.0 (the License);
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// 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.
+//
+/**
+ * @file        CallManager.cpp
+ * @brief       This is the implementation file for CallManager class.
+ */
+
+#include <FTelCallManager.h>
+#include <FBaseSysLog.h>
+#include <FSec_AccessController.h>
+#include "FTel_CallManagerImpl.h"
+
+using namespace Tizen::Base;
+using namespace Tizen::Security;
+
+
+namespace Tizen { namespace Telephony
+{
+CallManager::CallManager(void)
+       : __pCallManagerImpl(null)
+{
+}
+
+CallManager::~CallManager(void)
+{
+       delete __pCallManagerImpl;
+}
+
+result
+CallManager::Construct(void)
+{
+       SysAssertf(__pCallManagerImpl  == null,
+                       "Already constructed. Calling Construct() twice or more on a same instance is not allowed for this class.");
+
+       result r = E_SUCCESS;
+
+       __pCallManagerImpl = new (std::nothrow) _CallManagerImpl();
+       SysTryReturnResult(NID_TEL, __pCallManagerImpl != null, E_OUT_OF_MEMORY, "Memory allocation failed.");
+
+       r = __pCallManagerImpl->Construct();
+       if (r != E_SUCCESS)
+       {
+               SysLogException(NID_TEL, r, "[%s] Propagating.", GetErrorMessage(r));
+               delete __pCallManagerImpl;
+               __pCallManagerImpl = null;
+       }
+
+       return r;
+}
+
+result
+CallManager::Construct(ITelephonyCallEventListener& listener)
+{
+       SysAssertf(__pCallManagerImpl == null,
+               "Already constructed. Calling Construct() twice or more on a same instance is not allowed for this class.");
+
+       result r = E_SUCCESS;
+
+       __pCallManagerImpl = new (std::nothrow) _CallManagerImpl();
+       SysTryReturnResult(NID_TEL, __pCallManagerImpl != null, E_OUT_OF_MEMORY, "Memory allocation failed.");
+
+       r = __pCallManagerImpl->Construct(&listener);
+
+       if (r != E_SUCCESS)
+       {
+               SysLogException(NID_TEL, r, "[%s] Propagating.", GetErrorMessage(r));
+               delete __pCallManagerImpl;
+               __pCallManagerImpl = null;
+       }
+
+       return r;
+}
+
+result
+CallManager::SetCallForwardListener(ITelephonyCallForwardListener* pListener)
+{
+       SysAssertf(__pCallManagerImpl != null, "Not yet constructed. Construct() should be called before use.");
+
+       result r = E_SUCCESS;
+
+       r = __pCallManagerImpl->SetCallForwardListener(pListener);
+
+    if (r == E_PRIVILEGE_DENIED)
+    {
+        SysLogException(NID_TEL, E_PRIVILEGE_DENIED, "[%s] The application does not have the privilege to call this method.", GetErrorMessage(E_PRIVILEGE_DENIED));
+    }
+    else if( r != E_SUCCESS)
+    {
+        SysLogException(NID_TEL, r,"[%s] Propagating.", GetErrorMessage(r));
+    }
+
+       return r;
+}
+
+result
+CallManager::RequestCallForward(const String& phoneNumber)
+{
+       SysAssertf(__pCallManagerImpl != null, "Not yet constructed. Construct() should be called before use.");
+
+       result r = E_SUCCESS;
+
+       r = __pCallManagerImpl->RequestCallForward(phoneNumber);
+
+    if (r == E_PRIVILEGE_DENIED)
+    {
+        SysLogException(NID_TEL, E_PRIVILEGE_DENIED, "[%s] The application does not have the privilege to call this method.", GetErrorMessage(E_PRIVILEGE_DENIED));
+    }
+    else if( r != E_SUCCESS)
+    {
+        SysLogException(NID_TEL, r,"[%s] Propagating.", GetErrorMessage(r));
+    }
+
+       return r;
+}
+
+result
+CallManager::StopCallForward(void)
+{
+       SysAssertf(__pCallManagerImpl != null, "Not yet constructed. Construct() should be called before use.");
+
+       result r = E_SUCCESS;
+
+       r = __pCallManagerImpl->StopCallForward();
+
+    if (r == E_PRIVILEGE_DENIED)
+    {
+        SysLogException(NID_TEL, E_PRIVILEGE_DENIED, "[%s] The application does not have the privilege to call this method.", GetErrorMessage(E_PRIVILEGE_DENIED));
+    }
+    else if( r != E_SUCCESS)
+    {
+        SysLogException(NID_TEL, r,"[%s] Propagating.", GetErrorMessage(r));
+    }
+
+       return r;
+}
+
+result
+CallManager::GetCallForwardNumber(void) const
+{
+       SysAssertf(__pCallManagerImpl != null, "Not yet constructed. Construct() should be called before use.");
+
+       result r = E_SUCCESS;
+
+       r = __pCallManagerImpl->GetCallForwardNumber();
+
+    if (r == E_PRIVILEGE_DENIED)
+    {
+        SysLogException(NID_TEL, E_PRIVILEGE_DENIED, "[%s] The application does not have the privilege to call this method.", GetErrorMessage(E_PRIVILEGE_DENIED));
+    }
+    else if( r != E_SUCCESS)
+    {
+        SysLogException(NID_TEL, r,"[%s] Propagating.", GetErrorMessage(r));
+    }
+
+       return r;
+}
+
+CallType
+CallManager::GetCurrentCallType(void) const
+{
+       SysAssertf(__pCallManagerImpl != null, "Not yet constructed. Construct() should be called before use.");
+
+       CallType callType = TYPE_UNDEFINED_CALL;
+
+       callType = __pCallManagerImpl->GetCurrentCallType();
+
+       return callType;
+}
+
+CallStatus
+CallManager::GetCurrentCallStatus(void) const
+{
+       SysAssertf(__pCallManagerImpl != null, "Not yet constructed. Construct() should be called before use.");
+
+       CallStatus callStatus = CALL_STATUS_UNDEFINED;
+
+       callStatus = __pCallManagerImpl->GetCurrentCallStatus();
+
+       return callStatus;
+}
+
+}} // Tizen::Telephony
diff --git a/src/FTelNetworkInfo.cpp b/src/FTelNetworkInfo.cpp
new file mode 100644 (file)
index 0000000..6551d82
--- /dev/null
@@ -0,0 +1,204 @@
+//
+// Open Service Platform
+// Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Apache License, Version 2.0 (the License);
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// 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.
+//
+/**
+ * @file        FTelNetworkInfo.cpp
+ * @brief       This is the implementation file for NetworkInfo class.
+ */
+
+#include <FTelNetworkInfo.h>
+#include <FBaseSysLog.h>
+#include <FSec_AccessController.h>
+#include "FTel_NetworkInfoImpl.h"
+
+
+using namespace Tizen::Base;
+using namespace Tizen::Security;
+
+
+namespace Tizen { namespace Telephony
+{
+
+NetworkInfo::NetworkInfo(void)
+       : __pNetworkInfoImpl(null)
+{
+       __pNetworkInfoImpl = new (std::nothrow) _NetworkInfoImpl();
+       SysTryReturnVoidResult(NID_TEL, __pNetworkInfoImpl != null, E_OUT_OF_MEMORY, "Memory allocation failed.");
+}
+
+NetworkInfo::NetworkInfo(const NetworkInfo& value)
+{
+       __pNetworkInfoImpl = new (std::nothrow) _NetworkInfoImpl(*(value.__pNetworkInfoImpl));
+       SysTryReturnVoidResult(NID_TEL, __pNetworkInfoImpl != null, E_OUT_OF_MEMORY, "Memory allocation failed.");
+}
+
+NetworkInfo::~NetworkInfo(void)
+{
+       delete __pNetworkInfoImpl;
+}
+
+NetworkInfo&
+NetworkInfo::operator=(const NetworkInfo& rhs)
+{
+       if (this != &rhs)
+    {
+       *__pNetworkInfoImpl = *(rhs.__pNetworkInfoImpl);
+       }
+
+       return *this;
+}
+
+int
+NetworkInfo::GetMnc(void) const
+{
+       ClearLastResult();
+
+       int mnc = -1;
+       result r = _AccessController::CheckUserPrivilege(_PRV_SYSTEMINFO);
+
+       SysTryReturn(NID_TEL, r == E_SUCCESS, mnc, E_PRIVILEGE_DENIED,
+            "[%s] The application does not have the privilege to call this method.", GetErrorMessage(E_PRIVILEGE_DENIED));
+
+       mnc = __pNetworkInfoImpl->GetMnc();
+
+       return mnc;
+}
+
+int
+NetworkInfo::GetMcc(void) const
+{
+       ClearLastResult();
+
+       int mcc = -1;
+       result r = _AccessController::CheckUserPrivilege(_PRV_SYSTEMINFO);
+
+       SysTryReturn(NID_TEL, r == E_SUCCESS, mcc, E_PRIVILEGE_DENIED,
+                   "[%s] The application does not have the privilege to call this method.", GetErrorMessage(E_PRIVILEGE_DENIED));
+
+       mcc = __pNetworkInfoImpl->GetMcc();
+
+       return mcc;
+}
+
+String
+NetworkInfo::GetPlmn(void) const
+{
+       ClearLastResult();
+
+       String plmn;
+       result r = _AccessController::CheckUserPrivilege(_PRV_SYSTEMINFO);
+
+       SysTryReturn(NID_TEL, r == E_SUCCESS, plmn, E_PRIVILEGE_DENIED,
+                   "[%s] The application does not have the privilege to call this method.", GetErrorMessage(E_PRIVILEGE_DENIED));
+
+       plmn = __pNetworkInfoImpl->GetPlmn();
+
+       return plmn;
+}
+
+int
+NetworkInfo::GetCellId(void) const
+{
+       ClearLastResult();
+
+       int cellId = -1;
+       result r = _AccessController::CheckUserPrivilege(_PRV_SYSTEMINFO);
+
+       SysTryReturn(NID_TEL, r == E_SUCCESS, cellId, E_PRIVILEGE_DENIED,
+               "[%s] The application does not have the privilege to call this method.", GetErrorMessage(E_PRIVILEGE_DENIED));
+
+       cellId = __pNetworkInfoImpl->GetCellId();
+
+       return cellId;
+}
+
+int
+NetworkInfo::GetLac(void) const
+{
+       ClearLastResult();
+
+       int lac = -1;
+       result r = _AccessController::CheckUserPrivilege(_PRV_SYSTEMINFO);
+
+       SysTryReturn(NID_TEL, r == E_SUCCESS, lac, E_PRIVILEGE_DENIED,
+               "[%s] The application does not have the privilege to call this method.", GetErrorMessage(E_PRIVILEGE_DENIED));
+
+       lac = __pNetworkInfoImpl->GetLac();
+
+       return lac;
+}
+
+String
+NetworkInfo::GetOperatorName(void) const
+{
+    ClearLastResult();
+
+    String operatorName;
+    result r = _AccessController::CheckUserPrivilege(_PRV_SYSTEMINFO);
+
+    SysTryReturn(NID_TEL, r == E_SUCCESS, operatorName, E_PRIVILEGE_DENIED,
+                "[%s] The application does not have the privilege to call this method.", GetErrorMessage(E_PRIVILEGE_DENIED));
+
+    operatorName = __pNetworkInfoImpl->GetOperatorName();
+
+    return operatorName;
+}
+
+bool
+NetworkInfo::Equals(const Object& obj) const
+{
+       const NetworkInfo* pOther = dynamic_cast<const NetworkInfo*>(&obj);
+
+       if (pOther == null)
+       {
+       return false;
+       }
+
+       if (pOther == this)
+       {
+       return true;
+       }
+
+       return __pNetworkInfoImpl->Equals(*pOther->__pNetworkInfoImpl);
+}
+
+int
+NetworkInfo::GetHashCode(void) const
+{
+       return __pNetworkInfoImpl->GetHashCode();
+}
+
+int
+NetworkInfo::GetRssi(void)
+{
+       ClearLastResult();
+
+       int rssi = -1;
+       result r = _AccessController::CheckUserPrivilege(_PRV_SYSTEMINFO);
+
+       SysTryReturn(NID_TEL, r == E_SUCCESS, rssi, E_PRIVILEGE_DENIED,
+                   "[%s] The application does not have the privilege to call this method.", GetErrorMessage(E_PRIVILEGE_DENIED));
+
+       rssi = _NetworkInfoImpl::GetRssi();
+
+       r = GetLastResult();
+
+       SysTryReturn(NID_TEL, r == E_SUCCESS, rssi, r, "[%s] Propagating.", GetErrorMessage(r));
+
+       return rssi;
+}
+
+}} // Tizen::Telephony
diff --git a/src/FTelNetworkManager.cpp b/src/FTelNetworkManager.cpp
new file mode 100644 (file)
index 0000000..e7c7c30
--- /dev/null
@@ -0,0 +1,201 @@
+//
+// Open Service Platform
+// Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Apache License, Version 2.0 (the License);
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// 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.
+//
+/**
+ * @file        FTelNetworkManager.cpp
+ * @brief       This is the implementation file for NetworkManager class.
+ */
+
+#include <FTelNetworkManager.h>
+#include <FBaseSysLog.h>
+#include <FTelITelephonyNetworkEventListener.h>
+#include <FTelITelephonyNetworkSettingListener.h>
+#include <FSec_AccessController.h>
+#include "FTel_NetworkManagerImpl.h"
+
+using namespace Tizen::Security;
+
+namespace Tizen { namespace Telephony
+{
+NetworkManager::NetworkManager(void)
+       : __pNetworkManagerImpl(null)
+{
+
+}
+
+NetworkManager::~NetworkManager(void)
+{
+       delete __pNetworkManagerImpl;
+}
+
+result
+NetworkManager::Construct(ITelephonyNetworkEventListener* pListener)
+{
+       SysAssertf(__pNetworkManagerImpl == null,
+               "Already constructed. Calling Construct() twice or more on a same instance is not allowed for this class.");
+
+       result r = E_SUCCESS;
+
+       __pNetworkManagerImpl = new (std::nothrow) _NetworkManagerImpl();
+       SysTryReturnResult(NID_TEL, __pNetworkManagerImpl != null, E_OUT_OF_MEMORY, "Memory allocation failed.");
+
+       r = __pNetworkManagerImpl->Construct(pListener);
+
+       if (r != E_SUCCESS)
+       {
+               SysLogException(NID_TEL, r, "[%s] Propagating.", GetErrorMessage(r));
+               delete __pNetworkManagerImpl;
+               __pNetworkManagerImpl = null;
+       }
+
+       return r;
+}
+
+result
+NetworkManager::GetNetworkStatus(NetworkStatus& networkStatus) const
+{
+       SysAssertf(__pNetworkManagerImpl != null, "Not yet constructed. Construct() should be called before use.");
+
+       result r = E_SUCCESS;
+
+       r = _AccessController::CheckUserPrivilege(_PRV_SYSTEMINFO);
+       SysTryReturnResult(NID_TEL, r == E_SUCCESS, E_PRIVILEGE_DENIED, "The application does not have the privilege to call this method.");
+
+       r = __pNetworkManagerImpl->GetNetworkStatus(networkStatus);
+       SysTryReturnResult(NID_TEL, r == E_SUCCESS, r, "Propagating.");
+
+       return r;
+}
+
+result
+NetworkManager::GetNetworkInfo(NetworkInfo& networkInfo) const
+{
+       SysAssertf(__pNetworkManagerImpl != null, "Not yet constructed. Construct() should be called before use.");
+
+       result r = E_SUCCESS;
+
+       r = _AccessController::CheckUserPrivilege(_PRV_SYSTEMINFO);
+       SysTryReturnResult(NID_TEL, r == E_SUCCESS, E_PRIVILEGE_DENIED, "The application does not have the privilege to call this method.");
+
+
+       r = __pNetworkManagerImpl->GetNetworkInfo(networkInfo);
+       SysTryReturnResult(NID_TEL, r == E_SUCCESS, r, "Propagating.");
+
+       return r;
+}
+
+
+
+result
+NetworkManager::SetNetworkSettingListener(ITelephonyNetworkSettingListener* pListener)
+{
+    SysAssertf(__pNetworkManagerImpl != null, "Not yet constructed. Construct() should be called before use.");
+
+    result r = __pNetworkManagerImpl->SetNetworkSettingListener(pListener);
+
+    if (r == E_PRIVILEGE_DENIED)
+    {
+        SysLogException(NID_TEL, E_PRIVILEGE_DENIED, "[%s] The application does not have the privilege to call this method.", GetErrorMessage(E_PRIVILEGE_DENIED));
+    }
+    else if( r != E_SUCCESS)
+    {
+        SysLogException(NID_TEL, r,"[%s] Propagating.", GetErrorMessage(r));
+    }
+
+    return r;
+
+}
+
+result
+NetworkManager::GetNetworkSelectionMode(void)
+{
+    SysAssertf(__pNetworkManagerImpl != null, "Not yet constructed. Construct() should be called before use.");
+
+    result r = __pNetworkManagerImpl->GetNetworkSelectionMode();
+
+    if (r == E_PRIVILEGE_DENIED)
+    {
+        SysLogException(NID_TEL, E_PRIVILEGE_DENIED, "[%s] The application does not have the privilege to call this method.", GetErrorMessage(E_PRIVILEGE_DENIED));
+    }
+    else if( r != E_SUCCESS)
+    {
+        SysLogException(NID_TEL, r,"[%s] Propagating.", GetErrorMessage(r));
+    }
+
+    return r;
+
+}
+
+result
+NetworkManager::SelectNetwork(const NetworkInfo& networkInfo)
+{
+    SysAssertf(__pNetworkManagerImpl != null, "Not yet constructed. Construct() should be called before use.");
+
+    result r = __pNetworkManagerImpl->SelectNetwork(networkInfo);
+
+    if (r == E_PRIVILEGE_DENIED)
+    {
+        SysLogException(NID_TEL, E_PRIVILEGE_DENIED, "[%s] The application does not have the privilege to call this method.", GetErrorMessage(E_PRIVILEGE_DENIED));
+    }
+    else if( r != E_SUCCESS)
+    {
+        SysLogException(NID_TEL, r,"[%s] Propagating.", GetErrorMessage(r));
+    }
+
+    return r;
+
+}
+
+result
+NetworkManager::SelectNetwork(void)
+{
+    SysAssertf(__pNetworkManagerImpl != null, "Not yet constructed. Construct() should be called before use.");
+
+    result r = __pNetworkManagerImpl->SelectNetwork();
+
+    if (r == E_PRIVILEGE_DENIED)
+    {
+        SysLogException(NID_TEL, E_PRIVILEGE_DENIED, "[%s] The application does not have the privilege to call this method.", GetErrorMessage(E_PRIVILEGE_DENIED));
+    }
+    else if( r != E_SUCCESS)
+    {
+        SysLogException(NID_TEL, r,"[%s] Propagating.", GetErrorMessage(r));
+    }
+
+    return r;
+
+}
+
+result
+NetworkManager::SearchNetwork(void)
+{
+    SysAssertf(__pNetworkManagerImpl != null, "Not yet constructed. Construct() should be called before use.");
+
+    result r = __pNetworkManagerImpl->SearchNetwork();
+
+    if (r == E_PRIVILEGE_DENIED)
+    {
+        SysLogException(NID_TEL, E_PRIVILEGE_DENIED, "[%s] The application does not have the privilege to call this method.", GetErrorMessage(E_PRIVILEGE_DENIED));
+    }
+    else if( r != E_SUCCESS)
+    {
+        SysLogException(NID_TEL, r,"[%s] Propagating.", GetErrorMessage(r));
+    }
+
+    return r;
+}
+
+}} // Tizen::Telephony
diff --git a/src/FTelNetworkStatus.cpp b/src/FTelNetworkStatus.cpp
new file mode 100644 (file)
index 0000000..ce3ad9d
--- /dev/null
@@ -0,0 +1,91 @@
+//
+// Open Service Platform
+// Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Apache License, Version 2.0 (the License);
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// 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.
+//
+/**
+ * @file        FTelNetworkStatus.cpp
+ * @brief       This is the implementation file for NetworkStatus class.
+ */
+
+#include <FTelNetworkStatus.h>
+#include <FBaseSysLog.h>
+#include <FSec_AccessController.h>
+#include "FTel_NetworkStatusImpl.h"
+
+using namespace Tizen::Security;
+
+namespace Tizen { namespace Telephony
+{
+NetworkStatus::NetworkStatus(void)
+       : __pNetworkStatusImpl(null)
+{
+       __pNetworkStatusImpl = new (std::nothrow) _NetworkStatusImpl();
+       SysTryReturnVoidResult(NID_TEL, __pNetworkStatusImpl != null, E_OUT_OF_MEMORY, "[%s] Memory allocation failed", GetErrorMessage(E_OUT_OF_MEMORY));
+}
+
+NetworkStatus::~NetworkStatus(void)
+{
+       delete __pNetworkStatusImpl;
+}
+
+bool
+NetworkStatus::IsRoaming(void) const
+{
+       ClearLastResult();
+
+       result r = _AccessController::CheckUserPrivilege(_PRV_SYSTEMINFO);
+       SysTryReturn(NID_TEL, r == E_SUCCESS, false, E_PRIVILEGE_DENIED,
+               "[%s] The application does not have the privilege to call this method.", GetErrorMessage(E_PRIVILEGE_DENIED));
+
+       bool isRoaming = false;
+
+       isRoaming = __pNetworkStatusImpl->IsRoaming();
+
+       return isRoaming;
+}
+
+bool
+NetworkStatus::IsCallServiceAvailable(void) const
+{
+       ClearLastResult();
+
+       result r = _AccessController::CheckUserPrivilege(_PRV_SYSTEMINFO);
+       SysTryReturn(NID_TEL, r == E_SUCCESS, false, E_PRIVILEGE_DENIED,
+               "[%s] The application does not have the privilege to call this method.", GetErrorMessage(E_PRIVILEGE_DENIED));
+
+       bool isCallServiceAvailable = false;
+
+       isCallServiceAvailable = __pNetworkStatusImpl->IsCallServiceAvailable();
+
+       return isCallServiceAvailable;
+}
+
+bool
+NetworkStatus::IsDataServiceAvailable(void) const
+{
+       ClearLastResult();
+
+       result r = _AccessController::CheckUserPrivilege(_PRV_SYSTEMINFO);
+       SysTryReturn(NID_TEL, r == E_SUCCESS, false, E_PRIVILEGE_DENIED,
+               "[%s] The application does not have the privilege to call this method.", GetErrorMessage(E_PRIVILEGE_DENIED));
+
+       bool isDataServiceAvailable = false;
+
+       isDataServiceAvailable = __pNetworkStatusImpl->IsDataServiceAvailable();
+
+       return isDataServiceAvailable;
+}
+
+}} // Tizen::Telephony
diff --git a/src/FTelSimInfo.cpp b/src/FTelSimInfo.cpp
new file mode 100644 (file)
index 0000000..25a619e
--- /dev/null
@@ -0,0 +1,240 @@
+//
+// Open Service Platform
+// Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Apache License, Version 2.0 (the License);
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// 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.
+//
+/**
+ * @file        FTelSimInfo.cpp
+ * @brief       This is the implementation file for SimInfo class.
+ */
+
+#include <FTelSimInfo.h>
+#include <FBaseSysLog.h>
+#include <FSec_AccessController.h>
+#include "FTel_SimInfoImpl.h"
+
+using namespace Tizen::Base;
+using namespace Tizen::Security;
+
+namespace Tizen { namespace Telephony
+{
+SimInfo::SimInfo(void)
+       : __pSimInfoImpl(null)
+{
+}
+
+SimInfo::~SimInfo(void)
+{
+       delete __pSimInfoImpl;
+}
+
+result
+SimInfo::Construct(void)
+{
+       SysAssertf(__pSimInfoImpl == null,
+               "Already constructed. Calling Construct() twice or more on a same instance is not allowed for this class.");
+
+       result r = E_SUCCESS;
+
+       __pSimInfoImpl = new (std::nothrow)_SimInfoImpl();
+       SysTryReturnResult(NID_TEL, __pSimInfoImpl != null, E_OUT_OF_MEMORY, "Memory allocation failed");
+
+       r = __pSimInfoImpl->Construct();
+
+       if (r != E_SUCCESS)
+       {
+               SysLogException(NID_TEL, r, "[%s] Propagating.", GetErrorMessage(r));
+               delete __pSimInfoImpl;
+               __pSimInfoImpl = null;
+       }
+
+       return r;
+}
+
+int
+SimInfo::GetMnc(void) const
+{
+       SysAssertf(__pSimInfoImpl != null, "Not yet constructed. Construct() should be called before use.");
+
+       ClearLastResult();
+
+       int mnc = -1;
+       result r = _AccessController::CheckUserPrivilege(_PRV_SYSTEMINFO);
+
+       SysTryReturn(NID_TEL, r == E_SUCCESS, mnc, E_PRIVILEGE_DENIED,
+               "[%s] The application does not have the privilege to call this method.", GetErrorMessage(E_PRIVILEGE_DENIED));
+
+       mnc = __pSimInfoImpl->GetMnc();
+
+       r = GetLastResult();
+
+       SysTryReturn(NID_TEL, r == E_SUCCESS, mnc, r, "[%s] Propagating.", GetErrorMessage(r));
+
+       return mnc;
+}
+
+int
+SimInfo::GetMcc(void) const
+{
+       SysAssertf(__pSimInfoImpl != null, "Not yet constructed. Construct() should be called before use.");
+
+       ClearLastResult();
+
+       int mcc = -1;
+       result r = _AccessController::CheckUserPrivilege(_PRV_SYSTEMINFO);
+
+       SysTryReturn(NID_TEL, r == E_SUCCESS, mcc, E_PRIVILEGE_DENIED,
+               "[%s] The application does not have the privilege to call this method.", GetErrorMessage(E_PRIVILEGE_DENIED));
+
+       mcc = __pSimInfoImpl->GetMcc();
+
+       r = GetLastResult();
+
+       SysTryReturn(NID_TEL, r == E_SUCCESS, mcc, r, "[%s] Propagating.", GetErrorMessage(r));
+
+       return mcc;
+}
+
+String
+SimInfo::GetSpn(void) const
+{
+       SysAssertf(__pSimInfoImpl != null, "Not yet constructed. Construct() should be called before use.");
+
+       ClearLastResult();
+
+       String spn;
+       result r = _AccessController::CheckUserPrivilege(_PRV_SYSTEMINFO);
+
+       SysTryReturn(NID_TEL, r == E_SUCCESS, spn, E_PRIVILEGE_DENIED,
+               "[%s] The application does not have the privilege to call this method.", GetErrorMessage(E_PRIVILEGE_DENIED));
+
+       spn = __pSimInfoImpl->GetSpn();
+
+       r = GetLastResult();
+
+       SysTryReturn(NID_TEL, r == E_SUCCESS, spn, r, "[%s] Propagating.", GetErrorMessage(r));
+
+       return spn;
+}
+
+String
+SimInfo::GetIccId(void) const
+{
+       SysAssertf(__pSimInfoImpl != null, "Not yet constructed. Construct() should be called before use.");
+
+       ClearLastResult();
+
+       String iccId;
+       result r = _AccessController::CheckUserPrivilege(_PRV_SYSTEMINFO);
+
+       SysTryReturn(NID_TEL, r == E_SUCCESS, iccId, E_PRIVILEGE_DENIED,
+               "[%s] The application does not have the privilege to call this method.", GetErrorMessage(E_PRIVILEGE_DENIED));
+
+       iccId = __pSimInfoImpl->GetIccId();
+
+       r = GetLastResult();
+
+       SysTryReturn(NID_TEL, r == E_SUCCESS, iccId, r, "[%s] Propagating.", GetErrorMessage(r));
+
+       return iccId;
+}
+
+String
+SimInfo::GetOperatorName(void) const
+{
+       SysAssertf(__pSimInfoImpl != null, "Not yet constructed. Construct() should be called before use.");
+
+       ClearLastResult();
+
+       String operatorName;
+       result r = _AccessController::CheckUserPrivilege(_PRV_SYSTEMINFO);
+
+       SysTryReturn(NID_TEL, r == E_SUCCESS, operatorName, E_PRIVILEGE_DENIED,
+               "[%s] The application does not have the privilege to call this method.", GetErrorMessage(E_PRIVILEGE_DENIED));
+
+       operatorName = __pSimInfoImpl->GetOperatorName();
+
+       r = GetLastResult();
+
+       SysTryReturn(NID_TEL, r == E_SUCCESS, operatorName, r, "[%s] Propagating.", GetErrorMessage(r));
+
+       return operatorName;
+}
+
+String
+SimInfo::GetPhoneNumber(void) const
+{
+       SysAssertf(__pSimInfoImpl != null, "Not yet constructed. Construct() should be called before use.");
+
+       ClearLastResult();
+
+       String phoneNumber;
+       result r = _AccessController::CheckUserPrivilege(_PRV_SYSTEMINFO);
+
+       SysTryReturn(NID_TEL, r == E_SUCCESS, phoneNumber, E_PRIVILEGE_DENIED,
+               "[%s] The application does not have the privilege to call this method.", GetErrorMessage(E_PRIVILEGE_DENIED));
+
+       phoneNumber = __pSimInfoImpl->GetPhoneNumber();
+
+       r = GetLastResult();
+
+       SysTryReturn(NID_TEL, r == E_SUCCESS, phoneNumber, r, "[%s] Propagating.", GetErrorMessage(r));
+
+       return phoneNumber;
+}
+
+String
+SimInfo::GetImsi(void) const
+{
+       SysAssertf(__pSimInfoImpl != null, "Not yet constructed. Construct() should be called before use.");
+
+       ClearLastResult();
+
+       String imsi;
+
+       imsi = __pSimInfoImpl->GetImsi();
+
+       result r = GetLastResult();
+
+       if (r == E_PRIVILEGE_DENIED)
+       {
+               SysLogException(NID_TEL, E_PRIVILEGE_DENIED,"[%s] The application does not have the privilege to call this method.", GetErrorMessage(E_PRIVILEGE_DENIED));
+       }
+       else if(r != E_SUCCESS)
+       {
+               SysLogException(NID_TEL, r, "[%s] Propagating.", GetErrorMessage(r));
+       }
+
+       return imsi;
+}
+
+bool
+SimInfo::IsAvailable(void) const
+{
+       SysAssertf(__pSimInfoImpl != null, "Not yet constructed. Construct() should be called before use.");
+
+       ClearLastResult();
+
+       bool isAvailable = false;
+       result r = _AccessController::CheckUserPrivilege(_PRV_SYSTEMINFO);
+
+       SysTryReturn(NID_TEL, r == E_SUCCESS, isAvailable, E_PRIVILEGE_DENIED,
+               "[%s] The application does not have the privilege to call this method.", GetErrorMessage(E_PRIVILEGE_DENIED));
+
+       isAvailable = __pSimInfoImpl->IsAvailable();
+
+       return isAvailable;
+}
+
+} } // Tizen::Telephony
diff --git a/src/FTel_CallForwardEvent.cpp b/src/FTel_CallForwardEvent.cpp
new file mode 100644 (file)
index 0000000..c1520c1
--- /dev/null
@@ -0,0 +1,84 @@
+//
+// Open Service Platform
+// Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Apache License, Version 2.0 (the License);
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// 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.
+//
+
+/**
+ * @file    FTel_CallForwardEvent.cpp
+ * @brief   This is the implementation file for the _CallForwardEvent Class.
+ *
+ * This header file contains implementation of the _CallForwardEvent Class.
+ */
+
+#include <FBaseRtIEventListener.h>
+#include <FBaseColArrayList.h>
+#include <FBaseSysLog.h>
+#include <FTelITelephonyCallForwardListener.h>
+#include "FTel_CallForwardEvent.h"
+#include "FTel_CallForwardEventArg.h"
+
+
+using namespace Tizen::Base::Collection;
+
+namespace Tizen { namespace Telephony
+{
+
+////////////////////////////////////////////////////////////////////////////
+_CallForwardEvent::_CallForwardEvent(void)
+{
+}
+
+_CallForwardEvent::~_CallForwardEvent(void)
+{
+}
+
+result
+_CallForwardEvent::Construct(void)
+{
+    return _Event::Initialize();
+}
+
+////////////////////////////////////////////////////////////////////////////////
+/// Operation : Protected
+
+void
+_CallForwardEvent::FireImpl(Tizen::Base::Runtime::IEventListener& listener, const Tizen::Base::Runtime::IEventArg& arg)
+{
+    const _CallForwardEventArg* pArg = dynamic_cast<const _CallForwardEventArg*>(&arg);
+    SysTryReturnVoidResult(NID_TEL, pArg != null, E_INVALID_ARG, "[%s] Invalid argument used. The arg is a null pointer.", GetErrorMessage(E_INVALID_ARG));
+
+    ITelephonyCallForwardListener* pCallForwardListner = dynamic_cast<ITelephonyCallForwardListener*>(&listener);
+    SysTryReturnVoidResult(NID_TEL, pCallForwardListner != null, E_INVALID_ARG,
+            "[%s] Invalid argument used. The result of a dynamic_cast operation is null for call forward listener", GetErrorMessage(E_INVALID_ARG));
+
+    _CallForwardEventType eventType = pArg->GetEventType();
+
+    switch(eventType)
+    {
+    case _CALL_FORWARD_EVENT_NUMBER_RECEIVED:
+        pCallForwardListner->OnTelephonyCallForwardNumberReceived(pArg->GetPhoneNumber(), pArg->GetError());
+        break;
+    case _CALL_FORWARD_EVENT_RESPONSE_RECEIVED:
+        pCallForwardListner->OnTelephonyCallForwardResponseReceived(pArg->GetPhoneNumber(), pArg->GetError());
+        break;
+    case _CALL_FORWARD_EVENT_STOPPED:
+        pCallForwardListner->OnTelephonyCallForwardStopped(pArg->GetPhoneNumber(), pArg->GetError());
+        break;
+    default:
+        break;
+    }
+}
+
+} } // Tizen::Telephony
diff --git a/src/FTel_CallForwardEvent.h b/src/FTel_CallForwardEvent.h
new file mode 100644 (file)
index 0000000..8e3877b
--- /dev/null
@@ -0,0 +1,90 @@
+//
+// Open Service Platform
+// Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Apache License, Version 2.0 (the License);
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// 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.
+//
+
+/**
+ * @file    FTel_CallForwardEvent.h
+ * @brief   This is the header file for the _CallForwardEvent class.
+ *
+ * This header file contains declarations of the _CallForwardEvent class.
+ */
+
+#ifndef _FTEL_INTERNAL_CALL_FORWARD_EVENT_H_
+#define _FTEL_INTERNAL_CALL_FORWARD_EVENT_H
+
+// Includes
+#include <FBaseResult.h>
+#include <FBaseRt_Event.h>
+
+namespace Tizen { namespace Base { namespace Runtime
+{
+class IEventListener;
+class IEventArg;
+}}}
+
+namespace Tizen { namespace Telephony
+{
+
+/**
+ * @class   _CallForwardEvent
+ * @brief   This class handles NetworkManager events related to network setting.
+ *
+ * When a CallManager event related to network setting occurs, the _CallForwardEvent object finds a ITelephonyCallForwardListener object
+ * which is registered for the Device object and calls an appropriate method of the listener.
+ */
+
+class _CallForwardEvent
+    : public Tizen::Base::Runtime::_Event
+{
+public:
+    /**
+     * This is the default constructor for this class.
+     */
+    _CallForwardEvent();
+
+    /**
+     * This is the class destructor.
+     */
+    virtual ~_CallForwardEvent(void);
+
+
+    /**
+     * Initializes a new instance of the  class
+     *
+     */
+    result Construct(void);
+
+protected:
+    /**
+     * Checks the arg and finds out the type of event. After that this method calls appropriate pListener's method.
+     *
+     * @return      A result code.
+     * @param[in]   listener        It is a event listener related to call forwarding event.
+     * @param[in]   arg             It is an argument-like instance of CallManager event retransmitted to the listener's method as an argument.
+     * @exception   E_SUCCESS       The method is successful.
+     * @exception   E_INVALID_ARG   The argument passed to a method contains an invalid value.@n
+     */
+    void FireImpl(Tizen::Base::Runtime::IEventListener& listener, const Tizen::Base::Runtime::IEventArg& arg);
+
+
+private:
+    _CallForwardEvent(const _CallForwardEvent& rhs);
+    _CallForwardEvent& operator =(const _CallForwardEvent& rhs);
+
+}; // _CallForwardEvent
+
+}} // Tizen::Telephony
+#endif // _FTEL_INTERNAL_CALL_FORWARD_EVENT_H
diff --git a/src/FTel_CallForwardEventArg.cpp b/src/FTel_CallForwardEventArg.cpp
new file mode 100644 (file)
index 0000000..852a80c
--- /dev/null
@@ -0,0 +1,68 @@
+//
+// Open Service Platform
+// Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Apache License, Version 2.0 (the License);
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// 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.
+//
+/**
+ * @file        FTel_CallForwardEventArg.cpp
+ * @brief       This is the implementation file for the %_CallForwardEventArg class.
+ *
+ * This file contains the implementation of the %_CallForwardEventArg class.
+ */
+
+#include <FBaseErrorDefine.h>
+#include "FTel_CallForwardEventArg.h"
+
+using namespace Tizen::Base;
+
+namespace Tizen { namespace Telephony
+{
+
+_CallForwardEventArg::_CallForwardEventArg(void)
+    : __error(E_SUCCESS)
+    , __eventType(_CALL_FORWARD_EVENT_NONE)
+{
+}
+
+_CallForwardEventArg::_CallForwardEventArg(_CallForwardEventType eventType, String phoneNumber, result r)
+    : __error(r)
+    , __eventType(eventType)
+    , __phoneNumber(phoneNumber)
+{
+
+}
+
+_CallForwardEventArg::~_CallForwardEventArg(void)
+{
+}
+
+result
+_CallForwardEventArg::GetError(void) const
+{
+    return __error;
+}
+
+_CallForwardEventType
+_CallForwardEventArg::GetEventType(void) const
+{
+    return __eventType;
+}
+
+String
+_CallForwardEventArg::GetPhoneNumber(void) const
+{
+    return __phoneNumber;
+}
+
+} } // Tizen::Telephony
diff --git a/src/FTel_CallForwardEventArg.h b/src/FTel_CallForwardEventArg.h
new file mode 100644 (file)
index 0000000..b446267
--- /dev/null
@@ -0,0 +1,89 @@
+//
+// Open Service Platform
+// Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Apache License, Version 2.0 (the License);
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// 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.
+//
+/**
+ * @file        FTel_CallForwardEventArg.h
+ * @brief       This is the header file for _CallForwardEventArg class.
+ *
+ * This header file contains the declarations of _CallForwardEventArg class.
+ */
+
+
+#ifndef _FTEL_INTERNAL_CALL_FORWARD_EVENT_ARG_H_
+#define _FTEL_INTERNAL_CALL_FORWARD_EVENT_ARG_H_
+
+// Includes
+#include <FBaseObject.h>
+#include <FBaseDataType.h>
+#include <FBaseString.h>
+#include <FBaseRtIEventArg.h>
+
+namespace Tizen { namespace Base { namespace Collection
+{
+class IList;
+}}}
+
+namespace Tizen { namespace Telephony
+{
+
+enum _CallForwardEventType
+{
+    _CALL_FORWARD_EVENT_NONE,
+    _CALL_FORWARD_EVENT_NUMBER_RECEIVED,
+    _CALL_FORWARD_EVENT_RESPONSE_RECEIVED,
+    _CALL_FORWARD_EVENT_STOPPED
+};
+
+
+/**
+ * @class   _CallForwardEventArg
+ * @brief   This class is used as an argument of methods of the ITelephonyCallForwardListener class.
+ *
+ * This class is used as an argument of ITelephonyCallForwardListenerListener methods.
+ * When a CallManager event occurs, the _CallForwardingEvent object finds a ITelephonyCallForwardListenerListener object
+ * which is registered for the CallManager object and calls an appropriate method of the listener.
+ */
+
+class _CallForwardEventArg
+    : public Tizen::Base::Object
+    , public Tizen::Base::Runtime::IEventArg
+{
+public:
+    _CallForwardEventArg(void);
+
+    _CallForwardEventArg(_CallForwardEventType eventType, Tizen::Base::String phoneNumber, result r);
+
+    virtual ~_CallForwardEventArg(void);
+
+    result GetError(void) const;
+
+    _CallForwardEventType GetEventType(void) const;
+
+    Tizen::Base::String GetPhoneNumber(void) const;
+
+private:
+    _CallForwardEventArg(const _CallForwardEventArg& rhs);
+    _CallForwardEventArg& operator =(const _CallForwardEventArg& rhs);
+
+private:
+    result __error;
+    _CallForwardEventType __eventType;
+    Tizen::Base::String __phoneNumber;
+
+}; // _CallForwardEventArg
+} }
+
+#endif // _FTEL_INTERNAL_CALL_FORWARD_EVENT_ARG_H_
diff --git a/src/FTel_CallInfoImpl.cpp b/src/FTel_CallInfoImpl.cpp
new file mode 100644 (file)
index 0000000..9e567ad
--- /dev/null
@@ -0,0 +1,123 @@
+//
+// Open Service Platform
+// Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Apache License, Version 2.0 (the License);
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// 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.
+//
+/**
+ * @file        FTel_CallInfoImpl.cpp
+ * @brief       This is the implementation file for _CallInfoImpl class.
+ */
+
+#include <FBaseString.h>
+#include <FTelTypes.h>
+#include <FTelCallInfo.h>
+#include "FTel_CallInfoImpl.h"
+
+using namespace Tizen::Base;
+
+namespace Tizen { namespace Telephony
+{
+
+
+_CallInfoImpl::_CallInfoImpl(void)
+       : __callType(TYPE_UNDEFINED_CALL)
+{
+}
+
+_CallInfoImpl::_CallInfoImpl(const _CallInfoImpl& callInfo)
+       : __callType(callInfo.__callType)
+       , __number(callInfo.__number)
+{
+}
+
+_CallInfoImpl::_CallInfoImpl(CallType type, const String& number)
+       : __callType(type)
+       , __number(number)
+{
+}
+
+_CallInfoImpl::~_CallInfoImpl(void)
+{
+}
+
+_CallInfoImpl&
+_CallInfoImpl::operator =(const _CallInfoImpl& rhs)
+{
+       if (this != &rhs)
+       {
+               __callType = rhs.__callType;
+               __number = rhs.__number;
+       }
+
+       return *this;
+}
+
+CallType
+_CallInfoImpl::GetCallType(void) const
+{
+       return __callType;
+}
+
+String
+_CallInfoImpl::GetNumber(void) const
+{
+       return __number;
+}
+
+void
+_CallInfoImpl::SetCallType(CallType callType)
+{
+       __callType = callType;
+}
+
+void
+_CallInfoImpl::SetNumber(const String& number)
+{
+       __number = number;
+}
+
+bool
+_CallInfoImpl::Equals(const Object& obj) const
+{
+       const _CallInfoImpl* pOther = dynamic_cast<const _CallInfoImpl*>(&obj);
+
+       if (pOther == null
+               ||__callType != pOther->__callType
+               ||!__number.Equals(pOther->__number))
+       {
+               return false;
+       }
+
+       return true;
+}
+
+int
+_CallInfoImpl::GetHashCode(void) const
+{
+       return __callType ^ __number.GetHashCode();
+}
+
+_CallInfoImpl*
+_CallInfoImpl::GetInstance(CallInfo& callInfo)
+{
+       return callInfo.__pCallInfoImpl;
+}
+
+const _CallInfoImpl*
+_CallInfoImpl::GetInstance(const CallInfo& callInfo)
+{
+       return callInfo.__pCallInfoImpl;
+}
+
+}} // Tizen::Telephony
diff --git a/src/FTel_CallInfoImpl.h b/src/FTel_CallInfoImpl.h
new file mode 100644 (file)
index 0000000..b47d4c8
--- /dev/null
@@ -0,0 +1,152 @@
+//
+// Open Service Platform
+// Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Apache License, Version 2.0 (the License);
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// 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.
+//
+/**
+ * @file    FTel_CallInfoImpl.h
+ * @brief   This is the header file for the %_CallInfoImpl class.
+ *
+ * This header file contains the declarations of the %_CallInfoImpl class.
+ */
+#ifndef _FTEL_INTERNAL_CALL_INFO_IMPL_H_
+#define _FTEL_INTERNAL_CALL_INFO_IMPL_H_
+
+
+#include <FBaseObject.h>
+#include <FBaseString.h>
+#include <FTelTypes.h>
+
+
+namespace Tizen { namespace Telephony
+{
+class CallInfo;
+
+/**
+ * @class _CallInfoImpl
+ * @brief This class provides methods to obtain detailed information about a call.
+ * @since 2.1
+ *
+ * The %_CallInfoImpl class provides methods to obtain detailed call information, such as the call type and number.
+ */
+class _CallInfoImpl
+       : public Tizen::Base::Object
+{
+public:
+       /**
+     * This is the default constructor for this class.
+     *
+     *  @since 2.1
+     */
+       _CallInfoImpl(void);
+
+       /**
+     * This is the copy constructor for the %_CallInfoImpl class.
+     *
+     * @since 2.1
+     *
+     * @param[in] rhs The call information
+     */
+       _CallInfoImpl(const _CallInfoImpl& rhs);
+
+       /**
+     * Initializes this instance of %_CallInfoImpl with the specified call type and the phone number.
+     *
+     * @param[in] type   The call type
+     * @param[in] number The phone number @n
+     */
+       _CallInfoImpl(CallType type, const Tizen::Base::String& number);
+
+       /**
+     * This is the destructor for this class.
+     *
+     * @since 2.1
+     */
+       virtual ~_CallInfoImpl(void);
+
+       /**
+     * @see CallInfo::GetCallType()
+     */
+       CallType GetCallType(void) const;
+
+       /**
+     * @see CallInfo::GetNumber()
+     */
+       Tizen::Base::String GetNumber(void) const;
+
+       /**
+     * Sets the call type.
+     *
+     * @param[in]   callType
+     */
+       void SetCallType(CallType callType);
+
+       /**
+     * Sets the phone number.
+     *
+     * @param[in]   number
+     */
+       void SetNumber(const Tizen::Base::String& number);
+
+       /**
+     * Checks whether the the specified instance of %_CallInfoImpl equals the current instance.
+     *
+     * @return   @c true if the specified instance equals the current instance, @n
+     *           else @c false
+     * @param[in]   obj An instance of %_CallInfoImpl
+     * @remarks  The method returns @c false if the specified object is not %_CallInfoImpl.
+     */
+       virtual bool Equals(const Tizen::Base::Object& obj) const;
+
+       /**
+     * Gets the hash value of the current instance.
+     *
+     * @return   The hash value of the current instance
+     */
+       virtual int GetHashCode(void) const;
+
+       /**
+     * Gets the Impl instance.
+     *
+     * @since 2.1
+     * @return  The pointer to _CallInfoImpl
+     * @param[in]   callInfo   An instance of CallInfo
+     */
+       static _CallInfoImpl* GetInstance(CallInfo& callInfo);
+
+       /**
+     * Gets the Impl instance.static int OnCallStatusChanged(const TelTapiEvent_t* pTapiEvent, void* pUserData);
+     *
+     *
+     * @since 2.1
+     * @return  The pointer to _CallInfoImpl
+     * @param[in]   callInfo   An instance of CallInfo
+     */
+       static const _CallInfoImpl* GetInstance(const CallInfo& callInfo);
+
+       /**
+     * This is the assignment operator.
+     *
+     * @param[in] rhs An instance of %_CallInfoImpl
+     */
+       _CallInfoImpl& operator =(const _CallInfoImpl& rhs);
+
+private:
+       CallType __callType;
+       Tizen::Base::String __number;
+
+}; // _CallInfoImpl
+
+}} // Tizen::Telephony
+#endif // _FTEL_INTERNAL_CALL_INFO_IMPL_H_
diff --git a/src/FTel_CallManagerEvent.cpp b/src/FTel_CallManagerEvent.cpp
new file mode 100644 (file)
index 0000000..c061531
--- /dev/null
@@ -0,0 +1,66 @@
+//
+// Open Service Platform
+// Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Apache License, Version 2.0 (the License);
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// 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.
+//
+
+/**
+ * @file    FTel_CallManagerEvent.cpp
+ * @brief   This is the implementation file for the _CallManagerEvent Class.
+ *
+ * This header file contains implementation of the _CallManagerEvent Class.
+ */
+
+#include <FBaseRtIEventListener.h>
+#include <FBaseSysLog.h>
+#include <FTelITelephonyCallEventListener.h>
+#include "FTel_CallManagerEvent.h"
+#include "FTel_CallManagerEventArg.h"
+
+
+namespace Tizen { namespace Telephony
+{
+
+////////////////////////////////////////////////////////////////////////////
+_CallManagerEvent::_CallManagerEvent(void)
+{
+}
+
+_CallManagerEvent::~_CallManagerEvent(void)
+{
+}
+
+result
+_CallManagerEvent::Construct(void)
+{
+    return _Event::Initialize();
+}
+
+////////////////////////////////////////////////////////////////////////////////
+/// Operation : Protected
+
+void
+_CallManagerEvent::FireImpl(Tizen::Base::Runtime::IEventListener& listener, const Tizen::Base::Runtime::IEventArg& arg)
+{
+    const _CallManagerEventArg* pArg = dynamic_cast<const _CallManagerEventArg*>(&arg);
+    SysTryReturnVoidResult(NID_TEL, pArg != null, E_INVALID_ARG, "[%s] Invalid argument used. The arg is null pointer.", GetErrorMessage(E_INVALID_ARG));
+
+    ITelephonyCallEventListener* pListener = dynamic_cast<ITelephonyCallEventListener*>(&listener);
+    SysTryReturnVoidResult(NID_TEL, pListener != null, E_INVALID_ARG,
+            "[%s] Invalied argument used. The result of dynamic_cast operation is null for telephony network event listener", GetErrorMessage(E_INVALID_ARG));
+
+    pListener->OnTelephonyCallStatusChangedN(pArg->GetCallStatus(), pArg->GetCallInfoN());
+}
+
+} } // Tizen::Telephony
diff --git a/src/FTel_CallManagerEvent.h b/src/FTel_CallManagerEvent.h
new file mode 100644 (file)
index 0000000..fde42d9
--- /dev/null
@@ -0,0 +1,92 @@
+//
+// Open Service Platform
+// Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Apache License, Version 2.0 (the License);
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// 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.
+//
+
+/**
+ * @file    FTel_CallManagerEvent.h
+ * @brief   This is the header file for the _WifiDirectDeviceEvent class.
+ *
+ * This header file contains declarations of the _WifiDirectDeviceEvent class.
+ */
+
+#ifndef _FTEL_INTERNAL_CALL_MANAGER_EVENT_H_
+#define _FTEL_INTERNAL_CALL_MANAGER_EVENT_H_
+
+// Includes
+#include <FBaseResult.h>
+#include <FBaseRt_Event.h>
+
+namespace Tizen { namespace Base { namespace Runtime
+{
+class IEventListener;
+class IEventArg;
+}}}
+
+namespace Tizen { namespace Telephony
+{
+
+/**
+ * @class   _CallManagerEvent
+ * @brief   This class handles CallManager events.
+ *
+ * When a CallManagerEvent event occurs, the _CallManagerEvent object finds a ITelephonyCallEventListener object
+ * which is registered for the Device object and calls an appropriate method of the listener.
+ */
+
+class _CallManagerEvent
+    : public Tizen::Base::Runtime::_Event
+{
+// Lifecycle
+public:
+    /**
+     * This is the default constructor for this class.
+     */
+    _CallManagerEvent();
+
+    /**
+     * This is the class destructor.
+     */
+    virtual ~_CallManagerEvent(void);
+
+
+    /**
+     * Initializes a new instance of the class
+     *
+     */
+    result Construct(void);
+
+// Operation
+protected:
+    /**
+     * Checks the arg and finds out the type of event. After that this method calls appropriate pListener's method.
+     *
+     * @return      A result code.
+     * @param[in]   listener               It is a event listener related to this WifiDirectDevice event.
+     * @param[in]   arg                     It is an argument-like instance of WifiDirectDevice event retransmitted to the listener's method as an argument.
+     * @exception   E_SUCCESS               The method is successful.
+     * @exception   E_INVALID_ARG           The argument passed to a method contains an invalid value.@n
+     */
+    void FireImpl(Tizen::Base::Runtime::IEventListener& listener, const Tizen::Base::Runtime::IEventArg& arg);
+
+
+private:
+    _CallManagerEvent(const _CallManagerEvent& rhs);
+    _CallManagerEvent& operator =(const _CallManagerEvent& rhs);
+
+}; // _CallManagerEvent
+
+}} // Tizen::Telephony
+#endif // _FTEL_INTERNAL_CALL_MANAGER_EVENT_H_
diff --git a/src/FTel_CallManagerEventArg.cpp b/src/FTel_CallManagerEventArg.cpp
new file mode 100644 (file)
index 0000000..1d78f02
--- /dev/null
@@ -0,0 +1,67 @@
+//
+// Open Service Platform
+// Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Apache License, Version 2.0 (the License);
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// 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.
+//
+/**
+ * @file        FTel_CallManagerEventArg.cpp
+ * @brief       This is the implementation file for the %_EmailEventArg class.
+ *
+ * This file contains the implementation of the %_EmailEventArg class.
+ */
+
+#include <FBaseErrorDefine.h>
+#include <FBaseSysLog.h>
+#include <FTelTypes.h>
+#include <FTelCallInfo.h>
+#include "FTel_CallManagerEventArg.h"
+
+namespace Tizen { namespace Telephony
+{
+
+_CallManagerEventArg::_CallManagerEventArg(void)
+    : __callStatus(CALL_STATUS_UNDEFINED)
+    , __pCallInfo(null)
+{
+}
+
+_CallManagerEventArg::_CallManagerEventArg(CallStatus callStatus, CallInfo* pCallInfo)
+    : __callStatus(callStatus)
+    , __pCallInfo(pCallInfo)
+{
+
+}
+
+
+CallStatus
+_CallManagerEventArg::GetCallStatus(void) const
+{
+    return __callStatus;
+}
+
+CallInfo*
+_CallManagerEventArg::GetCallInfoN(void) const
+{
+    CallInfo* pCallInfo = null;
+
+    if (__pCallInfo != null)
+    {
+        pCallInfo = new (std::nothrow) CallInfo(*(__pCallInfo.get()));
+        SysTryReturn(NID_TEL, pCallInfo != null, pCallInfo, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
+    }
+
+    return pCallInfo;
+}
+
+} } // Tizen::Telephony
diff --git a/src/FTel_CallManagerEventArg.h b/src/FTel_CallManagerEventArg.h
new file mode 100644 (file)
index 0000000..a6ebf38
--- /dev/null
@@ -0,0 +1,96 @@
+//
+// Open Service Platform
+// Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Apache License, Version 2.0 (the License);
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// 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.
+//
+/**
+ * @file        FTel_CallManagerEventArg.h
+ * @brief       This is the header file for _CallManagerEventArg class.
+ *
+ * This header file contains the declarations of _CallManagerEventArg class.
+ */
+
+
+#ifndef _FTEL_INTERNAL_CALL_MANAGER_EVENT_ARG_H_
+#define _FTEL_INTERNAL_CALL_MANAGER_EVENT_ARG_H_
+
+// Includes
+#include <unique_ptr.h>
+#include <FBaseObject.h>
+#include <FBaseDataType.h>
+#include <FBaseRtIEventArg.h>
+#include <FTelNetworkStatus.h>
+
+namespace Tizen { namespace Telephony
+{
+
+
+/**
+ * @class   _CallManagerEventArg
+ * @brief   This class is used as an argument of methods of the ITelephonyCallEventListener class.
+ *
+ * This class is used as an argument of ITelephonyCallEventListener methods.
+ * When a CallManager event occurs, the _CallManagerEvent object finds a ITelephonyCallEventListener object
+ * which is registered for the CallManager object and calls an appropriate method of the listener.
+ */
+
+class _CallManagerEventArg
+    : public Tizen::Base::Object
+    , public Tizen::Base::Runtime::IEventArg
+{
+public:
+    /**
+    * This is the constructor.
+    *
+    */
+    _CallManagerEventArg(void);
+
+    /**
+    * This constructor initializes the instance of this class with the specified values.
+    *
+    * @param[in]    callStatus An instance of %CallStatus
+    * @param[in]    pCallInfo  A pointer to a CallInfo instance
+    */
+    _CallManagerEventArg(CallStatus callStatus, CallInfo* pCallInfo);
+
+    /**
+    * This is class destructor.
+    */
+    virtual ~_CallManagerEventArg(void){}
+
+    /**
+     * Gets the call status
+     * @return  The instance of CallStatus
+     */
+    CallStatus GetCallStatus(void) const;
+
+    /**
+     * Gets the call information
+     * @return  A pointer to a CallInfo instance
+     */
+    CallInfo* GetCallInfoN(void) const;
+
+
+private:
+    _CallManagerEventArg(const _CallManagerEventArg& rhs);
+    _CallManagerEventArg& operator =(const _CallManagerEventArg& rhs);
+
+private:
+    CallStatus __callStatus;
+    std::unique_ptr<CallInfo> __pCallInfo;
+
+}; // _CallManagerEventArg
+} }
+
+#endif // _FTEL_INTERNAL_CALL_MANAGER_EVENT_ARG_H_
diff --git a/src/FTel_CallManagerImpl.cpp b/src/FTel_CallManagerImpl.cpp
new file mode 100644 (file)
index 0000000..2ddd45c
--- /dev/null
@@ -0,0 +1,645 @@
+//
+// Open Service Platform
+// Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Apache License, Version 2.0 (the License);
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// 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.
+//
+/**
+ * @file    FTel_CallManagerImpl.cpp
+ * @brief   This is the implementation file for _CallManagerImpl class.
+ */
+
+#include <string.h>
+#include <glib.h>
+#include <tapi_common.h>
+#include <tapi_event.h>
+#include <TapiUtility.h>
+#include <ITapiCall.h>
+#include <FBaseString.h>
+#include <FBaseUtilStringUtil.h>
+#include <FTelITelephonyCallEventListener.h>
+#include <FTelITelephonyCallForwardListener.h>
+#include <FTelCallManager.h>
+#include <FBaseSysLog.h>
+#include "FTel_CallInfoImpl.h"
+#include "FTel_CallManagerImpl.h"
+#include "FTel_CallManagerEvent.h"
+#include "FTel_CallManagerEventArg.h"
+#include "FTel_CallForwardEvent.h"
+#include "FTel_CallForwardEventArg.h"
+#include "FTel_TelephonyIpcProxy.h"
+#include "FTel_NetworkManagerImpl.h"
+
+using namespace std;
+using namespace Tizen::App;
+using namespace Tizen::Base;
+using namespace Tizen::Base::Utility;
+
+
+namespace Tizen { namespace Telephony
+{
+
+_CallManagerImpl::_CallManagerImpl(void)
+       : __pCallEventListener(null)
+       , __pCallForwardListener(null)
+       , __pHandle(null)
+       , __callFwdSubscriptionId(0)
+       , __callFwdStatusSubscriptionId(0)
+       , __callFwdReqId(INVALID_REQUEST_ID)
+       , __callFwdReqNumId(INVALID_REQUEST_ID)
+       , __isReqCallFwdNumInProgress(false)
+       , __curCallState(CALL_STATUS_IDLE)
+       , __curCallFwdState(_CALL_FORWARD_IDLE)
+    , __pCallManagerEvent(null)
+    , __pCallForwardEvent(null)
+
+{
+       __pCallEventType[_CALL_NOTI_VOICE_CALL_IDLE] = TAPI_NOTI_VOICE_CALL_STATUS_IDLE;
+       __pCallEventType[_CALL_NOTI_VOICE_CALL_COMMUNICATING] = TAPI_NOTI_VOICE_CALL_STATUS_ACTIVE;
+       __pCallEventType[_CALL_NOTI_VOICE_CALL_RINGING] = TAPI_NOTI_VOICE_CALL_STATUS_INCOMING;
+       __pCallEventType[_CALL_NOTI_VOICE_CALL_DIALING] = TAPI_NOTI_VOICE_CALL_STATUS_DIALING;
+       __pCallEventType[_CALL_NOTI_VOICE_CALL_HOLDING] = TAPI_NOTI_VOICE_CALL_STATUS_HELD;
+       __pCallEventType[_CALL_NOTI_VIDEO_CALL_IDLE] = TAPI_NOTI_VIDEO_CALL_STATUS_IDLE;
+       __pCallEventType[_CALL_NOTI_VIDEO_CALL_COMMUNICATING] = TAPI_NOTI_VIDEO_CALL_STATUS_ACTIVE;
+       __pCallEventType[_CALL_NOTI_VIDEO_CALL_RINGING] = TAPI_NOTI_VIDEO_CALL_STATUS_INCOMING;
+       __pCallEventType[_CALL_NOTI_VIDEO_CALL_DIALING] = TAPI_NOTI_VIDEO_CALL_STATUS_DIALING;
+       __pCallEventType[_CALL_NOTI_PEER_CALL_HELD] = TAPI_NOTI_CALL_INFO_HELD;
+       __pCallEventType[_CALL_NOTI_PEER_CALL_RETRIEVED] = TAPI_NOTI_CALL_INFO_ACTIVE;
+
+}
+
+_CallManagerImpl::~_CallManagerImpl(void)
+{
+       if (__pHandle != null)
+       {
+               for (int i = 0; i < _CALL_NOTI_MAX; i++)
+               {
+                       tel_deregister_noti_event(__pHandle, __pCallEventType[i]);
+        }
+
+               tel_deinit(__pHandle);
+       }
+}
+
+result
+_CallManagerImpl::Construct(ITelephonyCallEventListener* pListener)
+{
+       SysLog(NID_TEL, "The current call state is %s", GetStringOfCallState());
+
+       result r = E_SUCCESS;
+       int err = TAPI_API_SUCCESS;
+
+       __pHandle = tel_init(null);
+       SysTryCatch(NID_TEL, __pHandle != null, r = E_SYSTEM, E_SYSTEM, "[%s] A system error has occurred. Failed to initialize TApi library.", GetErrorMessage(E_SYSTEM));
+
+       if (pListener != null)
+       {
+               for (int i = 0; i < _CALL_NOTI_MAX; i++)
+               {
+                       err = tel_register_noti_event(__pHandle, __pCallEventType[i], OnCallStatusChangedCallback, this);
+                       SysLog(NID_TEL, "The registered call type is %s", GetStringOfCallEventType(_CALL_NOTI_VOICE_CALL_IDLE + i));
+
+                       SysTryCatch(NID_TEL, err == TAPI_API_SUCCESS, r = E_SYSTEM, E_SYSTEM,
+                               "[%s] A system error has occurred. Failed to register the callback function.", GetErrorMessage(E_SYSTEM));
+               }
+
+               unique_ptr<_CallManagerEvent> pCallManagerEvent(new (std::nothrow) _CallManagerEvent);
+        SysTryReturnResult(NID_TEL, pCallManagerEvent != null, E_OUT_OF_MEMORY, "Memory allocation failed.");
+
+        r = pCallManagerEvent->Construct();
+        SysTryReturnResult(NID_TEL, r != E_OUT_OF_MEMORY, r, "Propagating.");
+        SysTryReturnResult(NID_TEL, r == E_SUCCESS, E_SYSTEM, "A system error has occurred. Failed to construct CallManagerEvent.");
+
+        pCallManagerEvent->AddListener(*pListener, true);
+
+        __pCallManagerEvent = move(pCallManagerEvent);
+
+       }
+
+       r = InitializeInternalCallStatus();
+       SysTryCatch(NID_TEL, r == E_SUCCESS, , E_SYSTEM, "[%s] A system error has occurred. Failed to initialize internal call state.", GetErrorMessage(E_SYSTEM));
+
+       __pTelephonyServiceProxy = _TelephonyIpcProxy::GetInstance();
+
+       if (__pTelephonyServiceProxy == null)
+    {
+        SysLog(NID_TEL, "Creating an IPC instance to connect with the Connectivity service daemon has failed.");
+    }
+    else
+    {
+        __pTelephonyServiceProxy->SetCallManagerImpl(*this);
+    }
+
+       return r;
+
+CATCH:
+       for (int i = 0; i < _CALL_NOTI_MAX; i++)
+       {
+                   tel_deregister_noti_event(__pHandle, __pCallEventType[i]);
+       }
+
+       if (__pHandle != null)
+       {
+               tel_deinit(__pHandle);
+           __pHandle = null;
+       }
+
+       return r;
+}
+
+result
+_CallManagerImpl::SetCallForwardListener(ITelephonyCallForwardListener* pListener)
+{
+       SysTryReturnResult(NID_TEL, __pTelephonyServiceProxy != null, E_SYSTEM, "A system error has occurred. IPC instance has not been constructed yet.");
+
+       result r = __pTelephonyServiceProxy->HasCallForwardPrivilege();
+       SysTryReturnResult(NID_TEL, r == E_SUCCESS, r, "Propagating.");
+
+       if (__pCallForwardListener != null)
+    {
+           __pCallForwardEvent->RemoveListener(*__pCallForwardListener);
+           __pCallForwardListener = null;
+    }
+
+
+       // Creates event object
+    if (__pCallForwardEvent == null && pListener != null)
+    {
+        std::unique_ptr<_CallForwardEvent> pCallForwardEvent(new (std::nothrow) _CallForwardEvent());
+
+         SysTryReturnResult(NID_TEL, pCallForwardEvent != null, E_OUT_OF_MEMORY, "Memory allocation failed.");
+
+         r = pCallForwardEvent->Construct();
+         SysTryReturnResult(NID_TEL, r == E_SUCCESS, r, "Propagating.");
+
+         __pCallForwardEvent = move(pCallForwardEvent);
+    }
+
+    // Adds listener
+    if (pListener != null)
+    {
+        __pCallForwardListener = pListener;
+        r = __pCallForwardEvent->AddListener(*__pCallForwardListener, true);
+    }
+
+    if (r != E_SUCCESS)
+    {
+        __pCallForwardEvent.reset(null);
+               SysLogException(NID_TEL, r, "[%s] Propagating.", GetErrorMessage(r));
+    }
+
+    return r;
+}
+
+result
+_CallManagerImpl::RequestCallForward(const String& phoneNumber)
+{
+       result r = E_SUCCESS;
+
+       switch (__curCallFwdState)
+       {
+       case _CALL_FORWARD_REQUESTING:
+       {
+               SysLogException(NID_TEL, E_IN_PROGRESS, "[%s] The previous request is in progress.", GetErrorMessage(E_IN_PROGRESS));
+               return E_IN_PROGRESS;
+       }
+
+       case  _CALL_FORWARD_ON_SERVICE:
+       case  _CALL_FORWARD_STOPPING:
+       {
+           SysLogException(NID_TEL, E_INVALID_STATE, "[%s] The current state of the instance prohibits the execution of this operation.", GetErrorMessage(E_IN_PROGRESS));
+               return E_INVALID_STATE;
+       }
+
+       default:
+               break;
+       }
+
+       SysLog(NID_TEL, "The phonenumber is %ls", phoneNumber.GetPointer());
+
+       SysTryReturnResult(NID_TEL, _NetworkManagerImpl::IsNetworkAvailable(), E_NETWORK_UNAVAILABLE,
+                                         "The operation failed because the device is in the offline mode.");
+       SysTryReturnResult(NID_TEL,  _NetworkManagerImpl::IsServiceAvailable(), E_SERVICE_UNAVAILABLE,
+                                         "The operation failed because the device is out of the coverage area or in the emergency mode.");
+       SysTryReturnResult(NID_TEL, !phoneNumber.IsEmpty(), E_INVALID_FORMAT, "The phone number is empty string.");
+       SysTryReturnResult(NID_TEL, IsPhoneNumberValid(phoneNumber), E_INVALID_FORMAT, "The phone number is invalid format");
+
+       r = __pTelephonyServiceProxy->RequestCallForward(phoneNumber);
+       SysTryReturnResult(NID_TEL, r == E_SUCCESS, r, "Propagating.");
+
+       __curCallFwdState = _CALL_FORWARD_REQUESTING;
+
+       return r;
+}
+
+result
+_CallManagerImpl::StopCallForward(void)
+{
+       switch (__curCallFwdState)
+       {
+       case _CALL_FORWARD_STOPPING:
+       {
+               SysLogException(NID_TEL, E_IN_PROGRESS, "[%s] The previous request is in progress.", GetErrorMessage(E_IN_PROGRESS));
+               return E_IN_PROGRESS;
+       }
+       case _CALL_FORWARD_IDLE:
+       case _CALL_FORWARD_REQUESTING:
+       {
+               SysLogException(NID_TEL, E_INVALID_STATE, "[%s] The current state of the instance prohibits the execution of this operation.", GetErrorMessage(E_INVALID_STATE));
+               return E_INVALID_STATE;
+       }
+       default:
+               break;
+       }
+       SysTryReturnResult(NID_TEL, _NetworkManagerImpl::IsNetworkAvailable(), E_NETWORK_UNAVAILABLE,
+                                         "The operation has failed because the device is in the offline mode.");
+       SysTryReturnResult(NID_TEL, _NetworkManagerImpl::IsServiceAvailable(), E_SERVICE_UNAVAILABLE,
+                         "The operation failed because the device is out of the coverage area or in the emergency mode.");
+
+       result r = __pTelephonyServiceProxy->StopCallForward();
+       SysTryReturnResult(NID_TEL, r == E_SUCCESS, r, "Propagating.");
+
+       __curCallFwdState = _CALL_FORWARD_STOPPING;
+
+       return r;
+}
+
+result
+_CallManagerImpl::GetCallForwardNumber(void)
+{
+       SysTryReturnResult(NID_TEL, __pCallForwardListener != null, E_INVALID_OPERATION,
+                                         "The ITelephonyCallForwardListener has not been registered yet.");
+       SysTryReturnResult(NID_TEL, !__isReqCallFwdNumInProgress, E_IN_PROGRESS, "The previous request is in progress.");
+       SysTryReturnResult(NID_TEL,  _NetworkManagerImpl::IsNetworkAvailable(), E_NETWORK_UNAVAILABLE,
+                                         "The operation has failed because the device is in the offline mode.");
+       SysTryReturnResult(NID_TEL, _NetworkManagerImpl::IsServiceAvailable(), E_SERVICE_UNAVAILABLE,
+                                         "The operation failed because the device is out of the coverage area or in the emergency mode.");
+
+       result r = __pTelephonyServiceProxy->GetCallForwardNumber();
+       SysTryReturnResult(NID_TEL, r == E_SUCCESS, r, "Propagating.");
+
+       __isReqCallFwdNumInProgress = true;
+
+       return r;
+}
+
+CallType
+_CallManagerImpl::GetCurrentCallType(void) const
+{
+       CallType type = TYPE_UNDEFINED_CALL;
+       int err = TAPI_API_SUCCESS;
+
+       err = tel_get_call_status_all(__pHandle, OnCallTypeCallback, &type);
+
+       return type;
+}
+
+CallStatus
+_CallManagerImpl::GetCurrentCallStatus(void) const
+{
+       return __curCallState;
+}
+
+void
+_CallManagerImpl::OnCallStatusChangedCallback(TapiHandle* pHandle, const char* pNotiId, void* pData, void* pUserData)
+{
+       SysLog(NID_TEL, "The pNotiId value is %s", pNotiId);
+
+       CallType callType = TYPE_UNDEFINED_CALL;
+       String phoneNumber;
+       int callId = 0;
+       _CallManagerImpl* pCallManagerImpl = static_cast <_CallManagerImpl*>(pUserData);
+
+       if (strcmp(pNotiId, TAPI_NOTI_VOICE_CALL_STATUS_IDLE) == 0
+            || strcmp(pNotiId,TAPI_NOTI_VIDEO_CALL_STATUS_IDLE) == 0)
+       {
+           TelCallStatusIdleNoti_t* pNotiData = (TelCallStatusIdleNoti_t*)pData;
+           callId = pNotiData->id;
+           pCallManagerImpl->__curCallState = CALL_STATUS_IDLE;
+       }
+       else
+       {
+           if (strcmp(pNotiId, TAPI_NOTI_VOICE_CALL_STATUS_ACTIVE) == 0
+                       || strcmp(pNotiId,TAPI_NOTI_VIDEO_CALL_STATUS_ACTIVE) == 0)
+           {
+               TelCallStatusActiveNoti_t* pNotiData = (TelCallStatusActiveNoti_t*)pData;
+               callId = pNotiData->id;
+           }
+           else if (strcmp(pNotiId,TAPI_NOTI_VOICE_CALL_STATUS_INCOMING) == 0
+                   || strcmp(pNotiId,TAPI_NOTI_VIDEO_CALL_STATUS_INCOMING) == 0)
+           {
+               TelCallStatusIncomingNoti_t* pNotiData = (TelCallStatusIncomingNoti_t*)pData;
+               callId = pNotiData->id;
+           }
+           else if (strcmp(pNotiId,TAPI_NOTI_VOICE_CALL_STATUS_DIALING) == 0
+                   || strcmp(pNotiId, TAPI_NOTI_VIDEO_CALL_STATUS_DIALING) == 0)
+           {
+               TelCallStatusDialingNoti_t* pNotiData = (TelCallStatusDialingNoti_t*)pData;
+               callId = pNotiData->id;
+           }
+           else if (strcmp(pNotiId,TAPI_NOTI_VOICE_CALL_STATUS_HELD) == 0)
+           {
+               TelCallStatusHeldNoti_t* pNotiData = (TelCallStatusHeldNoti_t*)pData;
+               callId = pNotiData->id;
+           }
+           else if (strcmp(pNotiId,TAPI_NOTI_CALL_INFO_HELD) == 0)
+           {
+               TelCallInfoHeldNoti_t* pNotiData = (TelCallInfoHeldNoti_t*)pData;
+               callId = pNotiData->id;
+           }
+           else if (strcmp(pNotiId,TAPI_NOTI_CALL_INFO_ACTIVE) == 0)
+           {
+               TelCallInfoActiveNoti_t* pNotiData = (TelCallInfoActiveNoti_t*)pData;
+               callId = pNotiData->id;
+           }
+
+           int err = tel_get_call_status_all(pHandle, OnCallStatusCallback, pCallManagerImpl);
+           SysLog(NID_TEL, "The tel_get_call_status_all() returned %d value", err);
+
+           phoneNumber = pCallManagerImpl->GetPhoneNumber(pHandle, callId);
+               SysLog(NID_TEL, "The phonenumber is %ls", phoneNumber.GetPointer());
+       }
+
+
+       callType = pCallManagerImpl->GetCurrentCallType();
+
+       if (pCallManagerImpl->__curCallState != CALL_STATUS_UNDEFINED)
+       {
+               unique_ptr<CallInfo> pCallInfo(null);
+           _CallInfoImpl* pCallInfoImpl = null;
+
+           pCallInfo.reset(new (std::nothrow) CallInfo());
+           SysTryReturnVoidResult(NID_TEL, pCallInfo != null, E_OUT_OF_MEMORY,
+                       "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
+
+           pCallInfoImpl = _CallInfoImpl::GetInstance(*pCallInfo);
+           pCallInfoImpl->SetCallType(callType);
+           pCallInfoImpl->SetNumber(phoneNumber);
+
+           _CallManagerEventArg* pEventArg = new (std::nothrow)_CallManagerEventArg(pCallManagerImpl->__curCallState, pCallInfo.get());
+           SysTryReturnVoidResult(NID_TEL,pEventArg != null, E_OUT_OF_MEMORY,
+                       "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
+
+               pCallInfo.release();
+
+               SysLog(NID_TEL, "The current call type is %d, and the phonenumber is %ls", callType, phoneNumber.GetPointer());
+           (void)pCallManagerImpl->__pCallManagerEvent->Fire(*pEventArg);
+       }
+}
+
+void
+_CallManagerImpl::OnTelephonyCallForwardNumberReceived(Tizen::Base::String phoneNumber, result r)
+{
+       SysLog(NID_TEL, "The listener has called with result %s and phonenumber is %ls", GetErrorMessage(r), phoneNumber.GetPointer());
+
+    _CallForwardEventArg* pEventArg = new (std::nothrow)_CallForwardEventArg(_CALL_FORWARD_EVENT_NUMBER_RECEIVED, phoneNumber, r);
+
+    SysTryReturnVoidResult(NID_TEL,pEventArg != null, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
+
+    (void)__pCallForwardEvent->Fire(*pEventArg);
+
+    __isReqCallFwdNumInProgress = false;
+}
+
+void
+_CallManagerImpl::OnTelephonyCallForwardResponseReceived(Tizen::Base::String phoneNumber, result r)
+{      
+       SysLog(NID_TEL, "The listener has called with result %s and phonenumber is %ls", GetErrorMessage(r), phoneNumber.GetPointer());
+
+    _CallForwardEventArg* pEventArg = new (std::nothrow)_CallForwardEventArg(_CALL_FORWARD_EVENT_RESPONSE_RECEIVED, phoneNumber, r);
+
+    SysTryReturnVoidResult(NID_TEL, pEventArg != null, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
+
+    (void)__pCallForwardEvent->Fire(*pEventArg);
+
+    if (r != E_SUCCESS)
+    {
+        __curCallFwdState = _CALL_FORWARD_IDLE;
+    }
+    else
+    {
+        __curCallFwdState = _CALL_FORWARD_ON_SERVICE;
+    }
+}
+
+void
+_CallManagerImpl::OnTelephonyCallForwardStopped(Tizen::Base::String phoneNumber, result r)
+{
+    SysLog(NID_TEL, "The listener has called with result %s and phonenumber is %ls", GetErrorMessage(r), phoneNumber.GetPointer());
+
+    _CallForwardEventArg* pEventArg = new (std::nothrow)_CallForwardEventArg(_CALL_FORWARD_EVENT_STOPPED, phoneNumber, r);
+
+    SysTryReturnVoidResult(NID_TEL, pEventArg != null, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
+
+    (void)__pCallForwardEvent->Fire(*pEventArg);
+
+    if (r != E_SUCCESS)
+    {
+       __curCallFwdState = _CALL_FORWARD_ON_SERVICE;
+    }
+    else
+    {
+       __curCallFwdState = _CALL_FORWARD_IDLE;
+    }
+}
+
+void
+_CallManagerImpl::OnCallStatusCallback(TelCallStatus_t* status, void* pUserData)
+{
+       _CallManagerImpl* pImpl = static_cast<_CallManagerImpl*>(pUserData);
+
+    // Priority : Ringing/Dialing > Communicating > Hold
+       // ToDO : multi party call scenario 
+
+       switch (status->CallState)
+       {
+       case TAPI_CALL_STATE_IDLE:
+           pImpl->__curCallState = CALL_STATUS_IDLE;
+           break;
+       case TAPI_CALL_STATE_ACTIVE:
+               pImpl->__curCallState = CALL_STATUS_COMMUNICATING;
+               break;
+       case TAPI_CALL_STATE_HELD:
+           pImpl->__curCallState = CALL_STATUS_HOLDING;
+           break;
+       case TAPI_CALL_STATE_INCOMING:
+           pImpl->__curCallState = CALL_STATUS_RINGING;
+           break;
+       case TAPI_CALL_STATE_DIALING:
+       case TAPI_CALL_STATE_ALERT:
+           pImpl->__curCallState = CALL_STATUS_DIALING;
+           break;
+       default:
+           break;
+       }
+
+       return;
+}
+
+void
+_CallManagerImpl::OnCallTypeCallback(TelCallStatus_t* status, void* pUserData)
+{
+       CallType* pCallType = static_cast<CallType*>(pUserData);
+
+       switch (status->CallType)
+       {
+       case TAPI_CALL_TYPE_VOICE:
+           *pCallType = TYPE_VOICE_CALL;
+           break;
+       case TAPI_CALL_TYPE_DATA:
+           *pCallType = TYPE_VIDEO_CALL;
+           break;
+       default:
+           break;
+       }
+
+       return;
+}
+
+bool
+_CallManagerImpl::IsPhoneNumberValid(const String& phoneNumber) const
+{
+       bool isValid = true;
+       int startIndex = 0;
+       wchar_t chr = 0;
+
+       if (phoneNumber.StartsWith("+", 0))
+       {
+               startIndex = 1;
+       }
+
+       for (int i = startIndex; i < phoneNumber.GetLength(); i++)
+       {
+               phoneNumber.GetCharAt(i, chr);
+
+               if (!Character::IsDigit(chr))
+               {
+                       isValid = false;
+                       break;
+               }
+       }
+       return isValid;
+}
+
+result
+_CallManagerImpl::InitializeInternalCallStatus(void)
+{
+       int err = TAPI_API_SUCCESS;
+       result r = E_SUCCESS;
+
+       err = tel_get_call_status_all(__pHandle, OnCallStatusCallback, this);
+       SysLog(NID_TEL, "The tel_get_call_status_all() returned %d value", err);
+
+       if (err != TAPI_API_SUCCESS)
+       {
+           if (err == TAPI_API_OPERATION_FAILED)
+           {
+               __curCallState = CALL_STATUS_IDLE;
+           }
+           else
+           {
+               r = E_SYSTEM;
+           }
+       }
+
+       return r;
+}
+
+String
+_CallManagerImpl::GetPhoneNumber(TapiHandle* pCallHandle, int callId) const
+{
+       int err = TAPI_API_SUCCESS;
+       String phoneNumber;
+
+       TelCallStatus_t callStatus = {};
+       err = tel_get_call_status(pCallHandle, callId, &callStatus);
+       if (err == TAPI_API_SUCCESS)
+       {
+           (void)(StringUtil::Utf8ToString(callStatus.pNumber, phoneNumber));
+           SysLog(NID_TEL, "The phone number is %ls", phoneNumber.GetPointer());
+       }
+       else
+       {
+           SysLog(NID_TEL, "The tel_get_call_status_all() returned %d value", err);
+       }
+
+       return phoneNumber;
+}
+
+const char*
+_CallManagerImpl::GetStringOfCallState(void) const
+{
+       static const char* pStateStr[] =
+       {
+               "CALL_STATUS_UNDEFINED",
+               "CALL_STATUS_IDLE",
+               "CALL_STATUS_ACTIVE",
+               "CALL_STATUS_COMMUNICATING",
+               "CALL_STATUS_RINGING",
+               "CALL_STATUS_DIALING",
+               "CALL_STATUS_HOLDING"
+       };
+
+       return pStateStr[__curCallState + 1];
+}
+
+const char*
+_CallManagerImpl::GetStringOfCallFwdState(void) const
+{
+       static const char* pFwdStateStr[] =
+       {
+               "CALL_FORWARD_IDLE",
+               "CALL_FORWARD_REQUESTING",
+               "CALL_FORWARD_ON_SERVICE",
+               "CALL_FORWARD_STOPPING"
+       };
+
+       return pFwdStateStr[__curCallFwdState];
+}
+
+const char*
+_CallManagerImpl::GetStringOfCallEventType(int type) const
+{
+       static const char* pEventType[] =
+       {
+               "Voice Call End",
+               "Voice Communicating",
+               "Voice Ringing",
+               "Voice Dialing",
+               "Voice Holding",
+               "Video Call End",
+               "Video Communicating",
+               "Video Ringing",
+               "Video Dialing",
+               "Peer Held",
+               "Peer Retrieved"
+       };
+
+       return pEventType[type];
+}
+
+_CallManagerImpl*
+_CallManagerImpl::GetInstance(CallManager& callManager)
+{
+       return callManager.__pCallManagerImpl;
+}
+
+const _CallManagerImpl*
+_CallManagerImpl::GetInstance(const CallManager& callManager)
+{
+       return callManager.__pCallManagerImpl;
+}
+
+}} // Tizen::Telephony
+
+
diff --git a/src/FTel_CallManagerImpl.h b/src/FTel_CallManagerImpl.h
new file mode 100644 (file)
index 0000000..f860e57
--- /dev/null
@@ -0,0 +1,266 @@
+//
+// Open Service Platform
+// Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Apache License, Version 2.0 (the License);
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// 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.
+//
+/**
+ * @file  FTel_CallManagerImpl.h
+ * @brief This is the header file for the _CallManagerImpl class.
+ *
+ * This header file contains the declarations of the _CallManagerImpl Class.
+ */
+#ifndef _FTEL_INTERNAL_CALL_MANAGER_IMPL_H_
+#define _FTEL_INTERNAL_CALL_MANAGER_IMPL_H_
+
+
+#include <unique_ptr.h>
+#include <tapi_type.h>
+#include <TelCall.h>
+#include <FBaseObject.h>
+#include <FTelCallInfo.h>
+#include <FTelTypes.h>
+
+
+namespace Tizen { namespace Base
+{
+class String;
+}} // Tizen::Base
+
+namespace Tizen { namespace Telephony
+{
+class ITelephonyCallForwardListener;
+class ITelephonyCallEventListener;
+class CallManager;
+class _CallManagerEvent;
+class _CallForwardEvent;
+class _TelephonyIpcProxy;
+
+
+/**
+ * @class   _CallManagerImpl
+ * @brief   This class provides methods to obtain information about the current call.
+ * @since 2.1
+ *
+ * This class provides methods to obtain information about the current call type and its status.
+ *
+ * The following code snippet illustrates how to obtain information about a call.
+ */
+class _CallManagerImpl
+       : public Tizen::Base::Object
+{
+       /**
+     *  @enum _CallForwardingState
+     *  Defines the state of the call forwarding.
+     */
+       enum _CallForwardingState
+       {
+           _CALL_FORWARD_IDLE,
+           _CALL_FORWARD_REQUESTING,
+           _CALL_FORWARD_ON_SERVICE,
+           _CALL_FORWARD_STOPPING
+       };
+
+       /**
+     *  @enum _CallNotificationId
+     *  Defines the call notification id
+     */
+       enum _CallNotificationId
+       {
+           _CALL_NOTI_VOICE_CALL_IDLE,
+           _CALL_NOTI_VOICE_CALL_COMMUNICATING,
+           _CALL_NOTI_VOICE_CALL_RINGING,
+           _CALL_NOTI_VOICE_CALL_DIALING,
+           _CALL_NOTI_VOICE_CALL_HOLDING,
+           _CALL_NOTI_VIDEO_CALL_IDLE,
+           _CALL_NOTI_VIDEO_CALL_COMMUNICATING,
+           _CALL_NOTI_VIDEO_CALL_RINGING,
+           _CALL_NOTI_VIDEO_CALL_DIALING,
+           _CALL_NOTI_PEER_CALL_HELD,
+           _CALL_NOTI_PEER_CALL_RETRIEVED,
+           _CALL_NOTI_MAX
+
+       };
+
+public:
+       /**
+     * This is the default constructor for this class.
+     *
+     * @since 2.1
+     */
+       _CallManagerImpl(void);
+       /**
+     * This is the destructor for this class.
+     *
+     * @since 2.1
+     */
+       virtual ~_CallManagerImpl(void);
+
+       /**
+     * @see CallManager::Construct()
+     */
+       result Construct(ITelephonyCallEventListener* pListener = null);
+
+       /**
+     * @see CallManager::SetCallForwardListener()
+     */
+       result SetCallForwardListener(ITelephonyCallForwardListener* pListener);
+
+       /**
+     * @see CallManager::RequestCallForward(), OnCallForwardNumberReceivedCallback()
+     *
+     */
+       result RequestCallForward(const Tizen::Base::String& phoneNumber);
+
+       /**
+     * @see CallManager::StopCallForward(), OnCallForwardStoppedCallback()
+     */
+       result StopCallForward(void);
+
+       /**
+     * @see CallManager::GetCallForwardNumber(), OnCallForwardNumberReceivedCallback()
+     */
+       result GetCallForwardNumber(void);
+
+       /**
+     * @see CallManager::GetCurrentCallType()
+     */
+       CallType GetCurrentCallType(void) const;
+
+       /**
+     * @see CallManager::GetCurrentCallStatus()
+     */
+       CallStatus GetCurrentCallStatus(void) const;
+
+       void OnTelephonyCallForwardNumberReceived(Tizen::Base::String phoneNumber, result r);
+       void OnTelephonyCallForwardResponseReceived(Tizen::Base::String phoneNumber, result r);
+       void OnTelephonyCallForwardStopped(Tizen::Base::String phoneNumber, result r);
+
+       /**
+     * Called when the status of a call is changed.
+     *
+     * @param[in] pHandle   The call handle.
+     * @param[in] pNotiId   The notification id.
+     * @param[in] pData     The data of call status
+     * @param[in] pUserData The user data passed from the callback registration function
+     */
+       static void OnCallStatusChangedCallback(TapiHandle *pHandle, const char* pNotiId, void* pData, void* pUserData);
+
+       /**
+     * Called when you get the information of call status
+     *
+     * @param[in] status    The call status
+     * @param[in] pUserData The user data passed from the callback registration function
+     */
+       static void OnCallStatusCallback(TelCallStatus_t* pStatus, void* pUserData);
+
+       /**
+     * Called when you get the information of call type
+     *
+     * @param[in] status    The call status
+     * @param[in] pUserData The user data passed from the callback registration function
+     */
+       static void OnCallTypeCallback(TelCallStatus_t* pStatus, void* pUserData);
+
+       /**
+     * Gets the Impl instance.
+     *
+     * @since 2.1
+     * @return The pointer to _CallManagerImpl
+     * @param[in] callManager   An instance of CallManager
+     */
+       static _CallManagerImpl* GetInstance(CallManager& callManager);
+
+       /**
+     * Gets the Impl instance.
+     *
+     * @since 2.1
+     * @return The pointer to _CallManagerImpl
+     * @param[in] callManager   An instance of CallManager
+     */
+       static const _CallManagerImpl* GetInstance(const CallManager& callManager);
+
+private:
+       /**
+     * Initialize the call status.
+     */
+       result InitializeInternalCallStatus(void);
+
+       /**
+     * Checks the valid state of phone number.
+     */
+       bool IsPhoneNumberValid(const Tizen::Base::String& phoneNumber) const;
+
+       /**
+     * Gets the phone number.
+     */
+       Tizen::Base::String GetPhoneNumber(TapiHandle* pCallHandle, int callId) const;
+
+       /**
+     * Gets the string of call state.
+     */
+       const char* GetStringOfCallState(void) const;
+
+       /**
+     * Gets the string of call forwarding state.
+     */
+       const char* GetStringOfCallFwdState(void) const;
+
+       /**
+     * Gets the string of call event type.
+     */
+       const char* GetStringOfCallEventType(int type) const;
+
+       /**
+     * This is the copy constructor for the %_CallManagerImpl class.
+     *
+     * @param[in] value An instance of %_CallManagerImpl
+     */
+       _CallManagerImpl(const _CallManagerImpl& value);
+
+       /**
+     * This is the assignment operator.
+     * Do @b not use directly.
+     *
+     * @param[in] rhs An instance of %_CallManagerImpl
+     */
+       _CallManagerImpl& operator =(const _CallManagerImpl& rhs);
+
+private:
+       ITelephonyCallEventListener* __pCallEventListener;
+       ITelephonyCallForwardListener* __pCallForwardListener;
+
+       TapiHandle* __pHandle;
+
+       int __callFwdSubscriptionId;
+       int __callFwdStatusSubscriptionId;
+
+       int __callFwdReqId;
+       int __callFwdReqNumId;
+
+       bool __isReqCallFwdNumInProgress;
+
+       CallStatus __curCallState;
+       _CallForwardingState __curCallFwdState;
+
+    _TelephonyIpcProxy* __pTelephonyServiceProxy;
+
+    std::unique_ptr<_CallManagerEvent> __pCallManagerEvent;
+    std::unique_ptr<_CallForwardEvent> __pCallForwardEvent;
+
+    const char* __pCallEventType[_CALL_NOTI_MAX];
+
+}; // _CallManagerImpl
+
+}} // Tizen::Telephony
+#endif // _FTEL_INTERNAL_CALL_MANAGER_IMPL_H_
diff --git a/src/FTel_NetworkInfoImpl.cpp b/src/FTel_NetworkInfoImpl.cpp
new file mode 100644 (file)
index 0000000..da750ae
--- /dev/null
@@ -0,0 +1,222 @@
+//
+// Open Service Platform
+// Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Apache License, Version 2.0 (the License);
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// 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.
+//
+/**
+ * @file        FTel_NetworkInfoImpl.cpp
+ * @brief       This is the implementation file for _NetworkInfoImpl class.
+ */
+
+#include <telephony_network.h>
+#include <FTelNetworkInfo.h>
+#include <FBaseErrors.h>
+#include <FBaseSysLog.h>
+#include "FTel_NetworkInfoImpl.h"
+
+using namespace Tizen::Base;
+
+namespace Tizen { namespace Telephony
+{
+
+
+_NetworkInfoImpl::_NetworkInfoImpl(void)
+       : __cellId(-1)
+       , __lac(-1)
+    , __mcc(-1)
+    , __mnc(-1)
+    , __networkType(_NETWORK_TYPE_UNDEFINED)
+{
+}
+
+_NetworkInfoImpl::_NetworkInfoImpl(const _NetworkInfoImpl& value)
+    : __cellId(value.__cellId)
+    , __lac(value.__lac)
+    , __mcc(value.__mcc)
+    , __mnc(value.__mnc)
+    , __plmn(value.__plmn)
+    , __operatorName(value.__operatorName)
+    , __networkType(value.__networkType)
+{
+}
+
+_NetworkInfoImpl::~_NetworkInfoImpl(void)
+{
+}
+
+int
+_NetworkInfoImpl::GetCellId(void) const
+{
+    return __cellId;
+}
+
+int
+_NetworkInfoImpl::GetLac(void) const
+{
+    return __lac;
+}
+
+int
+_NetworkInfoImpl::GetMcc(void) const
+{
+    return __mcc;
+}
+
+int
+_NetworkInfoImpl::GetMnc(void) const
+{
+    return __mnc;
+}
+String
+_NetworkInfoImpl::GetPlmn(void) const
+{
+       return __plmn;
+}
+
+String
+_NetworkInfoImpl::GetOperatorName(void) const
+{
+    return __operatorName;
+}
+
+_NetworkType
+_NetworkInfoImpl::GetNetworkType(void) const
+{
+    return __networkType;
+}
+
+bool
+_NetworkInfoImpl::Equals(const Object& obj) const
+{
+       const _NetworkInfoImpl* pOther = static_cast<const _NetworkInfoImpl*>(&obj);
+
+    if (pOther == null
+        || __cellId != pOther->__cellId
+        || __lac != pOther->__lac
+        || __mcc != pOther->__mcc
+        || __mnc != pOther->__mnc
+        || __plmn != pOther->__plmn
+        || __operatorName != pOther->__operatorName
+        || __networkType != pOther->__networkType)
+    {
+        return false;
+    }
+
+       return true;
+}
+
+int
+_NetworkInfoImpl::GetHashCode(void) const
+{
+       static const int _PRIME_NUMBER = 31;
+       int hashCode = 0;
+
+    hashCode = _PRIME_NUMBER * __mcc;
+    hashCode = (_PRIME_NUMBER * hashCode) ^ __mnc;
+    hashCode = (_PRIME_NUMBER * hashCode) ^ __cellId;
+    hashCode = (_PRIME_NUMBER * hashCode) ^ __lac;
+    hashCode = (_PRIME_NUMBER * hashCode) ^ __plmn.GetHashCode();
+    hashCode = (_PRIME_NUMBER * hashCode) ^ __operatorName.GetHashCode();
+    hashCode = (_PRIME_NUMBER * hashCode) ^ __networkType;
+
+       return hashCode;
+}
+int
+_NetworkInfoImpl::GetRssi(void)
+{
+       static const int rssiArray[] = {10, 25, 45, 60, 75, 75, 90};
+       network_info_rssi_e rssi;
+       int err = NETWORK_INFO_ERROR_NONE;
+
+       err = network_info_get_rssi(&rssi);
+       SysLog(NID_TEL, "network_info_get_rssi() returned %d value and the rssi value is %d", err, rssi);
+       SysTryReturn(NID_TEL, err == NETWORK_INFO_ERROR_NONE, 0, E_SYSTEM,
+               "[%s] A system error has occurred. Failed to get the received signal strength indication.", GetErrorMessage(E_SYSTEM));
+
+       return rssiArray[rssi];
+}
+
+void
+_NetworkInfoImpl::SetCellId(int cellId)
+{
+       __cellId = cellId;
+}
+
+void
+_NetworkInfoImpl::SetLac(int lac)
+{
+       __lac = lac;
+}
+
+void
+_NetworkInfoImpl::SetMcc(int mcc)
+{
+    __mcc = mcc;
+}
+
+void
+_NetworkInfoImpl::SetMnc(int mnc)
+{
+    __mnc = mnc;
+}
+
+void
+_NetworkInfoImpl::SetPlmn(const String& plmn)
+{
+    __plmn = plmn;
+}
+
+void
+_NetworkInfoImpl::SetOperatorName(const String& operatorName)
+{
+    __operatorName = operatorName;
+}
+
+void
+_NetworkInfoImpl::SetNetworkType(_NetworkType networkType)
+{
+    __networkType = networkType;
+}
+
+
+_NetworkInfoImpl&
+_NetworkInfoImpl::operator=(const _NetworkInfoImpl& rhs)
+{
+    if (this != &rhs)
+    {
+        __cellId = rhs.__cellId;
+        __lac = rhs.__lac;
+        __mcc = rhs.__mcc;
+        __mnc = rhs.__mnc;
+        __plmn = rhs.__plmn;
+        __operatorName = rhs.__operatorName;
+        __networkType = rhs.__networkType;
+
+    }
+    return *this;
+}
+
+_NetworkInfoImpl*
+_NetworkInfoImpl::GetInstance(NetworkInfo& networkInfo)
+{
+       return networkInfo.__pNetworkInfoImpl;
+}
+
+const _NetworkInfoImpl*
+_NetworkInfoImpl::GetInstance(const NetworkInfo& networkInfo)
+{
+       return networkInfo.__pNetworkInfoImpl;
+}
+
+}} // Tizen::Telephony
diff --git a/src/FTel_NetworkInfoImpl.h b/src/FTel_NetworkInfoImpl.h
new file mode 100644 (file)
index 0000000..cab34a6
--- /dev/null
@@ -0,0 +1,242 @@
+//
+// Open Service Platform
+// Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Apache License, Version 2.0 (the License);
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// 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.
+//
+/**
+ * @file  FTel_NetworkInfoImpl.h
+ * @brief This is the header file for the _NetworkInfoImpl class.
+ *
+ * This header file contains the declarations of the _NetworkInfoImpl Class.
+ */
+#ifndef _FTEL_INTERNAL_NETWORK_INFO_IMPL_H_
+#define _FTEL_INTERNAL_NETWORK_INFO_IMPL_H_
+
+
+#include <FBaseObject.h>
+#include <FBaseString.h>
+
+
+namespace Tizen { namespace Telephony
+{
+
+class NetworkInfo;
+
+    /**
+     * @enum    NetworkType
+     *
+     * Defines the network type.
+     *
+     */
+    enum _NetworkType
+    {
+        _NETWORK_TYPE_UNDEFINED = -1,        /**< No define type */
+        _NETWORK_TYPE_GSM,                   /**< Available service is GSM  */
+        _NETWORK_TYPE_GPRS,                  /**< Available service is GPRS */
+        _NETWORK_TYPE_EGPRS,                 /**< Available service is EGPRS  */
+        _NETWORK_TYPE_PCS1900,               /**< Available service is PCS1900 */
+        _NETWORK_TYPE_UMTS,                  /**< Available service is UMTS  */
+        _NETWORK_TYPE_GSM_AND_UMTS,          /**< Available service is GSM and UMTS */
+        _NETWORK_TYPE_HSDPA,                 /**< Available service is HSDPA */
+        _NETWORK_TYPE_IS95A,                 /**< Available service is IS95A */
+        _NETWORK_TYPE_IS95B,                 /**< Available service is IS95B */
+        _NETWORK_TYPE_CDMA_1X,               /**< Available service is CDMA 1X(IS-2000) */
+        _NETWORK_TYPE_EVDO_REV_0,            /**< Available service is CDMA EV-DO rev0 */
+        _NETWORK_TYPE_CDMA_1X_AND_EVDO_REV_0,/**< Available service is CDMA 1X(IS-2000) and EV-DO rev0 */
+        _NETWORK_TYPE_EVDO_REV_A,            /**< Available service is EV-DO revA */
+        _NETWORK_TYPE_CDMA_1X_AND_EVDO_REV_A,/**< Available service is CDMA 1X(IS-2000) and EV-DO revA */
+        _NETWORK_TYPE_EVDV,                  /**< Available service is EV-DV */
+    };
+
+class _NetworkInfoImpl
+       : public Tizen::Base::Object
+{
+
+public:
+       /**
+     * This is the default constructor for this class.
+     *
+     * @since 2.1
+     */
+       _NetworkInfoImpl(void);
+
+       /**
+     * This is the copy constructor for the _NetworkInfoImpl class.
+     *
+     * @since 2.1
+     *
+     * @param[in]   rhs   An instance of %_NetworkInfoImpl
+     */
+       _NetworkInfoImpl(const _NetworkInfoImpl& rhs);
+
+       /**
+     * This is the destructor for this class.
+     *
+     * @since 2.1
+     */
+       virtual ~_NetworkInfoImpl(void);
+
+    /**
+     * @see NetWorkInfo::GetCellId()
+     */
+    int GetCellId(void) const;
+
+    /**
+     * @see NetWorkInfo::GetLac()
+     */
+    int GetLac(void) const;
+
+    /**
+     * @see NetWorkInfo::GetMnc()
+     */
+       int GetMnc(void) const;
+
+       /**
+     * @see NetWorkInfo::GetMcc()
+     */
+       int GetMcc(void) const;
+
+       /**
+     * @see NetWorkInfo::GetPlmn()
+     */
+       Tizen::Base::String GetPlmn(void) const;
+
+    /**
+     * @see NetWorkInfo::GetOperatorName()
+     */
+    Tizen::Base::String GetOperatorName(void) const;
+
+    /**
+     * Gets the network type.
+     *
+     * @return  The network
+     */
+    _NetworkType GetNetworkType(void) const;
+
+       /**
+     * Checks whether the the specified instance of %_NetworkInfoImpl equals the current instance.
+     *
+     * @return   @c true if the specified instance equals the current instance, @n
+     *           else @c false
+     * @param[in]    rhs An instance of %_NetworkInfoImpl
+     * @remarks  The method returns @c false if the specified object is not %_NetworkInfoImpl.
+     */
+       virtual bool Equals(const Tizen::Base::Object& rhs) const;
+
+       /**
+     * Gets the hash value of the current instance.
+     *
+     * @return   The hash value of the current instance
+     */
+       virtual int GetHashCode(void) const;
+
+       /**
+     * @see NetWorkInfo::GetRssi()
+     */
+       static int GetRssi(void);
+
+
+    /**
+     * Sets the current cell ID.
+     *
+     * @param[in]   cellId   The current cell ID
+     */
+    void SetCellId(int cellId);
+
+    /**
+     * Sets the current Location Area Code (LAC).
+     *
+     * @param[in]   lac   The current Location Area Code (LAC)
+     */
+    void SetLac(int lac);
+
+    /**
+     * Sets the Mobile Network Code (MNC) of the network.
+     *
+     * @param[in]   mnc   The Mobile Network Code (MNC) of the network
+     */
+       void SetMnc(int mnc);
+
+       /**
+     * Sets the Mobile Country Code (MCC) of the network.
+     *
+     * @param[in]   mcc   Mobile Country Code (MCC) of the network
+     */
+       void SetMcc(int mcc);
+
+       /**
+     * Sets the Public Land Mobile Network (PLMN) string.
+     *
+     * @param[in]   plmn   The Public Land Mobile Network (PLMN) string
+     */
+       void SetPlmn(const Tizen::Base::String& plmn);
+
+    /**
+     * Sets the operator name.
+     *
+     * @param[in]   operatorName The operator name
+     */
+    void SetOperatorName(const Tizen::Base::String& operatorName);
+
+    /**
+     * Sets the network type.
+     *
+     * @param[in]   networkType   The network type
+     */
+    void SetNetworkType(_NetworkType networkType);
+
+       /**
+     * Gets the Impl instance.
+     *
+     * @since 2.1
+     * @return The pointer to _NetworkInfoImpl
+     * @param[in] networkInfo   An instance of NetworkInfo
+     */
+       static _NetworkInfoImpl* GetInstance(NetworkInfo& networkInfo);
+
+       /**
+     * Gets the Impl instance.
+     *
+     * @since 2.1
+     * @return The pointer to _NetworkInfoImpl
+     * @param[in] networkInfo   An instance of NetworkInfo
+     */
+       static const _NetworkInfoImpl* GetInstance(const NetworkInfo& networkInfo);
+
+       /**
+     * This assignment operator copies the values from the specified instance of %_NetworkInfoImpl to the calling
+     * instance of %_NetworkInfoImpl.
+     *
+     * @since 2.1
+     *
+     * @return      The reference of this instance
+     * @param[in]   rhs   A reference to the %_NetworkInfoImpl instance to be copied
+     */
+       _NetworkInfoImpl& operator=(const _NetworkInfoImpl& rhs);
+
+
+private:
+    int __cellId;
+    int __lac;
+    int __mcc;
+    int __mnc;
+    Tizen::Base::String __plmn;
+    Tizen::Base::String __operatorName;
+
+    _NetworkType __networkType;
+
+}; // _NetworkInfoImpl
+
+}} // Tizen::Telephony
+#endif // _FTEL_INTERNAL_NETWORK_INFO_IMPL_H_
diff --git a/src/FTel_NetworkManagerEvent.cpp b/src/FTel_NetworkManagerEvent.cpp
new file mode 100644 (file)
index 0000000..3916937
--- /dev/null
@@ -0,0 +1,66 @@
+//
+// Open Service Platform
+// Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Apache License, Version 2.0 (the License);
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// 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.
+//
+
+/**
+ * @file    FTel_NetworkManagerEvent.cpp
+ * @brief   This is the implementation file for the _NetworkManagerEvent Class.
+ *
+ * This header file contains implementation of the _NetworkManagerEvent Class.
+ */
+
+#include <FBaseRtIEventListener.h>
+#include <FBaseSysLog.h>
+#include <FTelITelephonyNetworkEventListener.h>
+#include "FTel_NetworkManagerEvent.h"
+#include "FTel_NetworkManagerEventArg.h"
+
+
+namespace Tizen { namespace Telephony
+{
+
+////////////////////////////////////////////////////////////////////////////
+_NetworkManagerEvent::_NetworkManagerEvent(void)
+{
+}
+
+_NetworkManagerEvent::~_NetworkManagerEvent(void)
+{
+}
+
+result
+_NetworkManagerEvent::Construct(void)
+{
+    return _Event::Initialize();
+}
+
+////////////////////////////////////////////////////////////////////////////////
+/// Operation : Protected
+
+void
+_NetworkManagerEvent::FireImpl(Tizen::Base::Runtime::IEventListener& listener, const Tizen::Base::Runtime::IEventArg& arg)
+{
+    const _NetworkManagerEventArg* pArg = dynamic_cast<const _NetworkManagerEventArg*>(&arg);
+    SysTryReturnVoidResult(NID_TEL, pArg != null, E_INVALID_ARG, "[%s] Invalid argument used. The arg is a null pointer.", GetErrorMessage(E_INVALID_ARG));
+
+    ITelephonyNetworkEventListener* pListener = dynamic_cast<ITelephonyNetworkEventListener*>(&listener);
+    SysTryReturnVoidResult(NID_TEL, pListener != null, E_INVALID_ARG,
+            "[%s] Invalid argument used. The result of a dynamic_cast operation is null for telephony network event listener", GetErrorMessage(E_INVALID_ARG));
+
+    pListener->OnTelephonyNetworkStatusChanged(pArg->GetNetworkStatus());
+}
+
+} } // Tizen::Telephony
diff --git a/src/FTel_NetworkManagerEvent.h b/src/FTel_NetworkManagerEvent.h
new file mode 100644 (file)
index 0000000..7d421ec
--- /dev/null
@@ -0,0 +1,92 @@
+//
+// Open Service Platform
+// Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Apache License, Version 2.0 (the License);
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// 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.
+//
+
+/**
+ * @file    FTel_NetworkManagerEvent.h
+ * @brief   This is the header file for the _WifiDirectDeviceEvent class.
+ *
+ * This header file contains declarations of the _WifiDirectDeviceEvent class.
+ */
+
+#ifndef _FTEL_INTERNAL_NETWORK_MANAGER_EVENT_H_
+#define _FTEL_INTERNAL_NETWORK_MANAGER_EVENT_H_
+
+// Includes
+#include <FBaseResult.h>
+#include <FBaseRt_Event.h>
+
+namespace Tizen { namespace Base { namespace Runtime
+{
+class IEventListener;
+class IEventArg;
+}}}
+
+namespace Tizen { namespace Telephony
+{
+
+/**
+ * @class   _NetworkManagerEvent
+ * @brief   This class handles NetworkManager events.
+ *
+ * When a NetworkManagerEvent event occurs, the _NetworkManagerEvent object finds a ITelephonyNetworkEventListener object
+ * which is registered for the Device object and calls an appropriate method of the listener.
+ */
+
+class _NetworkManagerEvent
+    : public Tizen::Base::Runtime::_Event
+{
+// Lifecycle
+public:
+    /**
+     * This is the default constructor for this class.
+     */
+    _NetworkManagerEvent();
+
+    /**
+     * This is the class destructor.
+     */
+    virtual ~_NetworkManagerEvent(void);
+
+
+    /**
+     * Initializes a new instance of the  class
+     *
+     */
+    result Construct(void);
+
+// Operation
+protected:
+    /**
+     * Checks the arg and finds out the type of event. After that this method calls appropriate pListener's method.
+     *
+     * @return      A result code.
+     * @param[in]   listener               It is a event listener related to this WifiDirectDevice event.
+     * @param[in]   arg                     It is an argument-like instance of WifiDirectDevice event retransmitted to the listener's method as an argument.
+     * @exception   E_SUCCESS               The method is successful.
+     * @exception   E_INVALID_ARG           The argument passed to a method contains an invalid value.@n
+     */
+    void FireImpl(Tizen::Base::Runtime::IEventListener& listener, const Tizen::Base::Runtime::IEventArg& arg);
+
+
+private:
+    _NetworkManagerEvent(const _NetworkManagerEvent& rhs);
+    _NetworkManagerEvent& operator =(const _NetworkManagerEvent& rhs);
+
+}; // _NetworkManagerEvent
+
+}} // Tizen::Telephony
+#endif // _FTEL_INTERNAL_NETWORK_MANAGER_EVENT_H_
diff --git a/src/FTel_NetworkManagerEventArg.cpp b/src/FTel_NetworkManagerEventArg.cpp
new file mode 100644 (file)
index 0000000..13cd0b2
--- /dev/null
@@ -0,0 +1,49 @@
+//
+// Open Service Platform
+// Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Apache License, Version 2.0 (the License);
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// 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.
+//
+/**
+ * @file        FTel_NetworkManagerEventArg.cpp
+ * @brief       This is the implementation file for the %_EmailEventArg class.
+ *
+ * This file contains the implementation of the %_EmailEventArg class.
+ */
+
+#include <FBaseErrorDefine.h>
+#include "FTel_NetworkStatusImpl.h"
+#include "FTel_NetworkManagerEventArg.h"
+
+namespace Tizen { namespace Telephony
+{
+
+_NetworkManagerEventArg::_NetworkManagerEventArg(void)
+{
+}
+
+_NetworkManagerEventArg::_NetworkManagerEventArg(const NetworkStatus& networkstatus)
+{
+    _NetworkStatusImpl::GetInstance(__networkStatus)->SetIsCallServiceAvailable(networkstatus.IsCallServiceAvailable());
+    _NetworkStatusImpl::GetInstance(__networkStatus)->SetIsDataServiceAvailable(networkstatus.IsDataServiceAvailable());
+    _NetworkStatusImpl::GetInstance(__networkStatus)->SetIsRoaming(networkstatus.IsRoaming());
+}
+
+const NetworkStatus&
+_NetworkManagerEventArg::GetNetworkStatus(void) const
+{
+    return __networkStatus;
+}
+
+
+} } // Tizen::Telephony
diff --git a/src/FTel_NetworkManagerEventArg.h b/src/FTel_NetworkManagerEventArg.h
new file mode 100644 (file)
index 0000000..ffdf8bc
--- /dev/null
@@ -0,0 +1,93 @@
+//
+// Open Service Platform
+// Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Apache License, Version 2.0 (the License);
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// 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.
+//
+/**
+ * @file        FTel_NetworkManagerEventArg.h
+ * @brief       This is the header file for _NetworkManagerEventArg class.
+ *
+ * This header file contains the declarations of _NetworkManagerEventArg class.
+ */
+
+
+#ifndef _FTEL_INTERNAL_NETWORK_MANAGER_EVENT_ARG_H_
+#define _FTEL_INTERNAL_NETWORK_MANAGER_EVENT_ARG_H_
+
+// Includes
+#include <FBaseObject.h>
+#include <FBaseDataType.h>
+#include <FBaseRtIEventArg.h>
+#include <FTelNetworkStatus.h>
+
+namespace Tizen { namespace Telephony
+{
+
+
+/**
+ * @class   _NetworkManagerEventArg
+ * @brief   This class is used as an argument of methods of the ITelephonyNetworkEventListener class.
+ *
+ * This class is used as an argument of ITelephonyNetworkEventListener methods.
+ * When a NetworkManager event occurs, the _NetworkManagerEvent object finds a ITelephonyNetworkEventListener object
+ * which is registered for the NetworkManager object and calls an appropriate method of the listener.
+ */
+
+class _NetworkManagerEventArg
+    : public Tizen::Base::Object
+    , public Tizen::Base::Runtime::IEventArg
+{
+public:
+    /**
+    * This is the constructor.
+    *
+    */
+    _NetworkManagerEventArg(void);
+
+    /**
+    * This constructor initializes the instance of this class with the specified values.
+    *
+    * @param[in]    networkstatus An instance of %NetworkStatus
+    */
+    _NetworkManagerEventArg(const NetworkStatus& networkstatus);
+
+    /**
+    * This is class destructor.
+    */
+    virtual ~_NetworkManagerEventArg(void) {};
+
+
+    /**
+     * Gets the network status
+     * @return  The instance of NetworkStatus
+     */
+    const NetworkStatus& GetNetworkStatus(void) const;
+
+    /**
+     * Gets the error code.
+     * @return  Error code of this argument.
+     */
+    result GetError(void) const;
+
+private:
+    _NetworkManagerEventArg(const _NetworkManagerEventArg& rhs);
+    _NetworkManagerEventArg& operator =(const _NetworkManagerEventArg& rhs);
+
+private:
+    NetworkStatus __networkStatus;
+    result __error;
+}; // _NetworkManagerEventArg
+} }
+
+#endif // _FTEL_INTERNAL_NETWORK_MANAGER_EVENT_ARG_H_
diff --git a/src/FTel_NetworkManagerImpl.cpp b/src/FTel_NetworkManagerImpl.cpp
new file mode 100755 (executable)
index 0000000..5d3a534
--- /dev/null
@@ -0,0 +1,707 @@
+//
+// Open Service Platform
+// Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Apache License, Version 2.0 (the License);
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// 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.
+//
+/**
+ * @file        FTel_NetworkManagerImpl.cpp
+ * @brief       This is the implementation file for _NetworkManagerImpl class.
+ */
+
+#include <stdlib.h>
+#include <telephony_network.h>
+#include <FTelITelephonyNetworkEventListener.h>
+#include <FTelITelephonyNetworkSettingListener.h>
+#include <FTelNetworkInfo.h>
+#include <FTelNetworkStatus.h>
+#include <FTelNetworkManager.h>
+#include <FSysSettingInfo.h>
+#include <FBaseUtilStringUtil.h>
+#include <FBaseSysLog.h>
+#include "FApp_AppInfo.h"
+#include "FTel_NetworkManagerImpl.h"
+#include "FTel_NetworkStatusImpl.h"
+#include "FTel_NetworkInfoImpl.h"
+#include "FTel_NetworkManagerEvent.h"
+#include "FTel_NetworkManagerEventArg.h"
+#include "FTel_NetworkSettingEvent.h"
+#include "FTel_NetworkSettingEventArg.h"
+#include "FTel_TelephonyUtility.h"
+#include "FTel_TelephonyIpcProxy.h"
+
+using namespace std;
+using namespace Tizen::System;
+using namespace Tizen::App;
+using namespace Tizen::Base;
+using namespace Tizen::Base::Utility;
+using namespace Tizen::Base::Collection;
+
+
+namespace Tizen { namespace Telephony
+{
+
+_NetworkManagerImpl::_NetworkManagerImpl(void)
+       : __pConnectionHandle(null)
+    , __pNetworkManagerEvent(null)
+    , __pNetworkSettingEvent(null)
+    , __pTelephonyServiceProxy(null)
+    , __pSettingListener(null)
+{
+}
+
+_NetworkManagerImpl::~_NetworkManagerImpl(void)
+{
+    if (__pNetworkManagerEvent != null)
+    {
+        network_info_unset_service_state_changed_cb();
+        network_info_unset_roaming_state_changed_cb();
+        connection_unset_type_changed_cb(__pConnectionHandle.get());
+    }
+}
+
+result
+_NetworkManagerImpl::Construct(ITelephonyNetworkEventListener* pListener)
+{
+    connection_h pConnHandle = null;
+    int err = connection_create(&pConnHandle);
+    SysLog(NID_TEL, "The return value of connection_create() is %d", err);
+    SysTryReturnResult(NID_TEL, err == CONNECTION_ERROR_NONE, E_SYSTEM, "A system error has occurred. Failed to get the connection handle.");
+
+    std::unique_ptr<void, _ConnectionDeleter> pConnectionHandle(pConnHandle);
+
+    if (pListener != null)
+    {
+        // Register data service state changed event
+           err = connection_set_type_changed_cb(pConnectionHandle.get(),(connection_type_changed_cb)_NetworkManagerImpl::OnDataServiceStateChangedCallback, this);
+               SysLog(NID_TEL, "The return value of connection_set_type_changed_cb() is 0x%x", err);
+        SysTryReturnResult(NID_TEL, err == 0, E_SYSTEM, "A system error has occurred. Failed to register the callback function to received the data service state changed event.");
+
+        // Register call service state changed event
+               err = network_info_set_service_state_changed_cb((network_info_service_state_changed_cb) _NetworkManagerImpl::OnCallServiceStateChangedCallback, this);
+               SysLog(NID_TEL, "The return value of network_info_set_service_state_changed_cb() is 0x%x", err);
+        SysTryReturnResult(NID_TEL, err == NETWORK_INFO_ERROR_NONE, E_SYSTEM,
+                        "A system error has occurred. Failed to register the callback function to received the call service state changed event.");
+
+        // Register roaming state changed event
+           err = network_info_set_roaming_state_changed_cb((network_info_roaming_state_changed_cb)_NetworkManagerImpl::OnRoamingStateChangedCallback, this);
+               SysLog(NID_TEL, "The return value of network_info_set_roaming_state_changed_cb() is 0x%x", err);
+        SysTryReturnResult(NID_TEL, err == NETWORK_INFO_ERROR_NONE, E_SYSTEM,
+                       "A system error has occurred. Failed to register the callback function to received the roaming state changed event.");
+
+        unique_ptr<_NetworkManagerEvent> pNetworkManagerEvent(new (std::nothrow) _NetworkManagerEvent);
+        SysTryReturnResult(NID_TEL, pNetworkManagerEvent != null, E_OUT_OF_MEMORY, "Memory allocation failed.");
+
+        result r = pNetworkManagerEvent->Construct();
+        SysTryReturnResult(NID_TEL,  r != E_OUT_OF_MEMORY, r, "Propagating.");
+        SysTryReturnResult(NID_TEL,  r == E_SUCCESS, E_SYSTEM, "A system error has occurred. Failed to construct of the _NetworkManagerEvent.");
+
+        pNetworkManagerEvent->AddListener(*pListener, true);
+
+        __pNetworkManagerEvent = move(pNetworkManagerEvent);
+
+    }
+
+    __pTelephonyServiceProxy = _TelephonyIpcProxy::GetInstance();
+
+    if (__pTelephonyServiceProxy == null)
+    {
+        SysLog(NID_TEL, "Creating an IPC instance to connect with the Connectivity service daemon has failed.");
+    }
+    else
+    {
+        __pTelephonyServiceProxy->SetNetworkManagerImpl(*this);
+    }
+
+    __pConnectionHandle = move(pConnectionHandle);
+
+    return E_SUCCESS;
+}
+
+result
+_NetworkManagerImpl::GetNetworkStatus(NetworkStatus& networkStatus) const
+{
+    int err = NETWORK_INFO_ERROR_NONE;
+    bool isRoaming = false;
+    bool isDataServiceAvailable = false;
+    bool isCallServiceAvailable = false;
+    connection_cellular_state_e dataServiceState = CONNECTION_CELLULAR_STATE_OUT_OF_SERVICE;
+
+    SysTryReturnResult(NID_TEL, IsNetworkAvailable(), E_NETWORK_UNAVAILABLE, "The operation has failed because the device is in the offline mode.");
+
+    // Get the isRoming
+    err = network_info_is_roaming(&isRoaming);
+    SysLog(NID_TEL, "The return value of network_info_is_roaming() is 0x%x and the roming state is %s", err, isRoaming ? "True" : "False");
+
+       SysTryReturnResult(NID_TEL, err != NETWORK_INFO_ERROR_OUT_OF_SERVICE, E_SERVICE_UNAVAILABLE, "The operation failed because the device is out of the coverage area or in the emergency mode.");
+       SysTryReturnResult(NID_TEL, err == NETWORK_INFO_ERROR_NONE, E_SYSTEM, "A system error has occurred. Failed to get the roaming status.")
+   // Get the isCallServiceAvailable
+       SysTryReturnResult(NID_TEL, IsServiceAvailable(), E_SERVICE_UNAVAILABLE, "The operation failed because the device is out of the coverage area or in the emergency mode.")
+       isCallServiceAvailable = true;
+
+       // Get the isDataServiceAvailable
+    err = connection_get_cellular_state(__pConnectionHandle.get(), &dataServiceState);
+       
+    SysLog(NID_TEL, "The return value of connection_get_cellular_state() is 0x%x and the dataServiceState is %d", err, dataServiceState);
+    SysTryReturnResult(NID_TEL, err == CONNECTION_ERROR_NONE, E_SYSTEM, "A system error has occurred. Failed to get the data service status.");
+
+    if (dataServiceState == CONNECTION_CELLULAR_STATE_AVAILABLE || dataServiceState == CONNECTION_CELLULAR_STATE_CONNECTED)
+    {
+        isDataServiceAvailable = true;
+    }
+
+    _NetworkStatusImpl::GetInstance(networkStatus)->SetIsRoaming(isRoaming);
+    _NetworkStatusImpl::GetInstance(networkStatus)->SetIsCallServiceAvailable(isCallServiceAvailable);
+    _NetworkStatusImpl::GetInstance(networkStatus)->SetIsDataServiceAvailable(isDataServiceAvailable);
+
+       return E_SUCCESS;
+
+}
+
+result
+_NetworkManagerImpl::GetNetworkInfo(NetworkInfo& networkInfo) const
+{
+       result r = E_SUCCESS;
+
+    SysTryReturnResult(NID_TEL, IsNetworkAvailable(), E_NETWORK_UNAVAILABLE,
+                                     "The operation has failed because the device is in the offline mode.");
+    SysTryReturnResult(NID_TEL, IsServiceAvailable(), E_SERVICE_UNAVAILABLE,
+                                     "The operation failed because the device is out of the coverage area or in the emergency mode.");
+
+    int err = NETWORK_INFO_ERROR_NONE;
+    _ApiVersion apiVersion = _AppInfo::GetApiVersion();
+
+    // Get the cell ID
+    int cellId = -1;
+    err = network_info_get_cell_id(&cellId);
+       SysLog(NID_TEL, "The return value of network_info_get_cell_id() is %d and the cellId value is %d", err, cellId);
+    SysTryReturnResult(NID_TEL, err == NETWORK_INFO_ERROR_NONE, E_SYSTEM, "A system error has occurred. Failed to get the cell ID.");
+
+    // Get the lac
+    int lac = -1;
+    err = network_info_get_lac(&lac);
+       SysLog(NID_TEL, "The return value of network_info_get_lac() is %d and the lac value is %d", err, lac);
+    SysTryReturnResult(NID_TEL, err == NETWORK_INFO_ERROR_NONE, E_SYSTEM, "A system error has occurred. Failed to get the lac.");
+
+       char* pTemp = null;
+
+    // Get the operator name
+    err = network_info_get_provider_name(&pTemp);
+    SysTryReturnResult(NID_TEL, err == NETWORK_INFO_ERROR_NONE, E_SYSTEM, "A system error has occurred. Failed to get the plmn.");
+    unique_ptr<char[],_CharDeleter> pOperatorName(pTemp);
+    String operatorName;
+    r = (StringUtil::Utf8ToString(pOperatorName.get(), operatorName));
+    SysTryReturnResult(NID_TEL, r != E_OUT_OF_MEMORY, r, "Propagating.");
+       SysLog(NID_TEL, "The operatorname is %ls", operatorName.GetPointer());
+
+    // Get the mcc
+    err = network_info_get_mcc(&pTemp);
+       SysLog(NID_TEL, "The return value of network_info_get_mcc() is %d and the mcc value is %s", err, pTemp);
+    SysTryReturnResult(NID_TEL, err == NETWORK_INFO_ERROR_NONE, E_SYSTEM, "A system error has occurred. Failed to get the mcc.");
+    unique_ptr<char[],_CharDeleter> pMcc(pTemp);
+
+    // Get the mnc
+    err = network_info_get_mnc(&pTemp);
+       SysLog(NID_TEL, "The return value of network_info_get_mnc() is %d and the mnc value is %s", err, pTemp);
+    SysTryReturnResult(NID_TEL, err == NETWORK_INFO_ERROR_NONE, E_SYSTEM, "A system error has occurred. Failed to get the mnc.");
+    unique_ptr<char[],_CharDeleter> pMnc(pTemp);
+
+    String plmn;
+    r = plmn.Append(pMcc.get());
+    SysTryReturnResult(NID_TEL, r == E_SUCCESS, E_SYSTEM, "A system error has occurred. Failed to set plmn.");
+
+    r = plmn.Append(pMnc.get());
+       SysLog(NID_TEL, "The plmn value is %ls", plmn.GetPointer());
+    SysTryReturnResult(NID_TEL, r == E_SUCCESS, E_SYSTEM, "A system error has occurred. Failed to set plmn.");
+
+    _NetworkInfoImpl::GetInstance(networkInfo)->SetCellId(cellId);
+    _NetworkInfoImpl::GetInstance(networkInfo)->SetLac(lac);
+    _NetworkInfoImpl::GetInstance(networkInfo)->SetOperatorName(operatorName);
+    _NetworkInfoImpl::GetInstance(networkInfo)->SetMcc(atoi(pMcc.get()));
+    _NetworkInfoImpl::GetInstance(networkInfo)->SetMnc(atoi(pMnc.get()));
+
+    if (apiVersion == _API_VERSION_2_0 && _AppInfo::IsOspCompat())
+    {
+        _NetworkInfoImpl::GetInstance(networkInfo)->SetPlmn(operatorName);
+    }
+    else
+    {
+        _NetworkInfoImpl::GetInstance(networkInfo)->SetPlmn(plmn);
+    }
+
+    return E_SUCCESS;
+}
+
+result
+_NetworkManagerImpl::SetNetworkSettingListener(ITelephonyNetworkSettingListener* pListener)
+{
+    SysTryReturnResult(NID_TEL, __pTelephonyServiceProxy != null, E_SYSTEM, "A system error has occurred. IPC instance has not been constructed yet.");
+
+    result r = __pTelephonyServiceProxy->HasSystemPrivilege();
+    SysTryReturnResult(NID_TEL, r == E_SUCCESS, r, "Propagating.");
+
+    if (__pSettingListener != null)
+    {
+        __pNetworkSettingEvent->RemoveListener(*__pSettingListener);
+        __pSettingListener = null;
+    }
+
+    // Creates event object
+    if (__pNetworkSettingEvent == null && pListener != null)
+    {
+        std::unique_ptr<_NetworkSettingEvent> pNetworkSettingEvent(new (std::nothrow) _NetworkSettingEvent());
+
+         SysTryReturnResult(NID_TEL, pNetworkSettingEvent != null, E_OUT_OF_MEMORY, "Memory allocation failed.");
+
+         r = pNetworkSettingEvent->Construct();
+         SysTryReturnResult(NID_TEL, r == E_SUCCESS, r, "Propagating.");
+
+         __pNetworkSettingEvent = move(pNetworkSettingEvent);
+    }
+
+    // Adds listener
+    if (pListener != null)
+    {
+        __pSettingListener = pListener;
+        r = __pNetworkSettingEvent->AddListener(*__pSettingListener, true);
+    }
+
+    if (r != E_SUCCESS)
+    {
+        __pNetworkSettingEvent.reset(null);
+               SysLogException(NID_TEL, r, "[%s] Propagating.", GetErrorMessage(r));
+    }
+
+    return r;
+}
+
+result
+_NetworkManagerImpl::GetNetworkSelectionMode(void)
+{
+    SysTryReturnResult(NID_TEL, __pTelephonyServiceProxy != null, E_SYSTEM, "A system error has occurred. IPC instance has not been constructed yet.");
+
+    result r = __pTelephonyServiceProxy->GetNetworkSelectionMode();
+    SysTryReturnResult(NID_TEL, r != E_OUT_OF_MEMORY, r, "Propagating.");
+    SysTryReturnResult(NID_TEL, r != E_PRIVILEGE_DENIED, r, "Propagating.");
+    SysTryReturnResult(NID_TEL, r == E_SUCCESS, E_OPERATION_FAILED, "Failed to get selection mode.");
+
+    return r;
+}
+
+result
+_NetworkManagerImpl::SelectNetwork(const NetworkInfo & networkInfo)
+{
+    SysTryReturnResult(NID_TEL, __pTelephonyServiceProxy != null, E_SYSTEM, "IPC instance has not been constructed yet.");
+
+    const _NetworkInfoImpl* pNetworkInfoImpl = _NetworkInfoImpl::GetInstance(networkInfo);
+    TelNetworkSystemType_t networkSystemType = _TelephonyUtility::ConvertNetworkType(pNetworkInfoImpl->GetNetworkType());
+
+    result r = __pTelephonyServiceProxy->SelectNetwork(pNetworkInfoImpl->GetPlmn(), (int)networkSystemType);
+    SysTryReturnResult(NID_TEL, r != E_OUT_OF_MEMORY, r, "Propagating.");
+    SysTryReturnResult(NID_TEL, r != E_PRIVILEGE_DENIED, r, "Propagating.");
+    SysTryReturnResult(NID_TEL, r == E_SUCCESS, E_OPERATION_FAILED, "Failed to select network manually.");
+
+    return r;
+}
+
+result
+_NetworkManagerImpl::SelectNetwork(void)
+{
+    SysTryReturnResult(NID_TEL, __pTelephonyServiceProxy != null, E_SYSTEM, "A system error has occurred. IPC instance has not been constructed yet.");
+
+    result r = __pTelephonyServiceProxy->SelectNetwork();
+    SysTryReturnResult(NID_TEL, r != E_OUT_OF_MEMORY, r, "Propagating.");
+    SysTryReturnResult(NID_TEL, r != E_PRIVILEGE_DENIED, r, "Propagating.");
+    SysTryReturnResult(NID_TEL, r == E_SUCCESS, E_OPERATION_FAILED, "Failed to select network automatically.");
+
+    return r;
+}
+
+result
+_NetworkManagerImpl::SearchNetwork(void)
+{
+    SysTryReturnResult(NID_TEL, __pTelephonyServiceProxy != null, E_SYSTEM, "A system error has occurred. IPC instance has not been constructed yet.");
+
+    result r = __pTelephonyServiceProxy->SearchNetwork();
+    SysTryReturnResult(NID_TEL, r != E_OUT_OF_MEMORY, r, "Propagating.");
+    SysTryReturnResult(NID_TEL, r != E_PRIVILEGE_DENIED, r, "Propagating.");
+    SysTryReturnResult(NID_TEL, r == E_SUCCESS, E_OPERATION_FAILED, "Failed to search network automatic.");
+
+    return r;
+}
+
+void
+_NetworkManagerImpl::OnRoamingStateChangedCallback(bool isRoaming, void* pUserData)
+{
+       SysLog(NID_TEL, "The callback has called and the roaming state is %s", isRoaming ? "True" : "False");
+    _NetworkManagerImpl* pNetworkManagerImpl = static_cast <_NetworkManagerImpl*>(pUserData);
+
+    pNetworkManagerImpl->OnTelephonyNetworkStatusChanged(_NETWORK_EVENT_ROAMING, isRoaming);
+
+    return;
+}
+
+void
+_NetworkManagerImpl::OnCallServiceStateChangedCallback(network_info_service_state_e serviceState, void* pUserData)
+{
+    SysLog(NID_TEL, "The callback has called and the service state is %d", serviceState);
+
+    _NetworkManagerImpl* pNetworkManagerImpl = static_cast <_NetworkManagerImpl*>(pUserData);
+
+    bool isAvailable = false;
+    if (serviceState == NETWORK_INFO_SERVICE_STATE_IN_SERVICE)
+    {
+        isAvailable = true;
+    }
+
+    pNetworkManagerImpl->OnTelephonyNetworkStatusChanged(_NETWORK_EVENT_CALL, isAvailable);
+
+    return;
+}
+
+void
+_NetworkManagerImpl::OnDataServiceStateChangedCallback(connection_type_e type, void* pUserData)
+{
+    if (type != CONNECTION_TYPE_CELLULAR)
+    {
+        SysLog(NID_TEL, "The connection type %d can be ignored", type);
+        return;
+    }
+
+    _NetworkManagerImpl* pNetworkManagerImpl = static_cast <_NetworkManagerImpl*>(pUserData);
+    bool isAvailable = false;
+
+    // Get the isDataServiceAvailable
+    connection_cellular_state_e dataServiceState = CONNECTION_CELLULAR_STATE_OUT_OF_SERVICE;
+    int err = connection_get_cellular_state(pNetworkManagerImpl->__pConnectionHandle.get(), &dataServiceState);
+    SysLog(NID_TEL, "The return value of connection_get_cellular_state() is 0x%x", err);
+    SysTryReturnVoidResult(NID_TEL, err == CONNECTION_ERROR_NONE, E_SYSTEM, "[%s] A system error has occurred. Failed to get the data service status.", GetErrorMessage(E_SYSTEM));
+
+    if (dataServiceState == CONNECTION_CELLULAR_STATE_AVAILABLE || dataServiceState == CONNECTION_CELLULAR_STATE_CONNECTED)
+    {
+        isAvailable = true;
+    }
+
+    pNetworkManagerImpl->OnTelephonyNetworkStatusChanged(_NETWORK_EVENT_DATA, isAvailable);
+
+    return;
+}
+
+void
+_NetworkManagerImpl::OnTelephonyNetworkStatusChanged(_NetworkEventType type, bool data)
+{
+       SysLog(NID_TEL, "The listener has called with %s state", GetStringOfNetworkEventType(type));
+
+    result r = E_SUCCESS;
+    NetworkStatus networkStatus;
+    r = GetNetworkStatus(networkStatus);
+    SysTryReturnVoidResult(NID_TEL, r == E_SUCCESS, r, "[%s] Failed to get network status", GetErrorMessage(r));
+
+    switch (type)
+    {
+    case _NETWORK_EVENT_CALL:
+        _NetworkStatusImpl::GetInstance(networkStatus)->SetIsCallServiceAvailable(data);
+        break;
+
+    case _NETWORK_EVENT_DATA:
+        _NetworkStatusImpl::GetInstance(networkStatus)->SetIsDataServiceAvailable(data);
+        break;
+
+    case _NETWORK_EVENT_ROAMING:
+        _NetworkStatusImpl::GetInstance(networkStatus)->SetIsRoaming(data);
+        break;
+
+    default:
+        break;
+
+    }
+
+    _NetworkManagerEventArg* pEventArg = new (std::nothrow)_NetworkManagerEventArg(networkStatus);
+    SysTryReturnVoidResult(NID_TEL, pEventArg != null, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
+    (void)__pNetworkManagerEvent->Fire(*pEventArg);
+}
+
+bool
+_NetworkManagerImpl::IsServiceAvailable(bool checkEmergency /* = false */)
+{
+    bool isAvailable = false;
+    int err = NETWORK_INFO_ERROR_NONE;
+    network_info_service_state_e state;
+
+    err = network_info_get_service_state(&state);
+       SysLog(NID_TEL, "The return value of network_info_get_service_state() is 0x%x and the state is %d and checkEmergency is %s",
+               err, state, checkEmergency ? "True" : "False");
+
+    if (!checkEmergency && state == NETWORK_INFO_SERVICE_STATE_IN_SERVICE)
+    {
+        isAvailable = true;
+    }
+    else if (checkEmergency && (state == NETWORK_INFO_SERVICE_STATE_IN_SERVICE ||
+                                                                           state == NETWORK_INFO_SERVICE_STATE_EMERGENCY_ONLY))
+    {
+        isAvailable = true;
+    }
+
+    return isAvailable;
+}
+
+bool
+_NetworkManagerImpl::IsNetworkAvailable(void)
+{
+    bool isFlightModeEnabled = false;
+    result r = SettingInfo::GetValue(L"http://tizen.org/setting/network.flight_mode", isFlightModeEnabled);
+       SysLog(NID_TEL, "isFlightModeEnabled is %s", isFlightModeEnabled ? "True":"False");
+       SysLog(NID_TEL, "The return value of SettingInfo::GetValue() is %s", GetErrorMessage(r));
+
+       if (r != E_SUCCESS)
+       {
+           return false;
+       }
+
+    return !isFlightModeEnabled;
+}
+
+const char*
+_NetworkManagerImpl::GetStringOfNetworkEventType(_NetworkEventType type) const
+{
+    static const char* pStateStr[] =
+    {
+        "CallServiceAvailable",
+        "DataServiceAvailable ",
+        "Roaming"
+    };
+    return pStateStr[type];
+}
+
+_NetworkManagerImpl*
+_NetworkManagerImpl::GetInstance(NetworkManager& networkManager)
+{
+    return networkManager.__pNetworkManagerImpl;
+}
+
+const _NetworkManagerImpl*
+_NetworkManagerImpl::GetInstance(const NetworkManager& networkManager)
+{
+    return networkManager.__pNetworkManagerImpl;
+}
+
+
+void
+_NetworkManagerImpl::OnTelephonyNetworkSelectionModeReceived(bool isManual, result r)
+{
+       SysLog(NID_TEL, "The mode is %s and the result is %s", isManual ? "Manual":"Automatic", GetErrorMessage(r));
+
+    if (__pNetworkSettingEvent != null)
+    {
+        _NetworkSettingEventArg* pEventArg = new (std::nothrow)_NetworkSettingEventArg(_NETWORK_EVENT_GET_SELECTION_MODE, isManual, r);
+        SysTryReturnVoidResult(NID_TEL, pEventArg != null, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
+        (void)__pNetworkSettingEvent->Fire(*pEventArg);
+    }
+}
+
+void
+_NetworkManagerImpl::OnTelephonyNetworkSelectionCompleted(result r)
+{
+       SysLog(NID_TEL, "The listener has called with the result %s", GetErrorMessage(r));
+
+    if (__pNetworkSettingEvent != null)
+    {
+        _NetworkSettingEventArg* pEventArg = new (std::nothrow)_NetworkSettingEventArg(_NETWORK_EVENT_SELECT_NETWORK, r);
+        SysTryReturnVoidResult(NID_TEL, pEventArg != null, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
+        (void)__pNetworkSettingEvent->Fire(*pEventArg);
+    }
+}
+
+void
+_NetworkManagerImpl::OnTelephonyNetworkSearchCompleted(String message, result r)
+{
+       SysLog(NID_TEL, "The listener has called with the result %s", GetErrorMessage(r));
+
+    if (__pNetworkSettingEvent != null)
+    {
+        IList* pNetworkInfoList = null;
+
+        if (r == E_SUCCESS)
+        {
+            pNetworkInfoList = ParsingMessageN(message);
+
+            if (pNetworkInfoList == null)
+            {
+                SysLog(NID_TEL, "ParsingMessageN() has failed ");
+                r = E_SYSTEM;
+            }
+        }
+
+        _NetworkSettingEventArg* pEventArg = new (std::nothrow)_NetworkSettingEventArg(_NETWORK_EVENT_SEARCH_COMPLETED, pNetworkInfoList, r);
+        SysTryReturnVoidResult(NID_TEL, pEventArg != null, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
+
+        (void)__pNetworkSettingEvent->Fire(*pEventArg);
+    }
+}
+
+IList*
+_NetworkManagerImpl::ParsingMessageN(const String& message)
+{
+    result r = E_SUCCESS;
+    int currentIndex = 0;
+    String temp;
+
+    NetworkInfo* pNetworkInfo = null;
+
+    int networkInfoCount = 0;
+
+    r = message.SubString(0, 1, temp);
+       SysTryReturn(NID_TEL, r == E_SUCCESS, null, E_SYSTEM, "[%s] A system error has occurred.", GetErrorMessage(E_SYSTEM));
+
+    temp.Trim();
+
+    r = Integer::Decode(temp, networkInfoCount);
+       SysTryReturn(NID_TEL, r == E_SUCCESS, null, E_SYSTEM, "[%s] A system error has occurred.", GetErrorMessage(E_SYSTEM));
+
+    ArrayList* pNetworkInfoList = null;
+
+    pNetworkInfoList = new (std::nothrow) ArrayList();
+       SysTryReturn(NID_TEL, pNetworkInfoList != null, null, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
+
+    r = pNetworkInfoList->Construct(networkInfoCount);
+    SysTryReturn(NID_TEL, r == E_SUCCESS, null, r, "[%s] Propagating.", GetErrorMessage(r));
+
+    for (int i = 0 ; i < networkInfoCount ; i++)
+    {
+        pNetworkInfo = GenerateNetworkInfoN(message, currentIndex);
+
+        pNetworkInfoList->Add(*pNetworkInfo);
+    }
+
+    return pNetworkInfoList;
+
+}
+
+NetworkInfo*
+_NetworkManagerImpl::GenerateNetworkInfoN(const String& message, int& currentIndex)
+{
+    NetworkInfo* pNetworkInfo = null;
+    _NetworkInfoImpl* pNetworkInfoImpl = null;
+
+    int temp = 0;
+    String tempString;
+
+    pNetworkInfo = new (std::nothrow) NetworkInfo();
+    SysTryReturn(NID_TEL, pNetworkInfo != null, null, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
+
+    pNetworkInfoImpl = _NetworkInfoImpl::GetInstance(*pNetworkInfo);
+
+    // PLMN
+    int mcc = -1;
+    int mnc = -1;
+    tempString = MessageWithLengthToString(message, currentIndex);
+    _TelephonyUtility::GetMccMncFromPlmn(tempString, mcc, mnc);
+    pNetworkInfoImpl->SetPlmn(tempString);
+    pNetworkInfoImpl->SetMcc(mcc);
+    pNetworkInfoImpl->SetMnc(mnc);
+    SysLog(NID_TEL, "The plmn value is %ls, the mcc value is %d and the mnc is %d",tempString.GetPointer(), mcc, mnc);
+
+    // Operator Name
+    tempString = MessageWithLengthToString(message, currentIndex);
+    pNetworkInfoImpl->SetOperatorName(tempString);
+    SysLog(NID_TEL, "The Operator Name is %ls", tempString.GetPointer());
+
+    // NetworkType
+    tempString = MessageToString(message, currentIndex);
+    Tizen::Base::Integer::Parse(tempString, temp);
+
+    _NetworkType networkType = _TelephonyUtility::ConvertNetworkType(static_cast<TelNetworkSystemType_t>(temp));
+    pNetworkInfoImpl->SetNetworkType(networkType);
+    SysLog(NID_TEL, "The NetworkType is %d", networkType);
+
+    return pNetworkInfo;
+}
+
+
+String
+_NetworkManagerImpl::MessageToString(const String& message, int& currentIndex)
+{
+    int nextIndex = 0;
+    String tempString;
+    result r = E_SUCCESS;
+
+    r = message.IndexOf(":", currentIndex, nextIndex);
+
+    if (r != E_SUCCESS)
+    {
+        SysLog(NID_TEL, "The result of message.IndexOf is %s", GetErrorMessage(r));
+    }
+
+    currentIndex = nextIndex + 1;
+
+    r = message.IndexOf(":", currentIndex, nextIndex);
+
+    if (r != E_SUCCESS)
+    {
+        SysLog(NID_TEL, "The result of message.IndexOf is %s", GetErrorMessage(r));
+    }
+
+    r = message.SubString(currentIndex, nextIndex-currentIndex, tempString);
+
+    if (r != E_SUCCESS)
+    {
+        SysLog(NID_TEL, "The result of message.SubString is %s", GetErrorMessage(r));
+    }
+
+    return tempString;
+}
+
+String
+_NetworkManagerImpl::MessageWithLengthToString(const String& message, int& currentIndex)
+{
+    // e.g. plmn or network name -> "05Olleh",
+    int nextIndex = 0;
+    String tempString("");
+    result r = E_SUCCESS;
+    int len = 0;
+
+    r = message.IndexOf(":", currentIndex, nextIndex);
+
+    if (r != E_SUCCESS)
+    {
+        SysLog(NID_TEL, "The result of message.IndexOf is %s", GetErrorMessage(r));
+    }
+
+    currentIndex = nextIndex + 1;
+
+    message.SubString(currentIndex, 2, tempString);
+    tempString.Trim();
+    currentIndex += 2;
+    Tizen::Base::Integer::Decode(tempString, static_cast<int&>(len));
+
+    if (len == 0)
+    {
+        tempString = "";
+    }
+    else
+    {
+        r = message.SubString(currentIndex, len, tempString);
+
+        if (r != E_SUCCESS)
+        {
+            SysLog(NID_TEL, "The result of message.IndexOf is %s", GetErrorMessage(r));
+        }
+    }
+
+    currentIndex += len;
+
+    return tempString;
+}
+
+}} // Tizen::Telephony
diff --git a/src/FTel_NetworkManagerImpl.h b/src/FTel_NetworkManagerImpl.h
new file mode 100644 (file)
index 0000000..900ec51
--- /dev/null
@@ -0,0 +1,230 @@
+//
+// Open Service Platform
+// Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Apache License, Version 2.0 (the License);
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// 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.
+//
+/**
+ * @file    FTel_NetworkManagerImpl.h
+ * @brief   This is the header file for the _NetworkManagerImpl class.
+ *
+ * This header file contains the declaration of the _NetworkManagerImpl class.
+ */
+#ifndef _FTEL_INTERNAL_NETWORK_MANAGER_IMPL_H_
+#define _FTEL_INTERNAL_NETWORK_MANAGER_IMPL_H_
+
+#include <unique_ptr.h>
+#include <net_connection.h>
+#include <telephony_network_type.h>
+#include <FBaseObject.h>
+#include "FTel_TelephonyUtility.h"
+
+
+namespace Tizen { namespace Base
+{
+class String;
+
+namespace Collection
+{
+class IList;
+}}}
+
+namespace Tizen { namespace Telephony
+{
+class ITelephonyNetworkEventListener;
+class ITelephonyNetworkSettingListener;
+class NetworkInfo;
+class NetworkStatus;
+class NetworkManager;
+class _NetworkManagerEvent;
+class _NetworkSettingEvent;
+class _TelephonyIpcProxy;
+
+class _NetworkManagerImpl
+       : public Tizen::Base::Object
+{
+       /**
+     * @enum _NetworkEventType
+     * Defines the network event type.
+     */
+       enum _NetworkEventType
+       {
+           _NETWORK_EVENT_CALL,
+           _NETWORK_EVENT_DATA,
+           _NETWORK_EVENT_ROAMING
+       };
+
+public:
+       /**
+     * This is the default constructor for this class.
+     *
+     * @since 2.1
+     */
+       _NetworkManagerImpl(void);
+
+       /**
+     * This is the destructor for this class.
+     *
+     * @since 2.1
+     */
+       virtual ~_NetworkManagerImpl(void);
+
+       /**
+     * @see NetworkManager::Construct()
+     */
+       result Construct(ITelephonyNetworkEventListener* pListener);
+
+       /**
+     * @see NetworkManager::GetNetworkStatus()
+     */
+       result GetNetworkStatus(NetworkStatus& networkStatus) const;
+
+       /**
+     * @see NetworkManager::GetNetworkInfo()
+     */
+       result GetNetworkInfo(NetworkInfo& networkInfo) const;
+
+    /**
+     * @see NetworkManager::SetNetworkSettingListener()
+     */
+    result SetNetworkSettingListener(ITelephonyNetworkSettingListener* pListener);
+
+    /**
+     * @see NetworkManager::GetNetworkSelectionMode()
+     */
+    result GetNetworkSelectionMode(void);
+
+    /**
+     * @see NetworkManager::SelectNetwork()
+     */
+    result SelectNetwork(const NetworkInfo& networkInfo);
+
+    /**
+     * @see NetworkManager::SelectNetwork()
+     */
+    result SelectNetwork(void);
+
+    /**
+     * @see NetworkManager::SearchNetwork()
+     */
+    result SearchNetwork(void);
+
+
+    void OnTelephonyNetworkSelectionModeReceived(bool isManual, result r);
+
+    void OnTelephonyNetworkSelectionCompleted(result r);
+
+    void OnTelephonyNetworkSearchCompleted(Tizen::Base::String message, result r);
+
+
+    /**
+     * Checks the network state of the telephony service.
+     */
+       static bool IsServiceAvailable(bool checkEmergency = false);
+
+       /**
+     * Checks the enabled state of flight mode.
+     */
+       static bool IsNetworkAvailable(void);
+
+       /**
+     * Called when the state of data service is changed.
+     *
+     * @param[in] type      The type of current network connection
+     * @param[in] pUserData The user data passed from the callback registration function
+     */
+       static void OnDataServiceStateChangedCallback(connection_type_e type, void* pUserData);
+
+       /**
+     * Called when the state of call service is changed.
+     *
+     * @param[in] serviceState  The state of telephony service
+     * @param[in] pUserData      The user data passed from the callback registration function
+     */
+       static void OnCallServiceStateChangedCallback(network_info_service_state_e serviceState, void* pUserData);
+
+    /**
+     * Called when the state of roaming is changed.
+     *
+     * @param[in] isRoaming The roaming state
+     * @param[in] pUserData  The user data passed from the callback registration function
+     */
+       static void OnRoamingStateChangedCallback(bool isRoaming, void* pUserData);
+
+       /**
+     * Gets the Impl instance.
+     *
+     * @since 2.1
+     * @return The pointer to _NetworkManagerImpl
+     * @param[in] networkManager   An instance of NetworkManager
+     */
+       static _NetworkManagerImpl* GetInstance(NetworkManager& networkManager);
+
+       /**
+     * Gets the Impl instance.
+     *
+     * @since 2.1
+     * @return The pointer to _NetworkManagerImpl
+     * @param[in] networkManager   An instance of NetworkManager
+     */
+       static const _NetworkManagerImpl* GetInstance(const NetworkManager& networkManager);
+
+
+private:
+       /**
+     * This is the copy constructor for the %_NetworkManagerImpl class.
+     *
+     * @param[in]   rhs   An instance of %_NetworkManagerImpl
+     */
+       _NetworkManagerImpl(const _NetworkManagerImpl& rhs);
+
+       /**
+     * Gets the string of network event type.
+     *
+     * @param[in]   type    The value of _NetworkEventType
+     */
+       const char* GetStringOfNetworkEventType(_NetworkEventType type) const;
+
+       /**
+     * Notifies when the status of the telephony network is changed.
+     */
+       void OnTelephonyNetworkStatusChanged(_NetworkEventType type, bool data);
+
+
+       Tizen::Base::Collection::IList* ParsingMessageN(const Tizen::Base::String& message);
+
+       NetworkInfo* GenerateNetworkInfoN(const Tizen::Base::String& message, int& currentIndex);
+
+       Tizen::Base::String MessageToString(const Tizen::Base::String& message, int& currentIndex);
+
+       Tizen::Base::String MessageWithLengthToString(const Tizen::Base::String& message, int& currentIndex);
+
+       /**
+     * This is the assignment operator.
+     * Do @b not use directly.
+     *
+     * @param[in]   rhs An instance of %_NetworkManagerImpl
+     */
+       _NetworkManagerImpl& operator =(const _NetworkManagerImpl& rhs);
+
+private:
+       std::unique_ptr<void, _ConnectionDeleter> __pConnectionHandle;
+       std::unique_ptr<_NetworkManagerEvent> __pNetworkManagerEvent;
+       std::unique_ptr<_NetworkSettingEvent> __pNetworkSettingEvent;
+    _TelephonyIpcProxy* __pTelephonyServiceProxy;
+    ITelephonyNetworkSettingListener* __pSettingListener;
+
+}; // _NetworkManagerImpl
+
+}} // Tizen::Telephony
+#endif // _FTEL_INTERNAL_NETWORK_MANAGER_IMPL_H_
diff --git a/src/FTel_NetworkSettingEvent.cpp b/src/FTel_NetworkSettingEvent.cpp
new file mode 100644 (file)
index 0000000..38c072f
--- /dev/null
@@ -0,0 +1,142 @@
+//
+// Open Service Platform
+// Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Apache License, Version 2.0 (the License);
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// 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.
+//
+
+/**
+ * @file    FTel_NetworkSettingEvent.cpp
+ * @brief   This is the implementation file for the _NetworkSettingEvent Class.
+ *
+ * This header file contains implementation of the _NetworkSettingEvent Class.
+ */
+
+#include <unique_ptr.h>
+#include <FBaseRtIEventListener.h>
+#include <FBaseColArrayList.h>
+#include <FBaseSysLog.h>
+#include <FBaseColAllElementsDeleter.h>
+#include <FTelNetworkInfo.h>
+#include <FTelITelephonyNetworkSettingListener.h>
+#include "FTel_NetworkInfoImpl.h"
+#include "FTel_NetworkSettingEvent.h"
+#include "FTel_NetworkSettingEventArg.h"
+
+using namespace std;
+using namespace Tizen::Base::Collection;
+
+namespace Tizen { namespace Telephony
+{
+
+////////////////////////////////////////////////////////////////////////////
+_NetworkSettingEvent::_NetworkSettingEvent(void)
+{
+}
+
+_NetworkSettingEvent::~_NetworkSettingEvent(void)
+{
+}
+
+result
+_NetworkSettingEvent::Construct(void)
+{
+    return _Event::Initialize();
+}
+
+////////////////////////////////////////////////////////////////////////////////
+/// Operation : Protected
+
+void
+_NetworkSettingEvent::FireImpl(Tizen::Base::Runtime::IEventListener& listener, const Tizen::Base::Runtime::IEventArg& arg)
+{
+    result r = E_SUCCESS;
+
+    const _NetworkSettingEventArg* pArg = dynamic_cast<const _NetworkSettingEventArg*>(&arg);
+    SysTryReturnVoidResult(NID_TEL, pArg != null, E_INVALID_ARG, "[%s] Invalid argument used. The arg is a null pointer.", GetErrorMessage(E_INVALID_ARG));
+
+    ITelephonyNetworkSettingListener* pNetworkSettingListener = dynamic_cast<ITelephonyNetworkSettingListener*>(&listener);
+    SysTryReturnVoidResult(NID_TEL, pNetworkSettingListener != null, E_INVALID_ARG,
+            "[%s] Invalid argument used. The result of a dynamic_cast operation is null for network setting listener", GetErrorMessage(E_INVALID_ARG));
+
+
+    switch(pArg->GetEventType())
+    {
+    case _NETWORK_EVENT_GET_SELECTION_MODE:
+        pNetworkSettingListener->OnTelephonyNetworkSelectionModeReceived(pArg->GetIsManual(), pArg->GetError());
+        break; // _NETWORK_EVENT_GET_SELECTION_MODE
+
+    case _NETWORK_EVENT_SELECT_NETWORK:
+        pNetworkSettingListener->OnTelephonyNetworkSelectionCompleted(pArg->GetError());
+        break; // _NETWORK_EVENT_SELECT_NETWORK
+
+    case _NETWORK_EVENT_SEARCH_COMPLETED:
+               {
+                       ArrayList* pSrcNetworkInfoList = dynamic_cast<ArrayList*>(pArg->GetNetworkInfoList());
+                       SysTryCatch(NID_TEL, pSrcNetworkInfoList != null, , E_SYSTEM, "[%s] A system error has occured. Failed on dynamic casting", GetErrorMessage(E_SYSTEM));
+
+                       unique_ptr<ArrayList, AllElementsDeleter> pDescNetworkInfoList(new (std::nothrow) ArrayList());
+                       SysTryReturnVoidResult(NID_TEL, pDescNetworkInfoList != null, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
+
+                       r = pDescNetworkInfoList->Construct(pSrcNetworkInfoList->GetCount());
+                       SysTryCatch(NID_TEL, r == E_SUCCESS, , r, "[%s] Failed to construct", GetErrorMessage(r));
+
+                       for (int i = 0; i < pSrcNetworkInfoList->GetCount(); i++)
+                       {
+                               NetworkInfo* pTempInfo =  dynamic_cast<NetworkInfo*>(pSrcNetworkInfoList->GetAt(i));
+                               SysTryCatch(NID_TEL, pTempInfo != null, , E_SYSTEM, "[%s] A system error has occured. Failed on dynamic casting", GetErrorMessage(E_SYSTEM));
+
+                               _NetworkInfoImpl* pTempInfoImpl = _NetworkInfoImpl::GetInstance(*pTempInfo);
+
+                               NetworkInfo* pNetworkInfo = new (std::nothrow) NetworkInfo();
+                               SysTryCatch(NID_TEL, pNetworkInfo != null, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
+
+                               _NetworkInfoImpl* pNetworkInfoImpl = _NetworkInfoImpl::GetInstance(*pNetworkInfo);
+
+                               *pNetworkInfoImpl = *pTempInfoImpl;
+
+                               r = pDescNetworkInfoList->Add(*pNetworkInfo);
+                               SysTryCatch(NID_TEL, r == E_SUCCESS, , r, "[%s] Failed to make NetworkInfo list", GetErrorMessage(r));
+                       }
+
+                       // Total Count
+                       SysLog(NID_TEL,"The number of network info list is %d", pDescNetworkInfoList->GetCount());
+
+                       for (int i = 0 ; i < pDescNetworkInfoList->GetCount() ; i++)
+                       {
+                               NetworkInfo* pNetworkInfo = dynamic_cast<NetworkInfo*>(pDescNetworkInfoList->GetAt(i));
+                               SysTryCatch(NID_TEL, pNetworkInfo != null, , E_SYSTEM, "[%s] A system error has occured. Failed on dynamic casting", GetErrorMessage(E_SYSTEM));
+                               SysLog(NID_TEL, "The cellid is %d, lac is %d, mcc is %d, mnc is %d, operator name is %ls, and plmn is %ls"
+                               , pNetworkInfo->GetCellId(), pNetworkInfo->GetLac(), pNetworkInfo->GetMcc(), pNetworkInfo->GetMnc(), pNetworkInfo->GetOperatorName().GetPointer(), pNetworkInfo->GetPlmn().GetPointer());
+                       }
+
+                       pNetworkSettingListener->OnTelephonyNetworkSearchCompletedN(pDescNetworkInfoList.release(), pArg->GetError());
+               }
+        break; // _NETWORK_EVENT_SEARCH_COMPLETED
+
+    default:
+       break; // default
+    }
+
+    return;
+
+CATCH:
+
+    if (r != E_SUCCESS && r != E_OUT_OF_MEMORY)
+    {
+        r = E_SYSTEM;
+    }
+    pNetworkSettingListener->OnTelephonyNetworkSearchCompletedN(null, r);
+}
+
+} } // Tizen::Telephony
diff --git a/src/FTel_NetworkSettingEvent.h b/src/FTel_NetworkSettingEvent.h
new file mode 100644 (file)
index 0000000..9d12656
--- /dev/null
@@ -0,0 +1,90 @@
+//
+// Open Service Platform
+// Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Apache License, Version 2.0 (the License);
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// 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.
+//
+
+/**
+ * @file    FTel_NetworkSettingEvent.h
+ * @brief   This is the header file for the _NetworkSettingEvent class.
+ *
+ * This header file contains declarations of the _NetworkSettingEvent class.
+ */
+
+#ifndef _FTEL_INTERNAL_NETWORK_SETTING_EVENT_H_
+#define _FTEL_INTERNAL_NETWORK_SETTING_EVENT_H_
+
+// Includes
+#include <FBaseResult.h>
+#include <FBaseRt_Event.h>
+
+namespace Tizen { namespace Base { namespace Runtime
+{
+class IEventListener;
+class IEventArg;
+}}}
+
+namespace Tizen { namespace Telephony
+{
+
+/**
+ * @class   _NetworkSettingEvent
+ * @brief   This class handles NetworkManager events related to network setting.
+ *
+ * When a NetworkManager event related to network setting occurs, the _NetworkSettingEvent object finds a ITelephonyNetworkSettingListener object
+ * which is registered for the Device object and calls an appropriate method of the listener.
+ */
+
+class _NetworkSettingEvent
+    : public Tizen::Base::Runtime::_Event
+{
+public:
+    /**
+     * This is the default constructor for this class.
+     */
+    _NetworkSettingEvent();
+
+    /**
+     * This is the class destructor.
+     */
+    virtual ~_NetworkSettingEvent(void);
+
+
+    /**
+     * Initializes a new instance of the  class
+     *
+     */
+    result Construct(void);
+
+protected:
+    /**
+     * Checks the arg and finds out the type of event. After that this method calls appropriate pListener's method.
+     *
+     * @return      A result code.
+     * @param[in]   listener        It is a event listener related to network setting event.
+     * @param[in]   arg             It is an argument-like instance of NetworkManager event retransmitted to the listener's method as an argument.
+     * @exception   E_SUCCESS       The method is successful.
+     * @exception   E_INVALID_ARG   The argument passed to a method contains an invalid value.@n
+     */
+    void FireImpl(Tizen::Base::Runtime::IEventListener& listener, const Tizen::Base::Runtime::IEventArg& arg);
+
+
+private:
+    _NetworkSettingEvent(const _NetworkSettingEvent& rhs);
+    _NetworkSettingEvent& operator =(const _NetworkSettingEvent& rhs);
+
+}; // _NetworkSettingEvent
+
+}} // Tizen::Telephony
+#endif // _FTEL_INTERNAL_NETWORK_SETTING_EVENT_H_
diff --git a/src/FTel_NetworkSettingEventArg.cpp b/src/FTel_NetworkSettingEventArg.cpp
new file mode 100644 (file)
index 0000000..2775087
--- /dev/null
@@ -0,0 +1,102 @@
+//
+// Open Service Platform
+// Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Apache License, Version 2.0 (the License);
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// 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.
+//
+/**
+ * @file        FTel_NetworkSettingEventArg.cpp
+ * @brief       This is the implementation file for the %_NetworkSettingEventArg class.
+ *
+ * This file contains the implementation of the %_NetworkSettingEventArg class.
+ */
+
+#include <FBaseErrorDefine.h>
+#include <FBaseColArrayList.h>
+#include "FTel_NetworkSettingEventArg.h"
+
+namespace Tizen { namespace Telephony
+{
+
+_NetworkSettingEventArg::_NetworkSettingEventArg(void)
+    : __error(E_SUCCESS)
+    , __eventType(_NETWORK_EVENT_NONE)
+    , __isManual(false)
+    , __pNetworkInfoList(null)
+{
+}
+
+_NetworkSettingEventArg::_NetworkSettingEventArg(_NetworkSettingEventType networkType, bool isManual, result r)
+    : __error(r)
+    , __eventType(networkType)
+    , __isManual(isManual)
+    , __pNetworkInfoList(null)
+{
+
+}
+
+_NetworkSettingEventArg::_NetworkSettingEventArg(_NetworkSettingEventType networkType, result r)
+    : __error(r)
+    , __eventType(networkType)
+    , __isManual(false)
+    , __pNetworkInfoList(null)
+{
+
+}
+
+_NetworkSettingEventArg::_NetworkSettingEventArg(_NetworkSettingEventType networkType, Tizen::Base::Collection::IList* pNetworkInfoList, result r)
+    : __error(r)
+    , __eventType(networkType)
+    , __isManual(false)
+    , __pNetworkInfoList(pNetworkInfoList)
+{
+
+}
+
+
+_NetworkSettingEventArg::~_NetworkSettingEventArg(void)
+{
+    if (__pNetworkInfoList != null)
+    {
+        __pNetworkInfoList->RemoveAll(true);
+        delete __pNetworkInfoList;
+    }
+}
+
+
+result
+_NetworkSettingEventArg::GetError(void) const
+{
+    return __error;
+}
+
+_NetworkSettingEventType
+_NetworkSettingEventArg::GetEventType(void) const
+{
+    return __eventType;
+}
+
+bool
+_NetworkSettingEventArg::GetIsManual(void) const
+{
+    return __isManual;
+}
+
+Tizen::Base::Collection::IList*
+_NetworkSettingEventArg::GetNetworkInfoList(void) const
+{
+    return __pNetworkInfoList;
+}
+
+
+} } // Tizen::Telephony
diff --git a/src/FTel_NetworkSettingEventArg.h b/src/FTel_NetworkSettingEventArg.h
new file mode 100644 (file)
index 0000000..13b6470
--- /dev/null
@@ -0,0 +1,103 @@
+//
+// Open Service Platform
+// Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Apache License, Version 2.0 (the License);
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// 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.
+//
+/**
+ * @file        FTel_NetworkSettingEventArg.h
+ * @brief       This is the header file for _NetworkSettingEventArg class.
+ *
+ * This header file contains the declarations of _NetworkSettingEventArg class.
+ */
+
+
+#ifndef _FTEL_INTERNAL_NETWORK_SETTING_EVENT_ARG_H_
+#define _FTEL_INTERNAL_NETWORK_SETTING_EVENT_ARG_H_
+
+// Includes
+#include <FBaseObject.h>
+#include <FBaseDataType.h>
+#include <FBaseRtIEventArg.h>
+
+namespace Tizen { namespace Base { namespace Collection
+{
+class IList;
+}}}
+
+namespace Tizen { namespace Telephony
+{
+
+enum _NetworkSettingEventType
+{
+    _NETWORK_EVENT_NONE,
+    _NETWORK_EVENT_GET_SELECTION_MODE,
+    _NETWORK_EVENT_SELECT_NETWORK,
+    _NETWORK_EVENT_SEARCH_COMPLETED
+};
+
+
+/**
+ * @class   _NetworkSettingEventArg
+ * @brief   This class is used as an argument of methods of the ITelephonyNetworkSettingListener class.
+ *
+ * This class is used as an argument of ITelephonyNetworkSettingListener methods.
+ * When a NetworkManager event occurs, the _NetworkSettingEvent object finds a ITelephonyNetworkSettingListener object
+ * which is registered for the NetworkManager object and calls an appropriate method of the listener.
+ */
+
+class _NetworkSettingEventArg
+    : public Tizen::Base::Object
+    , public Tizen::Base::Runtime::IEventArg
+{
+public:
+    _NetworkSettingEventArg(void);
+
+    _NetworkSettingEventArg(_NetworkSettingEventType networkType, bool isManual, result r);
+
+    _NetworkSettingEventArg(_NetworkSettingEventType networkType, result r);
+
+    _NetworkSettingEventArg(_NetworkSettingEventType networkType, Tizen::Base::Collection::IList* pNetworkInfoList, result r);
+
+    virtual ~_NetworkSettingEventArg(void);
+
+    /**
+     * @brief   Gets the error code.
+     * @return  Error code of this argument.
+     */
+    result GetError(void) const;
+
+    _NetworkSettingEventType GetEventType(void) const;
+
+    bool GetIsManual(void) const;
+
+    /**
+     * @brief       Gets the list of NetworkInfo.
+     * @return      Pointer to the ArrayList object which contains information of NetoworkInfo.
+     */
+    Tizen::Base::Collection::IList* GetNetworkInfoList(void) const;
+
+private:
+    _NetworkSettingEventArg(const _NetworkSettingEventArg& rhs);
+    _NetworkSettingEventArg& operator =(const _NetworkSettingEventArg& rhs);
+
+private:
+    result __error;
+    _NetworkSettingEventType __eventType;
+    bool __isManual;
+    Tizen::Base::Collection::IList* __pNetworkInfoList;
+
+}; // _NetworkSettingEventArg
+} }
+
+#endif // _FTEL_INTERNAL_NETWORK_MANAGER_EVENT_ARG_H_
diff --git a/src/FTel_NetworkStatusImpl.cpp b/src/FTel_NetworkStatusImpl.cpp
new file mode 100644 (file)
index 0000000..daea2be
--- /dev/null
@@ -0,0 +1,111 @@
+//
+// Open Service Platform
+// Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Apache License, Version 2.0 (the License);
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// 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.
+//
+/**
+ * @file        FTel_NetworkStatusImpl.cpp
+ * @brief       This is the implementation file for _NetworkStatusImpl class.
+ */
+
+#include <FTelNetworkStatus.h>
+#include "FTel_NetworkStatusImpl.h"
+
+namespace Tizen { namespace Telephony
+{
+
+
+_NetworkStatusImpl::_NetworkStatusImpl(void)
+       : __isRoaming(false)
+       , __isCallServiceAvailable(false)
+       , __isDataServiceAvailable(false)
+{
+}
+
+_NetworkStatusImpl::~_NetworkStatusImpl(void)
+{
+}
+
+_NetworkStatusImpl::_NetworkStatusImpl(const _NetworkStatusImpl& rhs)
+    : __isRoaming(rhs.__isRoaming)
+    , __isCallServiceAvailable(rhs.__isCallServiceAvailable)
+    , __isDataServiceAvailable(rhs.__isDataServiceAvailable)
+{
+
+}
+
+bool
+_NetworkStatusImpl::IsRoaming(void) const
+{
+       return __isRoaming;
+}
+
+bool
+_NetworkStatusImpl::IsCallServiceAvailable(void) const
+{
+       return __isCallServiceAvailable;
+}
+
+bool
+_NetworkStatusImpl::IsDataServiceAvailable(void) const
+{
+       return __isDataServiceAvailable;
+}
+
+void
+_NetworkStatusImpl::SetIsRoaming(bool isRoaming)
+{
+       __isRoaming = isRoaming;
+}
+
+void
+_NetworkStatusImpl::SetIsCallServiceAvailable(bool isCallServiceAvailable)
+{
+       __isCallServiceAvailable = isCallServiceAvailable;
+}
+
+void
+_NetworkStatusImpl::SetIsDataServiceAvailable(bool isDataServiceAvailable)
+{
+       __isDataServiceAvailable = isDataServiceAvailable;
+}
+
+_NetworkStatusImpl*
+_NetworkStatusImpl::GetInstance(NetworkStatus& networkStatus)
+{
+       return networkStatus.__pNetworkStatusImpl;
+}
+
+const _NetworkStatusImpl*
+_NetworkStatusImpl::GetInstance(const NetworkStatus& networkStatus)
+{
+       return networkStatus.__pNetworkStatusImpl;
+}
+
+_NetworkStatusImpl&
+_NetworkStatusImpl::operator =(const _NetworkStatusImpl& rhs)
+{
+
+    if (this != &rhs)
+    {
+        __isRoaming = rhs.__isRoaming;
+        __isCallServiceAvailable = rhs.__isCallServiceAvailable;
+        __isDataServiceAvailable = rhs.__isDataServiceAvailable;
+    }
+
+   return *this;
+
+}
+
+}} // Tizen::Telephony
diff --git a/src/FTel_NetworkStatusImpl.h b/src/FTel_NetworkStatusImpl.h
new file mode 100644 (file)
index 0000000..713fd3e
--- /dev/null
@@ -0,0 +1,129 @@
+//
+// Open Service Platform
+// Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Apache License, Version 2.0 (the License);
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// 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.
+//
+/**
+ * @file       FTel_NetworkStatusImpl.h
+ * @brief      This is the header file for the _NetworkStatusImpl class.
+ *
+ * This header file contains the declarations of the _NetworkStatusImpl class.
+ */
+#ifndef _FTEL_INTERNAL_NETWORK_STATUS_IMPL_H_
+#define _FTEL_INTERNAL_NETWORK_STATUS_IMPL_H_
+
+
+#include <FBaseObject.h>
+
+
+namespace Tizen { namespace Telephony
+{
+class NetworkStatus;
+
+class _NetworkStatusImpl
+       : public Tizen::Base::Object
+{
+public:
+       /**
+     * This is the default constructor for this class.
+     *
+     * @since  1.0
+     */
+       _NetworkStatusImpl(void);
+
+       /**
+     * This is the destructor for this class.
+     *
+     * @since  1.0
+     */
+       virtual ~_NetworkStatusImpl(void);
+
+    /**
+     * This is the copy constructor for this class.
+     *
+     * @param[in]   rhs An instance of %_NetworkStatusImpl
+     */
+    _NetworkStatusImpl(const _NetworkStatusImpl& rhs);
+
+    /**
+     * @see NetworkStatus::IsRoaming()
+     */
+       bool IsRoaming(void) const;
+
+       /**
+     * @see NetworkStatus::IsCallServiceAvailable()
+     */
+       bool IsCallServiceAvailable(void) const;
+
+       /**
+     * @see NetworkStatus::IsDataServiceAvailable()
+     */
+       bool IsDataServiceAvailable(void) const;
+
+       /**
+     * Sets the current state of roaming.
+     *
+     * @param[in]   isRoaming   The current state of roaming
+     */
+       void SetIsRoaming(bool isRoaming);
+
+       /**
+     * Sets the current state whether call service is available.
+     *
+     * @param[in]   isCallServiceAvailable   The current state whether call service is available
+     */
+       void SetIsCallServiceAvailable(bool isCallServiceAvailable);
+
+       /**
+     * Sets the current state whether date service is available.
+     *
+     * @param[in]   isDataServiceAvailable   The current state whether date service is available
+     */
+       void SetIsDataServiceAvailable(bool isDataServiceAvailable);
+
+       /**
+     * Gets the Impl instance.
+     *
+     * @since 2.1
+     * @return The pointer to _NetworkStatusImpl
+     * @param[in] networkStatus   An instance of NetworkStatus
+     */
+       static _NetworkStatusImpl* GetInstance(NetworkStatus& networkStatus);
+
+       /**
+     * Gets the Impl instance.
+     *
+     * @since 2.1
+     * @return The pointer to _NetworkStatusImpl
+     * @param[in] networkStatus   An instance of NetworkStatus
+     */
+       static const _NetworkStatusImpl* GetInstance(const NetworkStatus& networkStatus);
+
+
+       /**
+     * This is the assignment operator for this class. Do @b not use directly.
+     *
+     * @param[in]      rhs     An instance of %_NetworkStatusImpl
+     */
+       _NetworkStatusImpl& operator =(const _NetworkStatusImpl& rhs);
+
+private:
+       bool __isRoaming;
+       bool __isCallServiceAvailable;
+       bool __isDataServiceAvailable;
+
+}; // _NetworkStatusImpl
+
+}} // Tizen::Telephony
+#endif // _FTEL_INTERNAL_NETWORK_STATUS_IMPL_H_
diff --git a/src/FTel_SimInfoImpl.cpp b/src/FTel_SimInfoImpl.cpp
new file mode 100644 (file)
index 0000000..add2fe8
--- /dev/null
@@ -0,0 +1,262 @@
+//
+// Open Service Platform
+// Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Apache License, Version 2.0 (the License);
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// 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.
+//
+/**
+ * @file        FTel_SimInfoImpl.cpp
+ * @brief       This is the implementation file for _SimInfoImpl class.
+ */
+
+#include <stdlib.h>
+#include <string.h>
+#include <sim.h>
+#include <FBaseString.h>
+#include <FBaseResult.h>
+#include <unique_ptr.h>
+#include <FTelSimInfo.h>
+#include <FBaseSysLog.h>
+#include "FTel_SimInfoImpl.h"
+#include "FTel_TelephonyIpcProxy.h"
+#include "FTel_TelephonyUtility.h"
+
+using namespace std;
+using namespace Tizen::App;
+using namespace Tizen::Base;
+
+namespace Tizen { namespace Telephony
+{
+
+
+_SimInfoImpl::_SimInfoImpl(void)
+: __pTelephonyServiceProxy(null)
+{
+
+}
+
+_SimInfoImpl::~_SimInfoImpl(void)
+{
+}
+
+result
+_SimInfoImpl::Construct(void)
+{
+       SysTryReturnResult(NID_TEL, IsAvailable(), E_DEVICE_UNAVAILABLE, "The operation failed due to a missing SIM card.");
+
+       __pTelephonyServiceProxy = _TelephonyIpcProxy::GetInstance();
+
+       if (__pTelephonyServiceProxy == null)
+       {
+           SysLog(NID_TEL, "Creating an IPC instance to connect with the Connectivity service daemon has failed.");
+       }
+
+       return E_SUCCESS;
+}
+
+
+int
+_SimInfoImpl::GetMnc(void) const
+{
+       int mnc = -1;
+
+       SysTryReturn(NID_TEL, IsAvailable(), mnc, E_DEVICE_UNAVAILABLE,
+                                       "[%s] The operation failed due to a missing SIM card.", GetErrorMessage(E_DEVICE_UNAVAILABLE));
+
+       int err = SIM_ERROR_NONE;
+       char* pTemp = null;
+
+       err = sim_get_mnc(&pTemp);
+
+       SysLog(NID_TEL, "The return value of sim_get_mnc() is 0x%x and the mnc value is %s", err, pTemp);
+       SysTryReturn(NID_TEL, err == SIM_ERROR_NONE, mnc, E_SYSTEM, "[%s] A system error has occured. Failed to get the Mobile Network Code (MNC).", GetErrorMessage(E_SYSTEM));
+       unique_ptr<char, _CharDeleter> pMnc(pTemp);
+
+       if(pMnc.get() != null)
+       {
+               mnc = atoi(pMnc.get());
+       }
+       return mnc;
+}
+
+int
+_SimInfoImpl::GetMcc(void) const
+{
+       int mcc = -1;
+
+       SysTryReturn(NID_TEL, IsAvailable(), mcc, E_DEVICE_UNAVAILABLE,
+                                       "[%s] The operation failed due to a missing SIM card.", GetErrorMessage(E_DEVICE_UNAVAILABLE));
+
+       int err = SIM_ERROR_NONE;
+       char* pTemp = null;
+
+       err = sim_get_mcc(&pTemp);
+       
+       SysLog(NID_TEL, "The return value of sim_get_mcc() is 0x%x,and the mcc value is %s", err, pTemp);
+       SysTryReturn(NID_TEL, err == SIM_ERROR_NONE, mcc, E_SYSTEM, "[%s] A system error has occured. Failed to get the Mobile Country Code (MCC).", GetErrorMessage(E_SYSTEM));
+       unique_ptr<char, _CharDeleter> pMcc(pTemp);
+
+       if(pMcc.get() != null)
+       {
+               mcc = atoi(pMcc.get());
+       }
+       return mcc;
+}
+
+String
+_SimInfoImpl::GetSpn(void) const
+{
+       String spn;
+
+       SysTryReturn(NID_TEL, IsAvailable(), spn, E_DEVICE_UNAVAILABLE,
+                   "[%s] The operation failed due to a missing SIM card.", GetErrorMessage(E_DEVICE_UNAVAILABLE));
+
+       int err = SIM_ERROR_NONE;
+       
+       char* pTemp = null;
+
+       err = sim_get_spn(&pTemp);
+       SysLog(NID_TEL, "The return value of sim_get_spn() is 0x%x and the spn value is %s", err, pTemp);
+       SysTryReturn(NID_TEL, err == SIM_ERROR_NONE, spn, E_SYSTEM, "[%s] A system error has occured. Failed to get the Service Provider Name (SPN).", GetErrorMessage(E_SYSTEM));
+       unique_ptr<char, _CharDeleter> pSpn(pTemp);
+
+       if(pSpn.get() != null)
+       {
+               spn = String(pSpn.get());
+       }
+       return spn;
+}
+
+String
+_SimInfoImpl::GetIccId(void) const
+{
+       String iccId;
+
+       SysTryReturn(NID_TEL, IsAvailable(), iccId, E_DEVICE_UNAVAILABLE,
+                                       "[%s] The operation failed due to a missing SIM card.", GetErrorMessage(E_DEVICE_UNAVAILABLE));
+
+       int err = SIM_ERROR_NONE;
+       char* pTemp = null;
+
+       err = sim_get_icc_id(&pTemp);
+       SysLog(NID_TEL, "The return value of sim_get_icc_id() is 0x%x and the iccid valuce is %s", err, pTemp);
+       SysTryReturn(NID_TEL, err == SIM_ERROR_NONE, iccId, E_SYSTEM, "[%s] A system error has occured. Failed to get the Integrated Circuit Card(ICC) ID.", GetErrorMessage(E_SYSTEM));
+
+       unique_ptr<char, _CharDeleter> pIccId(pTemp);
+
+       if (pIccId.get() != null)
+       {
+               iccId = String(pIccId.get());
+       }
+
+       return iccId;
+}
+
+String
+_SimInfoImpl::GetOperatorName(void) const
+{
+       String operatorName;
+
+       SysTryReturn(NID_TEL, IsAvailable(), operatorName, E_DEVICE_UNAVAILABLE,
+                                       "[%s] The operation failed due to a missing SIM card.", GetErrorMessage(E_DEVICE_UNAVAILABLE));
+
+       int err = SIM_ERROR_NONE;
+
+       char* pTempFullName = null;
+       char* pTempShortName = null;
+
+       err = sim_get_cphs_operator_name(&pTempFullName, &pTempShortName);
+
+       SysLog(NID_TEL, "The return value of sim_get_cphs_operator_name() is 0x%x", err);
+       SysTryReturn(NID_TEL, err == SIM_ERROR_NONE, operatorName, E_SYSTEM, "[%s] A system error has occured. Failed to get the operator name.", GetErrorMessage(E_SYSTEM));
+
+       unique_ptr<char, _CharDeleter> pFullName(pTempFullName);
+       unique_ptr<char, _CharDeleter> pShortName(pTempShortName);
+
+       operatorName = String((const char*) pFullName.get());
+       SysLog(NID_TEL, "The Operator Name is %ls", operatorName.GetPointer());
+
+       return operatorName;
+}
+
+String
+_SimInfoImpl::GetPhoneNumber(void) const
+{
+       String phoneNumber;
+
+       SysTryReturn(NID_TEL, IsAvailable(), phoneNumber, E_DEVICE_UNAVAILABLE,
+                               "[%s] The operation failed due to a missing SIM card.", GetErrorMessage(E_DEVICE_UNAVAILABLE));
+
+       int err = SIM_ERROR_NONE;
+       char* pTemp = null;
+
+       err = sim_get_subscriber_number(&pTemp);
+       SysLog(NID_TEL, "The return value of sim_get_subscriber_number() is 0x%x and the phone number is %s", err, pTemp);
+       SysTryReturn(NID_TEL, err == SIM_ERROR_NONE, phoneNumber, E_SYSTEM, "[%s] A system error has occured. Failed to get the phone number.", GetErrorMessage(E_SYSTEM));
+       
+       unique_ptr<char, _CharDeleter> pPhoneNumber(pTemp);
+       if (pPhoneNumber.get() != null)
+       {
+               phoneNumber = String((const char*) pPhoneNumber.get());
+       }
+       return phoneNumber;
+}
+
+String
+_SimInfoImpl::GetImsi(void) const
+{
+       result r = E_SUCCESS;
+       String imsi;
+
+       SysTryReturn(NID_TEL, IsAvailable(), imsi, E_DEVICE_UNAVAILABLE,
+               "[%s] The operation failed due to a missing SIM card.", GetErrorMessage(E_DEVICE_UNAVAILABLE));
+
+       SysTryReturn(NID_TEL, __pTelephonyServiceProxy != null, imsi, E_SYSTEM, "[%s] A system error has occured. IPC instance has not been constructed yet.", GetErrorMessage(E_SYSTEM));
+
+       r = __pTelephonyServiceProxy->GetImsi(imsi);
+       SysTryReturn(NID_TEL, r == E_SUCCESS, imsi, r, "[%s] Failed to get the imsi.", GetErrorMessage(r));
+
+       return imsi;
+}
+
+bool
+_SimInfoImpl::IsAvailable(void) const
+{
+       bool isAvailable = false;
+       int err = SIM_ERROR_NONE;
+       sim_state_e simState = SIM_STATE_UNKNOWN;
+
+       err = sim_get_state(&simState);
+       SysLog(NID_TEL, "The return value of sim_get_state() is 0x%x and the simState is %d", err, simState);
+
+       if (err == SIM_ERROR_NONE && simState == SIM_STATE_AVAILABLE)
+       {
+               isAvailable = true;
+       }
+
+       return isAvailable;
+}
+
+_SimInfoImpl*
+_SimInfoImpl::GetInstance(SimInfo& simInfo)
+{
+       return simInfo.__pSimInfoImpl;
+}
+
+const _SimInfoImpl*
+_SimInfoImpl::GetInstance(const SimInfo& simInfo)
+{
+       return simInfo.__pSimInfoImpl;
+}
+
+}} // Tizen::Telephony
diff --git a/src/FTel_SimInfoImpl.h b/src/FTel_SimInfoImpl.h
new file mode 100644 (file)
index 0000000..529ccb4
--- /dev/null
@@ -0,0 +1,141 @@
+//
+// Open Service Platform
+// Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Apache License, Version 2.0 (the License);
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// 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.
+//
+/**
+ * @file       FTel_SimInfoImpl.h
+ * @brief      This is the header file for the %_SimInfoImpl class.
+ *
+ * This header file contains the declarations of the %_SimInfoImpl class.
+ */
+#ifndef _FTEL_INTERNAL_SIM_INFO_IMPL_H_
+#define _FTEL_INTERNAL_SIM_INFO_IMPL_H_
+
+
+#include <FBaseObject.h>
+
+
+namespace Tizen { namespace Base
+{
+class String;
+} } // Tizen::Base
+
+namespace Tizen { namespace Telephony
+{
+class SimInfo;
+class _TelephonyIpcProxy;
+
+class _SimInfoImpl
+       : public Tizen::Base::Object
+{
+public:
+       /**
+     * This is the default constructor for this class.
+     *
+     * @since 2.1
+     */
+       _SimInfoImpl(void);
+
+       /**
+     * This is the destructor for this class.
+     *
+     * @since 2.1
+     */
+       virtual ~_SimInfoImpl(void);
+
+       /**
+     * @see SimInfo::Construct()
+     */
+       result Construct(void);
+
+       /**
+     * @see SimInfo::GetMnc()
+     */
+       int GetMnc(void) const;
+
+       /**
+     * @see SimInfo::GetMcc()
+     */
+       int GetMcc(void) const;
+
+       /**
+     * @see SimInfo::GetSpn()
+     */
+       Tizen::Base::String GetSpn(void) const;
+
+       /**
+     * @see SimInfo::GetIccId()
+     */
+       Tizen::Base::String GetIccId(void) const;
+
+       /**
+     * @see SimInfo::GetOperatorName()
+     */
+       Tizen::Base::String GetOperatorName(void) const;
+
+       /**
+     * @see SimInfo::GetPhoneNumber()
+     */
+       Tizen::Base::String GetPhoneNumber(void) const;
+
+       /**
+     * @see SimInfo::GetImsi()
+     */
+       Tizen::Base::String GetImsi(void) const;
+
+       /**
+     * @see SimInfo::IsAvailable()
+     */
+       bool IsAvailable(void) const;
+
+       /**
+     * Gets the Impl instance.
+     *
+     * @since 2.1
+     * @return The pointer to _SimInfoImpl
+     * @param[in] simInfo    An instance of SimInfo
+     */
+       static _SimInfoImpl* GetInstance(SimInfo& simInfo);
+
+       /**
+     * Gets the Impl instance.
+     *
+     * @since 2.1
+     * @return The pointer to _SimInfoImpl
+     * @param[in] simInfo    An instance of SimInfo
+     */
+       static const _SimInfoImpl* GetInstance(const SimInfo& simInfo);
+
+private:
+       /**
+     * This is the copy constructor for this class. Do @b not use directly.
+     *
+     * @param[in]   rhs   An instance of %_SimInfoImpl
+     */
+       _SimInfoImpl(const _SimInfoImpl& rhs);
+
+       /**
+     * This is the assignment operator for this class. Do @b not use directly.
+     *
+     * @param[in]   rhs An instance of %_SimInfoImpl
+     */
+       _SimInfoImpl& operator =(const _SimInfoImpl& rhs);
+
+       _TelephonyIpcProxy* __pTelephonyServiceProxy;
+
+}; // _SimInfoImpl
+
+}} // Tizen::Telephony
+#endif // _FTEL_INTERNAL_SIM_INFO_IMPL_H_
diff --git a/src/FTel_TelephonyIpcMessages.cpp b/src/FTel_TelephonyIpcMessages.cpp
new file mode 100644 (file)
index 0000000..e3b8035
--- /dev/null
@@ -0,0 +1,44 @@
+//
+// Open Service Platform
+// Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Apache License, Version 2.0 (the License);
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// 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.
+//
+
+/**
+ * @file    FTel_TelephonyIpcMessages.cpp
+ * @brief   This is the generator of IPC messages for the Connectivity service daemon.
+ */
+
+#define IPC_MESSAGE_IMPL
+#include "FTel_ConnectivityIpcMessages.h"
+
+// Generate constructors.
+#include <ipc/struct_constructor_macros.h>
+#include "FTel_ConnectivityIpcMessages.h"
+
+// Generate destructors.
+#include <ipc/struct_destructor_macros.h>
+#include "FTel_ConnectivityIpcMessages.h"
+
+// Generate param traits write methods.
+#include <ipc/param_traits_write_macros.h>
+namespace IPC {
+#include "FTel_ConnectivityIpcMessages.h"
+}  // namespace IPC
+
+// Generate param traits read methods.
+#include <ipc/param_traits_read_macros.h>
+namespace IPC {
+#include "FTel_ConnectivityIpcMessages.h"
+}  // namespace IPC
diff --git a/src/FTel_TelephonyIpcProxy.cpp b/src/FTel_TelephonyIpcProxy.cpp
new file mode 100644 (file)
index 0000000..9af93b5
--- /dev/null
@@ -0,0 +1,358 @@
+//
+// Open Service Platform
+// Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Apache License, Version 2.0 (the License);
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// 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.
+//
+
+/**
+ * @file    FTel_TelephonyIpcProxy.cpp
+ * @brief   This is the implementation file for the %_TelephonyIpcProxy class.
+ *
+ * This file contains the implementation of the %_TelephonyIpcProxy class.
+ */
+
+#include <pthread.h>
+#include <unique_ptr.h>
+#include <FBaseSysLog.h>
+#include <FIo_IpcClient.h>
+#include <FTel_ConnectivityIpcMessages.h>
+#include "FTel_TelephonyIpcProxy.h"
+#include "FTel_CallManagerImpl.h"
+#include "FTel_NetworkManagerImpl.h"
+
+using namespace Tizen::Base;
+using namespace Tizen::Io;
+
+namespace Tizen { namespace Telephony
+{
+
+_TelephonyIpcProxy* _TelephonyIpcProxy::__pInstance = null;
+
+_TelephonyIpcProxy::_TelephonyIpcProxy(void)
+       : __pIpcClient(null)
+    , __pNetworkManagerImpl(null)
+    , __pCallManagerImpl(null)
+{
+}
+
+_TelephonyIpcProxy::~_TelephonyIpcProxy(void)
+{
+       delete __pIpcClient;
+}
+
+result
+_TelephonyIpcProxy::Construct(void)
+{
+       result r = E_SUCCESS;
+
+       __pIpcClient = new (std::nothrow) _IpcClient();
+       SysTryReturnResult(NID_TEL, __pIpcClient != null, E_OUT_OF_MEMORY, "Memory allocation failed.");
+
+       r = __pIpcClient->Construct(TELEPHONY_CONNECTIVITY_IPC_SERVER_NAME, this);
+       SysTryReturnResult(NID_TEL, r != E_OUT_OF_MEMORY, r, "Propagating.");
+
+       if (r != E_SUCCESS)
+       {
+               SysLogException(NID_TEL, r, "[%s] Propagating", GetErrorMessage(r));
+               delete __pIpcClient;
+               __pIpcClient = null;
+       }
+
+       return r;
+}
+
+_TelephonyIpcProxy*
+_TelephonyIpcProxy::GetInstance(void)
+{
+       static pthread_once_t onceBlock = PTHREAD_ONCE_INIT;
+
+       if (__pInstance == null)
+       {
+               ClearLastResult();
+               pthread_once(&onceBlock, InitSingleton);
+               result r = GetLastResult();
+               if(r != E_SUCCESS)
+               {
+                       onceBlock = PTHREAD_ONCE_INIT;
+               }
+       }
+
+       return __pInstance;
+}
+
+void
+_TelephonyIpcProxy::InitSingleton(void)
+{
+       result r = E_SUCCESS;
+       static _TelephonyIpcProxy instance;
+
+       r = instance.Construct();
+       SysTryReturnVoidResult(NID_TEL, r == E_SUCCESS, r, "[%s] Propagating", GetErrorMessage(r));
+
+       __pInstance = &instance;
+}
+
+result
+_TelephonyIpcProxy::GetImsi(Tizen::Base::String& imsi) const
+{
+       result r = E_SUCCESS;
+       unsigned long ret = 0;
+
+       std::unique_ptr<IPC::Message> pMessage( new (std::nothrow) ConnectivityTelephonyServiceMsg_getImsi(&imsi, &ret));
+       SysTryReturnResult(NID_TEL, pMessage!= null , E_OUT_OF_MEMORY, "Memory allocation failed.");
+
+       r = __pIpcClient->SendRequest(*pMessage);
+
+       SysTryReturnResult(NID_TEL, r == E_SUCCESS, E_SYSTEM, "A system error has been occurred. Failed to send a request.");
+       SysTryReturnResult(NID_TEL, ret == E_SUCCESS, ret, "Propagating.");
+
+       SysLog(NID_TEL, "The Telephony Imsi obtained through IPC is %ls.", imsi.GetPointer());
+
+       return E_SUCCESS;
+}
+
+result
+_TelephonyIpcProxy::HasSystemPrivilege(void)
+{
+    result r = E_SUCCESS;
+    unsigned long ret = 0;
+
+    std::unique_ptr<IPC::Message> pMessage( new (std::nothrow) ConnectivityTelephonyServiceMsg_hasSystemPrivilege(&ret));
+    SysTryReturnResult(NID_TEL, pMessage != null , E_OUT_OF_MEMORY, "Memory allocation failed.");
+
+    r = __pIpcClient->SendRequest(*pMessage);
+    SysTryReturnResult(NID_TEL, r == E_SUCCESS, E_SYSTEM, "A system error has been occurred. Failed to send a request.");
+    SysTryReturnResult(NID_TEL, ret == E_SUCCESS, ret, "Propagating.");
+
+    return E_SUCCESS;
+}
+
+result
+_TelephonyIpcProxy::GetNetworkSelectionMode(void)
+{
+    result r = E_SUCCESS;
+    unsigned long ret = 0;
+
+    std::unique_ptr<IPC::Message> pMessage( new (std::nothrow) ConnectivityTelephonyServiceMsg_getNetworkSelectionMode(&ret));
+    SysTryReturnResult(NID_TEL, pMessage != null , E_OUT_OF_MEMORY, "Memory allocation failed.");
+
+    r = __pIpcClient->SendRequest(*pMessage);
+    SysTryReturnResult(NID_TEL, r == E_SUCCESS, E_SYSTEM, "A system error has been occurred. Failed to send a request.");
+    SysTryReturnResult(NID_TEL, ret == E_SUCCESS, ret, "Propagating.");
+
+    return E_SUCCESS;
+}
+
+result
+_TelephonyIpcProxy::SelectNetwork(const Tizen::Base::String& plmn, const int netwokrType)
+{
+    result r = E_SUCCESS;
+    unsigned long ret = 0;
+
+    std::unique_ptr<IPC::Message> pMessage( new (std::nothrow) ConnectivityTelephonyServiceMsg_selectNetworkManual(plmn, netwokrType, &ret));
+    SysTryReturnResult(NID_TEL, pMessage != null , E_OUT_OF_MEMORY, "Memory allocation failed.");
+
+    r = __pIpcClient->SendRequest(*pMessage);
+    SysTryReturnResult(NID_TEL, r == E_SUCCESS, E_SYSTEM, "A system error has been occurred. Failed to send a request.");
+    SysTryReturnResult(NID_TEL, ret == E_SUCCESS, ret, "Propagating.");
+
+    return E_SUCCESS;
+}
+
+result
+_TelephonyIpcProxy::SelectNetwork(void)
+{
+    result r = E_SUCCESS;
+    unsigned long ret = 0;
+
+    std::unique_ptr<IPC::Message> pMessage( new (std::nothrow) ConnectivityTelephonyServiceMsg_selectNetworkAutomatic(&ret));
+    SysTryReturnResult(NID_TEL, pMessage != null , E_OUT_OF_MEMORY, "Memory allocation failed.");
+
+    r = __pIpcClient->SendRequest(*pMessage);
+    SysTryReturnResult(NID_TEL, r == E_SUCCESS, E_SYSTEM, "A system error has been occurred. Failed to send a request.");
+    SysTryReturnResult(NID_TEL, ret == E_SUCCESS, ret, "Propagating.");
+
+    return E_SUCCESS;
+
+}
+
+result
+_TelephonyIpcProxy::SearchNetwork(void)
+{
+    result r = E_SUCCESS;
+    unsigned long ret = 0;
+
+    std::unique_ptr<IPC::Message> pMessage( new (std::nothrow) ConnectivityTelephonyServiceMsg_searchNetwork(&ret));
+    SysTryReturnResult(NID_TEL, pMessage != null , E_OUT_OF_MEMORY, "Memory allocation failed.");
+
+    r = __pIpcClient->SendRequest(*pMessage);
+    SysTryReturnResult(NID_TEL, r == E_SUCCESS, E_SYSTEM, "A system error has been occurred. Failed to send a request.");
+    SysTryReturnResult(NID_TEL, ret == E_SUCCESS, ret, "Propagating.");
+
+    return E_SUCCESS;
+}
+
+
+result
+_TelephonyIpcProxy::HasCallForwardPrivilege(void)
+{
+    result r = E_SUCCESS;
+    unsigned long ret = 0;
+
+    std::unique_ptr<IPC::Message> pMessage( new (std::nothrow) ConnectivityTelephonyServiceMsg_hasCallForwardPrivilege(&ret));
+    SysTryReturnResult(NID_TEL, pMessage != null , E_OUT_OF_MEMORY, "Memory allocation failed.");
+
+    r = __pIpcClient->SendRequest(*pMessage);
+    SysTryReturnResult(NID_TEL, r == E_SUCCESS, E_SYSTEM, "A system error has been occurred. Failed to send a request.");
+    SysTryReturnResult(NID_TEL, ret == E_SUCCESS, ret, "Propagating.");
+
+    return E_SUCCESS;
+}
+
+result
+_TelephonyIpcProxy::RequestCallForward(const String& phoneNumber)
+{
+    result r = E_SUCCESS;
+    unsigned long ret = 0;
+
+    std::unique_ptr<IPC::Message> pMessage( new (std::nothrow) ConnectivityTelephonyServiceMsg_requestCallForward(phoneNumber, &ret));
+    SysTryReturnResult(NID_TEL, pMessage != null , E_OUT_OF_MEMORY, "Memory allocation failed.");
+
+    r = __pIpcClient->SendRequest(*pMessage);
+    SysTryReturnResult(NID_TEL, r == E_SUCCESS, E_SYSTEM, "A system error has been occurred. Failed to send a request.");
+    SysTryReturnResult(NID_TEL, ret == E_SUCCESS, ret, "Propagating.");
+
+    return E_SUCCESS;
+}
+
+result
+_TelephonyIpcProxy::StopCallForward(void)
+{
+    result r = E_SUCCESS;
+    unsigned long ret = 0;
+
+    std::unique_ptr<IPC::Message> pMessage( new (std::nothrow) ConnectivityTelephonyServiceMsg_stopCallForward(&ret));
+    SysTryReturnResult(NID_TEL, pMessage != null , E_OUT_OF_MEMORY, "Memory allocation failed.");
+
+    r = __pIpcClient->SendRequest(*pMessage);
+    SysTryReturnResult(NID_TEL, r == E_SUCCESS, E_SYSTEM, "A system error has been occurred. Failed to send a request.");
+    SysTryReturnResult(NID_TEL, ret == E_SUCCESS, ret, "Propagating.");
+
+    return E_SUCCESS;
+}
+
+result
+_TelephonyIpcProxy::GetCallForwardNumber(void)
+{
+    result r = E_SUCCESS;
+    unsigned long ret = 0;
+
+    std::unique_ptr<IPC::Message> pMessage( new (std::nothrow) ConnectivityTelephonyServiceMsg_getCallForwardNumber(&ret));
+    SysTryReturnResult(NID_TEL, pMessage != null , E_OUT_OF_MEMORY, "Memory allocation failed.");
+
+    r = __pIpcClient->SendRequest(*pMessage);
+    SysTryReturnResult(NID_TEL, r == E_SUCCESS, E_SYSTEM, "A system error has been occurred. Failed to send a request.");
+    SysTryReturnResult(NID_TEL, ret == E_SUCCESS, ret, "Propagating.");
+
+    return E_SUCCESS;
+}
+
+void
+_TelephonyIpcProxy::SetNetworkManagerImpl(_NetworkManagerImpl& impl)
+{
+    __pNetworkManagerImpl = &impl;
+}
+
+void
+_TelephonyIpcProxy::SetCallManagerImpl(_CallManagerImpl& impl)
+{
+    __pCallManagerImpl = &impl;
+}
+
+void
+_TelephonyIpcProxy::OnIpcResponseReceived(Tizen::Io::_IpcClient& client, const IPC::Message& message)
+{
+    SysLog(NID_TEL, "OnIpcResponseReceived");
+
+    IPC_BEGIN_MESSAGE_MAP(_TelephonyIpcProxy, message)
+    IPC_MESSAGE_HANDLER(ConnectivityTelephonyServiceMsg_onNetworkSelectionModeReceived, OnNetworkSelectionModeReceived, &client)
+    IPC_MESSAGE_HANDLER(ConnectivityTelephonyServiceMsg_onNetworkSelectionCompleted, OnNetworkSelectionCompleted, &client)
+    IPC_MESSAGE_HANDLER(ConnectivityTelephonyServiceMsg_onNetworkSearchCompleted, OnNetworkSearchCompleted, &client)
+    IPC_MESSAGE_HANDLER(ConnectivityTelephonyServiceMsg_onCallForwardNumberReceived, OnTelephonyCallForwardNumberReceived, &client);
+    IPC_MESSAGE_HANDLER(ConnectivityTelephonyServiceMsg_onCallForwardResponseReceived, OnTelephonyCallForwardResponseReceived, &client);
+    IPC_MESSAGE_HANDLER(ConnectivityTelephonyServiceMsg_onCallForwardStopped, OnTelephonyCallForwardStopped, &client);
+    IPC_END_MESSAGE_MAP()
+}
+
+void
+_TelephonyIpcProxy::OnNetworkSelectionModeReceived(bool isManual, unsigned long res)
+{
+    SysLog(NID_TEL, "The listener has been called.");
+
+    SysAssertf(__pIpcClient != null, "Not yet constructed. Construct() should be called before use.");
+
+    __pNetworkManagerImpl->OnTelephonyNetworkSelectionModeReceived(isManual, res);
+}
+
+void
+_TelephonyIpcProxy::OnNetworkSelectionCompleted(unsigned long res)
+{
+    SysLog(NID_TEL, "The listener has been called.");
+
+    SysAssertf(__pIpcClient != null, "Not yet constructed. Construct() should be called before use.");
+
+    __pNetworkManagerImpl->OnTelephonyNetworkSelectionCompleted(res);
+}
+
+void
+_TelephonyIpcProxy::OnNetworkSearchCompleted(Tizen::Base::String message, unsigned long res)
+{
+    SysLog(NID_TEL, "The listener has been called.");
+
+    SysAssertf(__pIpcClient != null, "Not yet constructed. Construct() should be called before use.");
+
+    __pNetworkManagerImpl->OnTelephonyNetworkSearchCompleted(message, res);
+}
+
+void
+_TelephonyIpcProxy::OnTelephonyCallForwardNumberReceived(Tizen::Base::String phoneNumber, unsigned long res)
+{
+    SysLog(NID_TEL, "The listener has been called.");
+
+    SysAssertf(__pIpcClient != null, "Not yet constructed. Construct() should be called before use.");
+
+    __pCallManagerImpl->OnTelephonyCallForwardNumberReceived(phoneNumber, res);
+}
+
+void
+_TelephonyIpcProxy::OnTelephonyCallForwardResponseReceived(Tizen::Base::String phoneNumber, unsigned long res)
+{
+    SysLog(NID_TEL, "The listener has been called.");
+
+    SysAssertf(__pIpcClient != null, "Not yet constructed. Construct() should be called before use.");
+
+    __pCallManagerImpl->OnTelephonyCallForwardResponseReceived(phoneNumber, res);
+}
+
+void
+_TelephonyIpcProxy::OnTelephonyCallForwardStopped(Tizen::Base::String phoneNumber, unsigned long res)
+{
+    SysLog(NID_TEL, "The listener has been called.");
+
+    SysAssertf(__pIpcClient != null, "Not yet constructed. Construct() should be called before use.");
+
+    __pCallManagerImpl->OnTelephonyCallForwardStopped(phoneNumber, res);
+}
+
+}} // Tizen::Telephony
diff --git a/src/FTel_TelephonyIpcProxy.h b/src/FTel_TelephonyIpcProxy.h
new file mode 100644 (file)
index 0000000..d5522b7
--- /dev/null
@@ -0,0 +1,107 @@
+//
+// Open Service Platform
+// Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Apache License, Version 2.0 (the License);
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// 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.
+//
+
+/**
+ * @file       FTel_TelephonyIpcProxy.h
+ * @brief      This is the header file for the %_TelephonyIpcProxy class.
+ *
+ * This header file contains the declarations of the %_TelephonyIpcProxy class.
+ */
+
+#ifndef _FNET_WIFI_INTERNAL_TELEPHONY_IPC_PROXY_H_
+#define _FNET_WIFI_INTERNAL_TELEPHONY_IPC_PROXY_H_
+
+#include <tapi_type.h>
+#include <FBaseObject.h>
+#include <FIo_IpcCommonDataTypes.h>
+#include <FIo_IIpcClientEventListener.h>
+
+namespace Tizen { namespace Base {
+class String;
+} }
+
+namespace Tizen { namespace Io {
+class _IpcClient;
+} }
+
+namespace Tizen { namespace Telephony
+{
+
+class _NetworkManagerImpl;
+class _CallManagerImpl;
+
+/**
+ * @class   _TelephonyIpcProxy
+ * @brief   This class represents an IPC proxy for %Telephony service.
+ *
+ * This class represents an IPC proxy for %Telephony service to communicate with OSP Connectivity daemon.
+ */
+class _TelephonyIpcProxy
+       : public Tizen::Base::Object
+       , public Tizen::Io::_IIpcClientEventListener
+{
+public:
+
+    // from _IIpcClientEventListener
+    virtual void OnIpcResponseReceived(Tizen::Io::_IpcClient& client, const IPC::Message& message);
+
+       result Construct(void);
+       result GetImsi(Tizen::Base::String& imsi) const;
+       result HasSystemPrivilege(void);
+       result GetNetworkSelectionMode(void);
+       result SelectNetwork(const Tizen::Base::String& plmn, const int netwokrType);
+    result SelectNetwork(void);
+    result SearchNetwork(void);
+
+       result HasCallForwardPrivilege(void);
+    result RequestCallForward(const Tizen::Base::String& phoneNumber);
+    result StopCallForward(void);
+    result GetCallForwardNumber(void);
+
+    void SetNetworkManagerImpl(_NetworkManagerImpl& impl);
+    void SetCallManagerImpl(_CallManagerImpl& impl);
+
+    static _TelephonyIpcProxy* GetInstance(void);
+
+private:
+       _TelephonyIpcProxy(void);
+       virtual ~_TelephonyIpcProxy(void);
+
+
+       _TelephonyIpcProxy(const _TelephonyIpcProxy& value);
+       _TelephonyIpcProxy& operator =(const _TelephonyIpcProxy& rhs);
+
+       void OnNetworkSelectionModeReceived(bool isManual, unsigned long res);
+       void OnNetworkSelectionCompleted(unsigned long res);
+       void OnNetworkSearchCompleted(Tizen::Base::String message, unsigned long res);
+
+       void OnTelephonyCallForwardNumberReceived(Tizen::Base::String phoneNumber, unsigned long res);
+       void OnTelephonyCallForwardResponseReceived(Tizen::Base::String phoneNumber, unsigned long res);
+       void OnTelephonyCallForwardStopped(Tizen::Base::String phoneNumber, unsigned long res);
+
+       static void InitSingleton(void);
+       
+private:
+       Tizen::Io::_IpcClient* __pIpcClient;
+       _NetworkManagerImpl* __pNetworkManagerImpl;
+       _CallManagerImpl* __pCallManagerImpl;
+       static _TelephonyIpcProxy* __pInstance;
+
+}; // _TelephonyIpcProxy
+
+}}
+#endif // _FNET_WIFI_INTERNAL_TELEPHONY_IPC_PROXY_H_
diff --git a/src/FTel_TelephonyUtility.cpp b/src/FTel_TelephonyUtility.cpp
new file mode 100644 (file)
index 0000000..d0d5316
--- /dev/null
@@ -0,0 +1,205 @@
+//
+// Open Service Platform
+// Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Apache License, Version 2.0 (the License);
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// 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.
+//
+
+/**
+ * @file    FTel_TelephonyUtility.cpp
+ * @brief   This is the implementation file for the _TelephonyUtility Class.
+ *
+ * This file contains implementation of the _TelephonyUtility Class.
+ */
+
+
+#include <FBaseSysLog.h>
+#include <FBaseString.h>
+#include <FBaseInteger.h>
+#include "FTel_TelephonyUtility.h"
+
+
+
+using namespace Tizen::Base;
+
+namespace Tizen { namespace Telephony
+{
+
+
+_NetworkType
+_TelephonyUtility::ConvertNetworkType(TelNetworkSystemType_t networkSystemType)
+{
+    _NetworkType networktype = _NETWORK_TYPE_UNDEFINED;
+    switch(networkSystemType)
+    {
+    case TAPI_NETWORK_SYSTEM_NO_SRV:
+        networktype = _NETWORK_TYPE_UNDEFINED;
+        break;
+    case TAPI_NETWORK_SYSTEM_GSM:
+        networktype = _NETWORK_TYPE_GSM;
+        break;
+    case TAPI_NETWORK_SYSTEM_GPRS:
+        networktype = _NETWORK_TYPE_GPRS;
+        break;
+    case TAPI_NETWORK_SYSTEM_EGPRS:
+        networktype = _NETWORK_TYPE_EGPRS;
+        break;
+    case TAPI_NETWORK_SYSTEM_PCS1900:
+        networktype = _NETWORK_TYPE_PCS1900;
+        break;
+    case TAPI_NETWORK_SYSTEM_UMTS:
+        networktype = _NETWORK_TYPE_UMTS;
+        break;
+    case TAPI_NETWORK_SYSTEM_GSM_AND_UMTS:
+        networktype = _NETWORK_TYPE_GSM_AND_UMTS;
+        break;
+    case TAPI_NETWORK_SYSTEM_HSDPA:
+        networktype = _NETWORK_TYPE_HSDPA;
+        break;
+    case TAPI_NETWORK_SYSTEM_IS95A:
+        networktype = _NETWORK_TYPE_IS95A;
+        break;
+    case TAPI_NETWORK_SYSTEM_IS95B:
+        networktype = _NETWORK_TYPE_IS95B;
+        break;
+    case TAPI_NETWORK_SYSTEM_CDMA_1X:
+        networktype = _NETWORK_TYPE_CDMA_1X;
+        break;
+    case TAPI_NETWORK_SYSTEM_EVDO_REV_0:
+        networktype = _NETWORK_TYPE_EVDO_REV_0;
+        break;
+    case TAPI_NETWORK_SYSTEM_1X_EVDO_REV_0_HYBRID:
+        networktype = _NETWORK_TYPE_CDMA_1X_AND_EVDO_REV_0;
+        break;
+    case TAPI_NETWORK_SYSTEM_EVDO_REV_A:
+        networktype = _NETWORK_TYPE_EVDO_REV_A;
+        break;
+    case TAPI_NETWORK_SYSTEM_1X_EVDO_REV_A_HYBRID:
+        networktype = _NETWORK_TYPE_CDMA_1X_AND_EVDO_REV_A;
+        break;
+    case TAPI_NETWORK_SYSTEM_EVDV:
+        networktype = _NETWORK_TYPE_EVDV;
+        break;
+    default:
+           SysLog(NID_TEL, "The network system type is %d", networkSystemType);
+               break;
+    }
+
+    return networktype;
+}
+
+TelNetworkSystemType_t
+_TelephonyUtility::ConvertNetworkType(_NetworkType networkType)
+{
+    TelNetworkSystemType_t networkSystemType = TAPI_NETWORK_SYSTEM_NO_SRV;
+    switch(networkType)
+    {
+    case _NETWORK_TYPE_UNDEFINED:
+        networkSystemType = TAPI_NETWORK_SYSTEM_NO_SRV;
+        break;
+    case _NETWORK_TYPE_GSM:
+        networkSystemType = TAPI_NETWORK_SYSTEM_GSM;
+        break;
+    case _NETWORK_TYPE_GPRS:
+        networkSystemType = TAPI_NETWORK_SYSTEM_GPRS;
+        break;
+    case _NETWORK_TYPE_EGPRS:
+        networkSystemType = TAPI_NETWORK_SYSTEM_EGPRS;
+        break;
+    case _NETWORK_TYPE_PCS1900:
+        networkSystemType = TAPI_NETWORK_SYSTEM_PCS1900;
+        break;
+    case _NETWORK_TYPE_UMTS:
+        networkSystemType = TAPI_NETWORK_SYSTEM_UMTS;
+        break;
+    case _NETWORK_TYPE_GSM_AND_UMTS:
+        networkSystemType = TAPI_NETWORK_SYSTEM_GSM_AND_UMTS;
+        break;
+    case _NETWORK_TYPE_HSDPA:
+        networkSystemType = TAPI_NETWORK_SYSTEM_HSDPA;
+        break;
+    case _NETWORK_TYPE_IS95A:
+        networkSystemType = TAPI_NETWORK_SYSTEM_IS95A;
+        break;
+    case _NETWORK_TYPE_IS95B:
+        networkSystemType = TAPI_NETWORK_SYSTEM_IS95B;
+        break;
+    case _NETWORK_TYPE_CDMA_1X:
+        networkSystemType = TAPI_NETWORK_SYSTEM_CDMA_1X;
+        break;
+    case _NETWORK_TYPE_EVDO_REV_0:
+        networkSystemType = TAPI_NETWORK_SYSTEM_EVDO_REV_0;
+        break;
+    case _NETWORK_TYPE_CDMA_1X_AND_EVDO_REV_0:
+        networkSystemType = TAPI_NETWORK_SYSTEM_1X_EVDO_REV_0_HYBRID;
+        break;
+    case _NETWORK_TYPE_EVDO_REV_A:
+        networkSystemType = TAPI_NETWORK_SYSTEM_EVDO_REV_A;
+        break;
+    case _NETWORK_TYPE_CDMA_1X_AND_EVDO_REV_A:
+        networkSystemType = TAPI_NETWORK_SYSTEM_1X_EVDO_REV_A_HYBRID;
+        break;
+    case _NETWORK_TYPE_EVDV:
+        networkSystemType = TAPI_NETWORK_SYSTEM_EVDV;
+        break;
+    default:
+           SysLog(NID_TEL, "The network type is %d", networkType);
+               break;
+    }
+
+    return networkSystemType;
+}
+
+result
+_TelephonyUtility::ConvertErrorType(int error)
+{
+    result r = E_SUCCESS;
+
+    if (error == 0)
+    {
+        r = E_SUCCESS;
+    }
+    else if (error == -1)
+    {
+        r = E_NOT_RESPONDING;
+    }
+    else
+    {
+        r = E_SYSTEM;
+    }
+
+    return r;
+}
+
+void
+_TelephonyUtility::GetMccMncFromPlmn(const String& plmn, int& mcc, int& mnc)
+{
+    int currentIndex = 0;
+    const int MCC_LENGTH = 3;
+    String temp;
+
+    plmn.SubString(currentIndex, MCC_LENGTH, temp);
+    currentIndex +=  MCC_LENGTH;
+    Integer::Parse(temp, static_cast<int&>(mcc));
+    SysLog(NID_TEL, "The temp value is %ls", temp.GetPointer());
+    SysLog(NID_TEL, "The mcc value is %d", mcc);
+
+    temp.Clear();
+
+    plmn.SubString(currentIndex, plmn.GetLength()-MCC_LENGTH, temp);
+    Integer::Parse(temp, static_cast<int&>(mnc));
+    SysLog(NID_TEL, "The temp value is %ls", temp.GetPointer());
+    SysLog(NID_TEL, "The mnc value is %d", mnc);
+}
+
+} } // Tizen::Telephony
diff --git a/src/FTel_TelephonyUtility.h b/src/FTel_TelephonyUtility.h
new file mode 100644 (file)
index 0000000..af67db3
--- /dev/null
@@ -0,0 +1,95 @@
+//
+// Open Service Platform
+// Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Apache License, Version 2.0 (the License);
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// 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.
+//
+
+/**
+ * @file    FTel_TelephonyUtility.h
+ * @brief   This is the header file for the %_TelephonyUtility class.
+ *
+ * This header file contains the declarations of the %_TelephonyUtility class.
+ */
+
+#ifndef _FTEL_INTERNAL_TELEPHONY_UTILITY_H_
+#define _FTEL_INTERNAL_TELEPHONY_UTILITY_H_
+
+#include <net_connection.h>
+#include <TelNetwork.h>
+#include "FTel_NetworkInfoImpl.h"
+
+namespace Tizen { namespace Base
+{
+class String;
+}}
+
+namespace Tizen { namespace Telephony
+{
+
+struct _ConnectionDeleter
+{
+    void operator()(void* pConnection)
+    {
+        connection_destroy(pConnection);
+    }
+};
+
+struct _CharDeleter
+{
+    void operator()(char* pChar)
+    {
+        free(pChar);
+    }
+};
+
+class _TelephonyUtility
+{
+public:
+    /**
+     * Converts TelNetworkSystemType_t to _NetworkType Type
+     *
+     * @return      The network type
+     * @param[in]   networkSystem   network system type
+     */
+    static _NetworkType ConvertNetworkType(TelNetworkSystemType_t networkSystemType);
+
+    /**
+     * Converts _NetworkType to TelNetworkSystemType_t Type
+     *
+     * @return      The network type
+     * @param[in]   networkSystem   network type
+     */
+    static TelNetworkSystemType_t ConvertNetworkType(_NetworkType networkType);
+
+    static result ConvertErrorType(int error);
+
+    static void GetMccMncFromPlmn(const Tizen::Base::String& plmn, int& mcc, int& mnc);
+
+
+private:
+    /**
+     * This default constructor is intentionally declared as private because this class cannot be constructed.
+     */
+    _TelephonyUtility(void);
+
+    /**
+     * This destructor is intentionally declared as private because this class cannot be constructed.
+     */
+    virtual ~_TelephonyUtility(void);
+
+}; // _TelephonyUtility
+
+} }  // Tizen::Telephony
+#endif // _FTEL_INTERNAL_TELEPHONY_UTILITY_H_
+
diff --git a/src/inc/FTel_ConnectivityIpcMessages.h b/src/inc/FTel_ConnectivityIpcMessages.h
new file mode 100644 (file)
index 0000000..21d5ebe
--- /dev/null
@@ -0,0 +1,56 @@
+//
+// Open Service Platform
+// Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Apache License, Version 2.0 (the License);
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// 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.
+//
+/**
+ * @file       FTel_ConnectivityIpcMessages.h
+ * @brief      This is the header file for the Connectivity service daemon's IPC messages.
+ *
+ * This header file contains the declarations of the IPC messages for the Connectivity service daemon.
+ */
+
+#include <ipc/ipc_message_macros.h>
+#include <FIo_IpcCommonParamTraits.h>
+#include <FIo_IpcMessageStart.h>
+
+#ifndef TELEPHONY_CONNECTIVITY_IPC_SERVER_NAME
+#define TELEPHONY_CONNECTIVITY_IPC_SERVER_NAME "osp.telephony.ipcserver.connectivity"
+#endif
+
+#define IPC_MESSAGE_START ConnectivityTelephonyServiceMsgStart
+
+// Client -> Server (sync)
+IPC_SYNC_MESSAGE_CONTROL0_2(ConnectivityTelephonyServiceMsg_getImsi, Tizen::Base::String /* imsi */, unsigned long /* result */)
+IPC_SYNC_MESSAGE_CONTROL0_1(ConnectivityTelephonyServiceMsg_hasSystemPrivilege, unsigned long /* result */)
+IPC_SYNC_MESSAGE_CONTROL0_1(ConnectivityTelephonyServiceMsg_getNetworkSelectionMode, unsigned long /* result */)
+IPC_SYNC_MESSAGE_CONTROL2_1(ConnectivityTelephonyServiceMsg_selectNetworkManual, Tizen::Base::String /* plmn */, int /* network type */, unsigned long /* result */)
+IPC_SYNC_MESSAGE_CONTROL0_1(ConnectivityTelephonyServiceMsg_selectNetworkAutomatic, unsigned long /* result */)
+IPC_SYNC_MESSAGE_CONTROL0_1(ConnectivityTelephonyServiceMsg_searchNetwork, unsigned long /* result */)
+
+IPC_SYNC_MESSAGE_CONTROL0_1(ConnectivityTelephonyServiceMsg_hasCallForwardPrivilege, unsigned long /* result */)
+IPC_SYNC_MESSAGE_CONTROL1_1(ConnectivityTelephonyServiceMsg_requestCallForward, Tizen::Base::String /* phone number */, unsigned long /* result */)
+IPC_SYNC_MESSAGE_CONTROL0_1(ConnectivityTelephonyServiceMsg_stopCallForward, unsigned long /* result */)
+IPC_SYNC_MESSAGE_CONTROL0_1(ConnectivityTelephonyServiceMsg_getCallForwardNumber, unsigned long /* result */)
+
+
+
+// Server -> Client (async)
+IPC_MESSAGE_CONTROL2(ConnectivityTelephonyServiceMsg_onNetworkSelectionModeReceived, bool /* isManual */, unsigned long /* result */);
+IPC_MESSAGE_CONTROL1(ConnectivityTelephonyServiceMsg_onNetworkSelectionCompleted, unsigned long /* result */);
+IPC_MESSAGE_CONTROL2(ConnectivityTelephonyServiceMsg_onNetworkSearchCompleted, Tizen::Base::String /* message */, unsigned long /* result */);
+IPC_MESSAGE_CONTROL2(ConnectivityTelephonyServiceMsg_onCallForwardNumberReceived, Tizen::Base::String /* phone number */, unsigned long /* result */);
+IPC_MESSAGE_CONTROL2(ConnectivityTelephonyServiceMsg_onCallForwardResponseReceived, Tizen::Base::String /* phone number */, unsigned long /* result */);
+IPC_MESSAGE_CONTROL2(ConnectivityTelephonyServiceMsg_onCallForwardStopped, Tizen::Base::String /* phone number */, unsigned long /* result */);
+