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
57 * @enum _NetworkEventType
58 * Defines the network event type.
60 enum _NetworkEventType
64 _NETWORK_EVENT_ROAMING
69 * This is the default constructor for this class.
73 _NetworkManagerImpl(void);
76 * This is the destructor for this class.
80 virtual ~_NetworkManagerImpl(void);
83 * @see NetworkManager::Construct()
85 result Construct(ITelephonyNetworkEventListener* pListener);
88 * @see NetworkManager::GetNetworkStatus()
90 result GetNetworkStatus(NetworkStatus& networkStatus) const;
93 * @see NetworkManager::GetNetworkInfo()
95 result GetNetworkInfo(NetworkInfo& networkInfo) const;
98 * @see NetworkManager::SetNetworkSettingListener()
100 result SetNetworkSettingListener(ITelephonyNetworkSettingListener* pListener);
103 * @see NetworkManager::GetNetworkSelectionMode()
105 result GetNetworkSelectionMode(void);
108 * @see NetworkManager::SelectNetwork()
110 result SelectNetwork(const NetworkInfo& networkInfo);
113 * @see NetworkManager::SelectNetwork()
115 result SelectNetwork(void);
118 * @see NetworkManager::SearchNetwork()
120 result SearchNetwork(void);
123 void OnTelephonyNetworkSelectionModeReceived(bool isManual, result r);
125 void OnTelephonyNetworkSelectionCompleted(result r);
127 void OnTelephonyNetworkSearchCompleted(Tizen::Base::String message, result r);
131 * Checks the network state of the telephony service.
133 static bool IsServiceAvailable(bool checkEmergency = false);
136 * Checks the enabled state of flight mode.
138 static bool IsNetworkAvailable(void);
141 * Called when the state of data service is changed.
143 * @param[in] type The type of current network connection
144 * @param[in] pUserData The user data passed from the callback registration function
146 static void OnDataServiceStateChangedCallback(connection_type_e type, void* pUserData);
149 * Called when the state of call service is changed.
151 * @param[in] serviceState The state of telephony service
152 * @param[in] pUserData The user data passed from the callback registration function
154 static void OnCallServiceStateChangedCallback(network_info_service_state_e serviceState, void* pUserData);
157 * Called when the state of roaming is changed.
159 * @param[in] isRoaming The roaming state
160 * @param[in] pUserData The user data passed from the callback registration function
162 static void OnRoamingStateChangedCallback(bool isRoaming, void* pUserData);
165 * Gets the Impl instance.
168 * @return The pointer to _NetworkManagerImpl
169 * @param[in] networkManager An instance of NetworkManager
171 static _NetworkManagerImpl* GetInstance(NetworkManager& networkManager);
174 * Gets the Impl instance.
177 * @return The pointer to _NetworkManagerImpl
178 * @param[in] networkManager An instance of NetworkManager
180 static const _NetworkManagerImpl* GetInstance(const NetworkManager& networkManager);
185 * This is the copy constructor for the %_NetworkManagerImpl class.
187 * @param[in] rhs An instance of %_NetworkManagerImpl
189 _NetworkManagerImpl(const _NetworkManagerImpl& rhs);
192 * Gets the string of network event type.
194 * @param[in] type The value of _NetworkEventType
196 const char* GetStringOfNetworkEventType(_NetworkEventType type) const;
199 * Notifies when the status of the telephony network is changed.
201 void OnTelephonyNetworkStatusChanged(_NetworkEventType type, bool data);
204 Tizen::Base::Collection::IList* ParsingMessageN(const Tizen::Base::String& message);
206 NetworkInfo* GenerateNetworkInfoN(const Tizen::Base::String& message, int& currentIndex);
208 Tizen::Base::String MessageToString(const Tizen::Base::String& message, int& currentIndex);
210 Tizen::Base::String MessageWithLengthToString(const Tizen::Base::String& message, int& currentIndex);
213 * This is the assignment operator.
214 * Do @b not use directly.
216 * @param[in] rhs An instance of %_NetworkManagerImpl
218 _NetworkManagerImpl& operator =(const _NetworkManagerImpl& rhs);
221 std::unique_ptr<void, _ConnectionDeleter> __pConnectionHandle;
222 std::unique_ptr<_NetworkManagerEvent> __pNetworkManagerEvent;
223 std::unique_ptr<_NetworkSettingEvent> __pNetworkSettingEvent;
224 _TelephonyIpcProxy* __pTelephonyServiceProxy;
225 ITelephonyNetworkSettingListener* __pSettingListener;
227 }; // _NetworkManagerImpl
229 }} // Tizen::Telephony
230 #endif // _FTEL_INTERNAL_NETWORK_MANAGER_IMPL_H_