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 FTelNetworkInfo.h
19 * @brief This is the header file for the %NetworkInfo class.
21 * This header file contains the declarations of the %NetworkInfo class.
23 #ifndef _FTEL_NETWORK_INFO_H_
24 #define _FTEL_NETWORK_INFO_H_
30 namespace Tizen { namespace Telephony
32 class _NetworkInfoImpl;
36 * @brief This class provides information of the current network.
40 * The %NetworkInfo class provides methods to get information of the current network such as MNC, MCC, PLMN, cell ID, and operator name.
42 * The following example demonstrates how to use the %NetworkInfo class to get the network information.
47 * MyClass::GetNetworkInfo(void)
49 * result r = E_SUCCESS;
55 * String operatorName;
57 * NetworkInfo networkInfo;
59 * NetworkManager* pNetworkManager = new NetworkManager();
61 * r = pNetworkManager->Construct(null);
64 * delete pNetworkManager;
68 * r = pNetworkManager->GetNetworkInfo(networkInfo);
71 * delete pNetworkManager;
75 * mnc = networkInfo.GetMnc();
76 * mcc = networkInfo.GetMcc();
77 * cellId = networkInfo.GetCellId();
78 * lac = networkInfo.GetLac();
79 * plmn = networkInfo.GetPlmn();
80 * operatorName = networkInfo.GetOperatorName();
82 * delete pNetworkManager;
88 class _OSP_EXPORT_ NetworkInfo
89 : public Tizen::Base::Object
93 * This is the default constructor for this class.
100 * Copying of objects using this copy constructor is allowed.
104 * @param[in] rhs An instance of %NetworkInfo
106 NetworkInfo(const NetworkInfo& rhs);
109 * This destructor overrides Tizen::Base::Object::~Object().
113 virtual ~NetworkInfo(void);
116 * Gets the Mobile Network Code (MNC) of the network.
119 * @privilege %http://tizen.org/privilege/systeminfo
121 * @return The MNC of the network
122 * @exception E_SUCCESS The method is successful.
123 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
124 * @remarks The specific error code can be accessed using the GetLastResult() method.
126 int GetMnc(void) const;
129 * Gets the Mobile Country Code (MCC) of the network.
132 * @privilege %http://tizen.org/privilege/systeminfo
134 * @return The MCC of the network
135 * @exception E_SUCCESS The method is successful.
136 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
137 * @remarks The specific error code can be accessed using the GetLastResult() method.
139 int GetMcc(void) const;
142 * Gets the Public Land Mobile Network (PLMN).
145 * @brief <i> [Compatibility] </i>
149 * @compatibility This method has compatibility issues with OSP compatible applications. @n
150 * For more information, see the issue description for @ref CompNetworkInfoGetPlmnPage "here".
152 * @privilege %http://tizen.org/privilege/systeminfo
154 * @return The PLMN name
155 * @exception E_SUCCESS The method is successful.
156 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
157 * @remarks The specific error code can be accessed using the GetLastResult() method.
159 Tizen::Base::String GetPlmn(void) const;
163 * @page CompNetworkInfoGetPlmnPage Compatibility for GetPlmn()
164 * @section CompNetworkInfoGetPlmnPageIssueSection Issues
165 * Implementing this method in OSP compatible applications has the following issues: @n
166 * -# The method returns an alphabetic name of PLMN.
168 * @section CompNetworkInfoGetPlmnPageSolutionSection Resolutions
169 * -# The method returns a numeric name of PLMN-ID(MCC+MNC).
170 * To get the alphabetic name of PLMN, it is recommended to use Tizen::Telephony::GetOperatorName().
174 * Gets the current cell ID.
177 * @privilege %http://tizen.org/privilege/systeminfo
179 * @return The current cell ID
180 * @exception E_SUCCESS The method is successful.
181 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
182 * @remarks This cell ID is provided using only NetworkManager::GetNetworkInfo() when connected to a network.
183 * @remarks The specific error code can be accessed using the GetLastResult() method.
185 int GetCellId(void) const;
188 * Gets the current Location Area Code (LAC).
191 * @privilege %http://tizen.org/privilege/systeminfo
193 * @return The current LAC
194 * @exception E_SUCCESS The method is successful.
195 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
196 * @remarks This LAC is provided using only NetworkManager::GetNetworkInfo() when connected to a network.
197 * @remarks The specific error code can be accessed using the GetLastResult() method.
199 int GetLac(void) const;
202 * Gets the operator name.
205 * @privilege %http://tizen.org/privilege/systeminfo
207 * @return The operator name
208 * @exception E_SUCCESS The method is successful.
209 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
210 * @remarks The specific error code can be accessed using the GetLastResult() method.
212 Tizen::Base::String GetOperatorName(void) const;
215 * Checks whether the specified instance of %NetworkInfo equals the current instance.
219 * @return @c true if the specified instance equals the current instance, @n
221 * @param[in] rhs An instance of %NetworkInfo
222 * @remarks The method returns @c false if the specified object is not %NetworkInfo.
224 virtual bool Equals(const Tizen::Base::Object& rhs) const;
227 * Gets the hash value of the current instance.
231 * @return The hash value of the current instance
233 virtual int GetHashCode(void) const;
236 * Gets the received signal strength indication of a modem device.
239 * @privilege %http://tizen.org/privilege/systeminfo
241 * @return The current RSSI @n
242 * The possible RSSI value ranges from @c 0 to @c 100.
243 * @exception E_SUCCESS The method is successful.
244 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
245 * @exception E_SYSTEM A system error has occurred.
246 * @remarks The specific error code can be accessed using the GetLastResult() method.
248 static int GetRssi(void);
251 * Copying of objects using this copy assignment operator is allowed.
255 * @return The reference of this instance
256 * @param[in] rhs An instance of %NetworkInfo
258 NetworkInfo& operator=(const NetworkInfo& rhs);
261 _NetworkInfoImpl* __pNetworkInfoImpl;
263 friend class _NetworkInfoImpl;
266 }} //Tizen::Telephony
267 #endif // _FTEL_NETWORK_INFO_H_