2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
5 // Licensed under the Apache License, Version 2.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
9 // http://www.apache.org/licenses/LICENSE-2.0
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an "AS IS" BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
18 * @file FTel_NetworkManagerImpl.h
19 * @brief This is the header file for the _NetworkManagerImpl class.
21 * This header file contains the declaration of the _NetworkManagerImpl class.
23 #ifndef _FTEL_INTERNAL_NETWORK_MANAGER_IMPL_H_
24 #define _FTEL_INTERNAL_NETWORK_MANAGER_IMPL_H_
26 #include <unique_ptr.h>
27 #include <net_connection.h>
28 #include <telephony_network_type.h>
29 #include <FBaseObject.h>
30 #include "FTel_TelephonyUtility.h"
33 namespace Tizen { namespace Base
42 namespace Tizen { namespace Telephony
44 class ITelephonyNetworkEventListener;
45 class ITelephonyNetworkSettingListener;
49 class _NetworkManagerEvent;
50 class _NetworkSettingEvent;
51 class _TelephonyIpcProxy;
53 class _NetworkManagerImpl
54 : public Tizen::Base::Object
58 * This is the default constructor for this class.
62 _NetworkManagerImpl(void);
65 * This is the destructor for this class.
69 virtual ~_NetworkManagerImpl(void);
72 * @see NetworkManager::Construct()
74 result Construct(ITelephonyNetworkEventListener* pListener);
77 * @see NetworkManager::GetNetworkStatus()
79 result GetNetworkStatus(NetworkStatus& networkStatus) const;
82 * @see NetworkManager::GetNetworkInfo()
84 result GetNetworkInfo(NetworkInfo& networkInfo) const;
87 * @see NetworkManager::SetNetworkSettingListener()
89 result SetNetworkSettingListener(ITelephonyNetworkSettingListener* pListener);
92 * @see NetworkManager::GetNetworkSelectionMode()
94 result GetNetworkSelectionMode(void);
97 * @see NetworkManager::SelectNetwork()
99 result SelectNetwork(const NetworkInfo& networkInfo);
102 * @see NetworkManager::SelectNetwork()
104 result SelectNetwork(void);
107 * @see NetworkManager::SearchNetwork()
109 result SearchNetwork(void);
112 void OnTelephonyNetworkSelectionModeReceived(bool isManual, result r);
114 void OnTelephonyNetworkSelectionCompleted(result r);
116 void OnTelephonyNetworkSearchCompleted(Tizen::Base::String message, result r);
119 * Checks the network state of the data network service.
121 bool IsDataAvailable(void);
124 * Checks the data roaming is on or off.
126 bool IsRoaming(void);
129 * Checks the network state of the telephony service.
131 static bool IsServiceAvailable(bool checkEmergency = false);
134 * Checks the enabled state of flight mode.
136 static bool IsNetworkAvailable(void);
139 * Called when the state of data service is changed.
141 * @param[in] type The type of current network connection
142 * @param[in] pUserData The user data passed from the callback registration function
144 static void OnDataServiceStateChangedCallback(connection_type_e type, void* pUserData);
147 * Called when the state of call service is changed.
149 * @param[in] serviceState The state of telephony service
150 * @param[in] pUserData The user data passed from the callback registration function
152 static void OnCallServiceStateChangedCallback(network_info_service_state_e serviceState, void* pUserData);
155 * Called when the state of roaming is changed.
157 * @param[in] isRoaming The roaming state
158 * @param[in] pUserData The user data passed from the callback registration function
160 static void OnRoamingStateChangedCallback(bool isRoaming, void* pUserData);
163 * Gets the Impl instance.
166 * @return The pointer to _NetworkManagerImpl
167 * @param[in] networkManager An instance of NetworkManager
169 static _NetworkManagerImpl* GetInstance(NetworkManager& networkManager);
172 * Gets the Impl instance.
175 * @return The pointer to _NetworkManagerImpl
176 * @param[in] networkManager An instance of NetworkManager
178 static const _NetworkManagerImpl* GetInstance(const NetworkManager& networkManager);
183 * This is the copy constructor for the %_NetworkManagerImpl class.
185 * @param[in] rhs An instance of %_NetworkManagerImpl
187 _NetworkManagerImpl(const _NetworkManagerImpl& rhs);
189 void OnTelephonyNetworkStatusChanged(void);
191 Tizen::Base::Collection::IList* ParsingMessageN(const Tizen::Base::String& message);
193 NetworkInfo* GenerateNetworkInfoN(const Tizen::Base::String& message, int& currentIndex);
195 Tizen::Base::String MessageToString(const Tizen::Base::String& message, int& currentIndex);
197 Tizen::Base::String MessageWithLengthToString(const Tizen::Base::String& message, int& currentIndex);
200 * This is the assignment operator.
201 * Do @b not use directly.
203 * @param[in] rhs An instance of %_NetworkManagerImpl
205 _NetworkManagerImpl& operator =(const _NetworkManagerImpl& rhs);
208 std::unique_ptr<void, _ConnectionDeleter> __pConnectionHandle;
209 std::unique_ptr<_NetworkManagerEvent> __pNetworkManagerEvent;
210 std::unique_ptr<_NetworkSettingEvent> __pNetworkSettingEvent;
211 _TelephonyIpcProxy* __pTelephonyServiceProxy;
212 ITelephonyNetworkSettingListener* __pSettingListener;
214 bool __isCallServiceAvailable;
215 bool __isDataServiceAvailable;
218 }; // _NetworkManagerImpl
220 }} // Tizen::Telephony
221 #endif // _FTEL_INTERNAL_NETWORK_MANAGER_IMPL_H_