Tizen 2.1 base
[platform/framework/native/telephony.git] / inc / FTelNetworkStatus.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        FTelNetworkStatus.h
19  * @brief       This is the header file for the %NetworkStatus class.
20  *
21  * This header file contains the declarations of the %NetworkStatus class.
22  */
23 #ifndef _FTEL_NETWORK_STATUS_H_
24 #define _FTEL_NETWORK_STATUS_H_
25
26 #include <FBase.h>
27
28 namespace Tizen { namespace Telephony
29 {
30 class _NetworkStatusImpl;
31
32 /**
33  * @class       NetworkStatus`
34  * @brief       This class provides status information of the current network.
35  *
36  * @since       2.0
37  *
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.
39  *
40  * The following example demonstrates how to use the %NetworkStatus class to get the network status information.
41  *
42  * @code
43  *
44  *      result
45  *      MyClass::GetNetworkStatus(void)
46  *      {
47  *              NetworkStatus networkStatus;
48  *
49  *              NetworkManager* pNetworkManager = new NetworkManager();
50  *
51  *              result r = pNetworkManager->Construct(this);
52  *              if (IsFailed(r))
53  *              {
54  *                      delete pNetworkManager;
55  *                      return r;
56  *              }
57  *
58  *              r = pNetworkManager->GetNetworkStatus(networkStatus);
59  *              if (IsFailed(r))
60  *              {
61  *                      delete pNetworkManager;
62  *                      return r;
63  *              }
64  *
65  *              bool isCallAvail = networkStatus.IsCallServiceAvailable();
66  *              bool isDataAvail = networkStatus.IsDataServiceAvailable();
67  *              bool isRoaming = networkStatus.IsRoaming();
68  *
69  *              delete pNetworkManager;
70  *              return E_SUCCESS;
71  *      }
72  *
73  * @endcode
74  */
75 class _OSP_EXPORT_ NetworkStatus
76         : public Tizen::Base::Object
77 {
78 public:
79         /**
80      * This is the default constructor for this class.
81      *
82      * @since   2.0
83      */
84         NetworkStatus(void);
85
86         /**
87      * This destructor overrides Tizen::Base::Object::~Object().
88      *
89      * @since   2.0
90      */
91         virtual ~NetworkStatus(void);
92
93         /**
94      * Checks whether the current network is in roaming status or not.
95      *
96      * @since   2.0
97          *
98      * @privilege   %http://tizen.org/privilege/systeminfo
99      *
100      * @return  @c true if the current network is in roaming status, @n
101      *                  else @c false
102      * @exception       E_SUCCESS       The method is successful.
103      * @exception       E_PRIVILEGE_DENIED      The application does not have the privilege to call this method.
104      * @remarks         The specific error code can be accessed using the GetLastResult() method.
105      */
106         bool IsRoaming(void) const;
107
108     /**
109      * Checks whether call service is available or not.
110      *
111      * @since   2.0
112          *
113      * @privilege   %http://tizen.org/privilege/systeminfo
114      *
115      * @return  @c true if call service is available, @n
116      *          else @c false
117      * @exception       E_SUCCESS       The method is successful.
118      * @exception       E_PRIVILEGE_DENIED      The application does not have the privilege to call this method.
119      * @remarks         The specific error code can be accessed using the GetLastResult() method.
120      */
121         bool IsCallServiceAvailable(void) const;
122
123         /**
124      * Checks whether data service is available or not.
125      *
126      * @since   2.0
127          *
128      * @privilege   %http://tizen.org/privilege/systeminfo
129      *
130      * @return  @c true if data service is available, @n
131      *          else @c false
132      * @exception       E_SUCCESS       The method is successful.
133      * @exception       E_PRIVILEGE_DENIED      The application does not have the privilege to call this method.
134      * @remarks         The specific error code can be accessed using the GetLastResult() method.
135      */
136         bool IsDataServiceAvailable(void) const;
137
138 private:
139         /**
140      * The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.
141      *
142      * @param[in]       rhs     An instance of %NetworkStatus
143      */
144         NetworkStatus(const NetworkStatus& rhs);
145
146         /**
147      * The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects.
148      *
149      * @param[in]       rhs     An instance of %NetworkStatus
150      */
151         NetworkStatus& operator =(const NetworkStatus& rhs);
152
153 private:
154         _NetworkStatusImpl* __pNetworkStatusImpl;
155
156         friend class _NetworkStatusImpl;
157 }; // NetworkStatus
158
159 }} // Tizen::Telephony
160 #endif // _FTEL_NETWORK_STATUS_H_