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 the status information of the current network.
38 * The %NetworkStatus class provides methods to obtain the status information of the current network, such as the roaming status, whether the call service is available or not,
39 * and whether the data service is available or not.
41 * The following example demonstrates how to use the %NetworkStatus class to obtain the network status information.
46 * #include <FTelephony.h>
48 * using namespace Tizen::Base;
49 * using namespace Tizen::Telephony;
53 * , public ITelephonyNetworkEventListener
59 * // ITelephonyNetworkEventListener
60 * void OnTelephonyNetworkStatusChanged(const NetworkStatus& networkStatus);
62 * void GetNetworkStatus (void);
65 * MyClass::OnTelephonyNetworkStatusChanged(const NetworkStatus& networkStatus)
71 * MyClass::GetNetworkStatus(void)
73 * NetworkStatus networkStatus;
75 * NetworkManager* pNetworkManager = new (std::nothrow) NetworkManager();
76 * result r = pNetworkManager->Construct(this);
79 * delete pNetworkManager;
83 * r = pNetworkManager->GetNetworkStatus(networkStatus);
86 * delete pNetworkManager;
90 * bool isCallAvailable = networkStatus.IsCallServiceAvailable();
91 * bool isDataAvailable = networkStatus.IsDataServiceAvailable();
92 * bool isRoaming = networkStatus.IsRoaming();
94 * delete pNetworkManager;
100 class _OSP_EXPORT_ NetworkStatus
101 : public Tizen::Base::Object
105 * This is the default constructor for this class.
112 * This destructor overrides Tizen::Base::Object::~Object().
116 virtual ~NetworkStatus(void);
119 * Checks whether the current network is in the roaming status or not.
124 * @privilege %http://tizen.org/privilege/telephony @n
125 * (%http://tizen.org/privilege/systeminfo is deprecated.)
127 * @return @c true if the current network is in the roaming status, @n
129 * @exception E_SUCCESS The method is successful.
130 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
131 * @remarks The specific error code can be accessed using the GetLastResult() method.
133 bool IsRoaming(void) const;
136 * Checks whether the call service is available or not.
141 * @privilege %http://tizen.org/privilege/telephony @n
142 * (%http://tizen.org/privilege/systeminfo is deprecated.)
144 * @return @c true if the call service is available, @n
146 * @exception E_SUCCESS The method is successful.
147 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
148 * @remarks The specific error code can be accessed using the GetLastResult() method.
150 bool IsCallServiceAvailable(void) const;
153 * Checks whether the data service is available or not.
158 * @privilege %http://tizen.org/privilege/telephony @n
159 * (%http://tizen.org/privilege/systeminfo is deprecated.)
161 * @return @c true if the data service is available, @n
163 * @exception E_SUCCESS The method is successful.
164 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
165 * @remarks The specific error code can be accessed using the GetLastResult() method.
167 bool IsDataServiceAvailable(void) const;
171 * The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.
173 * @param[in] rhs An instance of %NetworkStatus
175 NetworkStatus(const NetworkStatus& rhs);
178 * The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects.
180 * @param[in] rhs An instance of %NetworkStatus
182 NetworkStatus& operator =(const NetworkStatus& rhs);
185 _NetworkStatusImpl* __pNetworkStatusImpl;
187 friend class _NetworkStatusImpl;
190 }} // Tizen::Telephony
191 #endif // _FTEL_NETWORK_STATUS_H_