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 FTelNetworkStatus.h
19 * @brief This is the header file for the %NetworkStatus class.
21 * This header file contains the declarations of the %NetworkStatus class.
23 #ifndef _FTEL_NETWORK_STATUS_H_
24 #define _FTEL_NETWORK_STATUS_H_
28 namespace Tizen { namespace Telephony
30 class _NetworkStatusImpl;
33 * @class NetworkStatus`
34 * @brief This class provides status information of the current network.
38 * 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.
40 * The following example demonstrates how to use the %NetworkStatus class to get the network status information.
45 * #include <FTelephony.h>
47 * using namespace Tizen::Base;
48 * using namespace Tizen::Telephony;
52 * , public ITelephonyNetworkEventListener
58 * // ITelephonyNetworkEventListener
59 * void OnTelephonyNetworkStatusChanged(const NetworkStatus& networkStatus);
61 * void GetNetworkStatus (void);
64 * MyClass::OnTelephonyNetworkStatusChanged(const NetworkStatus& networkStatus)
70 * MyClass::GetNetworkStatus(void)
72 * NetworkStatus networkStatus;
74 * NetworkManager* pNetworkManager = new (std::nothrow) NetworkManager();
75 * result r = pNetworkManager->Construct(this);
78 * delete pNetworkManager;
82 * r = pNetworkManager->GetNetworkStatus(networkStatus);
85 * delete pNetworkManager;
89 * bool isCallAvailable = networkStatus.IsCallServiceAvailable();
90 * bool isDataAvailable = networkStatus.IsDataServiceAvailable();
91 * bool isRoaming = networkStatus.IsRoaming();
93 * delete pNetworkManager;
99 class _OSP_EXPORT_ NetworkStatus
100 : public Tizen::Base::Object
104 * This is the default constructor for this class.
111 * This destructor overrides Tizen::Base::Object::~Object().
115 virtual ~NetworkStatus(void);
118 * Checks whether the current network is in roaming status or not.
123 * @privilege %http://tizen.org/privilege/telephony @n
124 * (%http://tizen.org/privilege/systeminfo is deprecated.)
126 * @return @c true if the current network is in roaming status, @n
128 * @exception E_SUCCESS The method is successful.
129 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
130 * @remarks The specific error code can be accessed using the GetLastResult() method.
132 bool IsRoaming(void) const;
135 * Checks whether call service is available or not.
140 * @privilege %http://tizen.org/privilege/telephony @n
141 * (%http://tizen.org/privilege/systeminfo is deprecated.)
143 * @return @c true if call service is available, @n
145 * @exception E_SUCCESS The method is successful.
146 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
147 * @remarks The specific error code can be accessed using the GetLastResult() method.
149 bool IsCallServiceAvailable(void) const;
152 * Checks whether data service is available or not.
157 * @privilege %http://tizen.org/privilege/telephony @n
158 * (%http://tizen.org/privilege/systeminfo is deprecated.)
160 * @return @c true if data service is available, @n
162 * @exception E_SUCCESS The method is successful.
163 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
164 * @remarks The specific error code can be accessed using the GetLastResult() method.
166 bool IsDataServiceAvailable(void) const;
170 * The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.
172 * @param[in] rhs An instance of %NetworkStatus
174 NetworkStatus(const NetworkStatus& rhs);
177 * The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects.
179 * @param[in] rhs An instance of %NetworkStatus
181 NetworkStatus& operator =(const NetworkStatus& rhs);
184 _NetworkStatusImpl* __pNetworkStatusImpl;
186 friend class _NetworkStatusImpl;
189 }} // Tizen::Telephony
190 #endif // _FTEL_NETWORK_STATUS_H_