merge with master
[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          * @privlevel   public
99      * @privilege   http://tizen.org/privilege/telephony
100      *
101      * @return  @c true if the current network is in roaming status, @n
102      *                  else @c false
103      * @exception       E_SUCCESS       The method is successful.
104      * @exception       E_PRIVILEGE_DENIED      The application does not have the privilege to call this method.
105      * @remarks         The specific error code can be accessed using the GetLastResult() method.
106      */
107         bool IsRoaming(void) const;
108
109     /**
110      * Checks whether call service is available or not.
111      *
112      * @since   2.0
113          *
114          * @privlevel   public
115      * @privilege   http://tizen.org/privilege/telephony
116      *
117      * @return  @c true if call service is available, @n
118      *          else @c false
119      * @exception       E_SUCCESS       The method is successful.
120      * @exception       E_PRIVILEGE_DENIED      The application does not have the privilege to call this method.
121      * @remarks         The specific error code can be accessed using the GetLastResult() method.
122      */
123         bool IsCallServiceAvailable(void) const;
124
125         /**
126      * Checks whether data service is available or not.
127      *
128      * @since   2.0
129          *
130          * @privlevel   public
131      * @privilege   http://tizen.org/privilege/telephony
132      *
133      * @return  @c true if data service is available, @n
134      *          else @c false
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.
138      */
139         bool IsDataServiceAvailable(void) const;
140
141 private:
142         /**
143      * The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.
144      *
145      * @param[in]       rhs     An instance of %NetworkStatus
146      */
147         NetworkStatus(const NetworkStatus& rhs);
148
149         /**
150      * The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects.
151      *
152      * @param[in]       rhs     An instance of %NetworkStatus
153      */
154         NetworkStatus& operator =(const NetworkStatus& rhs);
155
156 private:
157         _NetworkStatusImpl* __pNetworkStatusImpl;
158
159         friend class _NetworkStatusImpl;
160 }; // NetworkStatus
161
162 }} // Tizen::Telephony
163 #endif // _FTEL_NETWORK_STATUS_H_