Changed SysLog -> SysSecureLog.
[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  *  #include <FBase.h>
45  *  #include <FTelephony.h>
46  *
47  *   using namespace Tizen::Base;
48  *   using namespace Tizen::Telephony;
49  *
50  *   class MyClass
51  *       : public Object
52  *       , public ITelephonyNetworkEventListener
53  *   {
54  *     public:
55  *       MyClass(void) {}
56  *       ~MyClass(void) {}
57  *
58  *       // ITelephonyNetworkEventListener
59  *       void OnTelephonyNetworkStatusChanged(const NetworkStatus& networkStatus);
60  *
61  *       void GetNetworkStatus (void);
62  *   };
63  *   void
64  *   MyClass::OnTelephonyNetworkStatusChanged(const NetworkStatus& networkStatus)
65  *   {
66  *      //Do something.
67  *   }
68  *
69  *   void
70  *   MyClass::GetNetworkStatus(void)
71  *   {
72  *       NetworkStatus networkStatus;
73  *
74  *       NetworkManager* pNetworkManager = new (std::nothrow) NetworkManager();
75  *       result r = pNetworkManager->Construct(this);
76  *       if (IsFailed(r))
77  *       {
78  *               delete pNetworkManager;
79  *               return;
80  *       }
81  *
82  *       r = pNetworkManager->GetNetworkStatus(networkStatus);
83  *       if (IsFailed(r))
84  *       {
85  *               delete pNetworkManager;
86  *               return;
87  *       }
88  *
89  *       bool isCallAvailable = networkStatus.IsCallServiceAvailable();
90  *       bool isDataAvailable = networkStatus.IsDataServiceAvailable();
91  *       bool isRoaming = networkStatus.IsRoaming();
92  *
93  *       delete pNetworkManager;
94  *       return;
95  *   }
96  *
97  * @endcode
98  */
99 class _OSP_EXPORT_ NetworkStatus
100         : public Tizen::Base::Object
101 {
102 public:
103         /**
104      * This is the default constructor for this class.
105      *
106      * @since   2.0
107      */
108         NetworkStatus(void);
109
110         /**
111      * This destructor overrides Tizen::Base::Object::~Object().
112      *
113      * @since   2.0
114      */
115         virtual ~NetworkStatus(void);
116
117         /**
118      * Checks whether the current network is in roaming status or not.
119      *
120      * @since   2.0
121          *
122          * @privlevel   public
123      * @privilege   %http://tizen.org/privilege/telephony @n
124      *                          (%http://tizen.org/privilege/systeminfo is deprecated.)
125      *
126      * @return  @c true if the current network is in roaming status, @n
127      *                  else @c false
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.
131      */
132         bool IsRoaming(void) const;
133
134     /**
135      * Checks whether call service is available or not.
136      *
137      * @since   2.0
138          *
139          * @privlevel   public
140      * @privilege   %http://tizen.org/privilege/telephony @n
141      *                          (%http://tizen.org/privilege/systeminfo is deprecated.)
142      *
143      * @return  @c true if call service is available, @n
144      *          else @c false
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.
148      */
149         bool IsCallServiceAvailable(void) const;
150
151         /**
152      * Checks whether data service is available or not.
153      *
154      * @since   2.0
155          *
156          * @privlevel   public
157      * @privilege   %http://tizen.org/privilege/telephony @n
158      *                          (%http://tizen.org/privilege/systeminfo is deprecated.)
159      *
160      * @return  @c true if data service is available, @n
161      *          else @c false
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.
165      */
166         bool IsDataServiceAvailable(void) const;
167
168 private:
169         /**
170      * The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.
171      *
172      * @param[in]       rhs     An instance of %NetworkStatus
173      */
174         NetworkStatus(const NetworkStatus& rhs);
175
176         /**
177      * The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects.
178      *
179      * @param[in]       rhs     An instance of %NetworkStatus
180      */
181         NetworkStatus& operator =(const NetworkStatus& rhs);
182
183 private:
184         _NetworkStatusImpl* __pNetworkStatusImpl;
185
186         friend class _NetworkStatusImpl;
187 }; // NetworkStatus
188
189 }} // Tizen::Telephony
190 #endif // _FTEL_NETWORK_STATUS_H_