Merge from 2.2
[platform/framework/native/telephony.git] / src / FTel_NetworkManagerImpl.h
1 //
2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
4 //
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
8 //
9 //     http://www.apache.org/licenses/LICENSE-2.0
10 //
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.
16 //
17 /**
18  * @file    FTel_NetworkManagerImpl.h
19  * @brief   This is the header file for the _NetworkManagerImpl class.
20  *
21  * This header file contains the declaration of the _NetworkManagerImpl class.
22  */
23 #ifndef _FTEL_INTERNAL_NETWORK_MANAGER_IMPL_H_
24 #define _FTEL_INTERNAL_NETWORK_MANAGER_IMPL_H_
25
26 #include <unique_ptr.h>
27 #include <FBaseObject.h>
28 #include "FTel_TelephonyUtility.h"
29
30
31 namespace Tizen { namespace Base
32 {
33 class String;
34
35 namespace Collection
36 {
37 class IList;
38 }}}
39
40 namespace Tizen { namespace Telephony
41 {
42 class ITelephonyNetworkEventListener;
43 class ITelephonyNetworkSettingListener;
44 class NetworkInfo;
45 class NetworkStatus;
46 class NetworkManager;
47 class _NetworkManagerEvent;
48 class _NetworkSettingEvent;
49 class _TelephonyIpcProxy;
50
51 class _NetworkManagerImpl
52         : public Tizen::Base::Object
53 {
54 public:
55         /**
56      *  This is the default constructor for this class.
57      *
58      * @since 2.1
59      */
60         _NetworkManagerImpl(void);
61
62         /**
63      *  This is the destructor for this class.
64      *
65      * @since 2.1
66      */
67         virtual ~_NetworkManagerImpl(void);
68
69         /**
70      * @see NetworkManager::Construct()
71      */
72         result Construct(ITelephonyNetworkEventListener* pListener);
73
74         /**
75      * @see NetworkManager::GetNetworkStatus()
76      */
77         result GetNetworkStatus(NetworkStatus& networkStatus) const;
78
79         /**
80      * @see NetworkManager::GetNetworkInfo()
81      */
82         result GetNetworkInfo(NetworkInfo& networkInfo) const;
83
84     /**
85      * @see NetworkManager::SetNetworkSettingListener()
86      */
87     result SetNetworkSettingListener(ITelephonyNetworkSettingListener* pListener);
88
89     /**
90      * @see NetworkManager::GetNetworkSelectionMode()
91      */
92     result GetNetworkSelectionMode(void);
93
94     /**
95      * @see NetworkManager::SelectNetwork()
96      */
97     result SelectNetwork(const NetworkInfo& networkInfo);
98
99     /**
100      * @see NetworkManager::SelectNetwork()
101      */
102     result SelectNetwork(void);
103
104     /**
105      * @see NetworkManager::SearchNetwork()
106      */
107     result SearchNetwork(void);
108
109
110     void OnTelephonyNetworkSelectionModeReceived(bool isManual, result r);
111
112     void OnTelephonyNetworkSelectionCompleted(result r);
113
114     void OnTelephonyNetworkSearchCompleted(Tizen::Base::String message, result r);
115
116     /**
117      * Checks the network state of the data network service.
118      */
119         bool IsDataAvailable(void) const;
120
121     /**
122      * Checks the data roaming is on or off.
123      */
124         bool IsRoaming(void) const;
125
126     /**
127      * Checks the network state of the telephony service.
128      */
129         static bool IsServiceAvailable(bool checkEmergency = false);
130
131         /**
132      * Checks the enabled state of flight mode.
133      */
134         static bool IsNetworkAvailable(void);
135
136         /**
137      * Gets the Impl instance.
138      *
139      * @since 2.1
140      * @return The pointer to _NetworkManagerImpl
141      * @param[in] networkManager   An instance of NetworkManager
142      */
143         static _NetworkManagerImpl* GetInstance(NetworkManager& networkManager);
144
145         /**
146      * Gets the Impl instance.
147      *
148      * @since 2.1
149      * @return The pointer to _NetworkManagerImpl
150      * @param[in] networkManager   An instance of NetworkManager
151      */
152         static const _NetworkManagerImpl* GetInstance(const NetworkManager& networkManager);
153
154
155 private:
156         /**
157      * This is the copy constructor for the %_NetworkManagerImpl class.
158      *
159      * @param[in]   rhs   An instance of %_NetworkManagerImpl
160      */
161         _NetworkManagerImpl(const _NetworkManagerImpl& rhs);
162
163         Tizen::Base::Collection::IList* ParsingMessageN(const Tizen::Base::String& message);
164
165         NetworkInfo* GenerateNetworkInfoN(const Tizen::Base::String& message, int& currentIndex);
166
167         Tizen::Base::String MessageToString(const Tizen::Base::String& message, int& currentIndex);
168
169         Tizen::Base::String MessageWithLengthToString(const Tizen::Base::String& message, int& currentIndex);
170
171         /**
172      * This is the assignment operator.
173      * Do @b not use directly.
174      *
175      * @param[in]   rhs An instance of %_NetworkManagerImpl
176      */
177         _NetworkManagerImpl& operator =(const _NetworkManagerImpl& rhs);
178
179 private:
180         std::unique_ptr<_NetworkManagerEvent> __pNetworkManagerEvent;
181         std::unique_ptr<_NetworkSettingEvent> __pNetworkSettingEvent;
182     _TelephonyIpcProxy* __pTelephonyServiceProxy;
183     ITelephonyNetworkSettingListener* __pSettingListener;
184
185         bool __isEventAdded;
186
187 }; // _NetworkManagerImpl
188
189 }} // Tizen::Telephony
190 #endif // _FTEL_INTERNAL_NETWORK_MANAGER_IMPL_H_