Modified doxygen sample code.
[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
124      *
125      * @return  @c true if the current network is in roaming status, @n
126      *                  else @c false
127      * @exception       E_SUCCESS       The method is successful.
128      * @exception       E_PRIVILEGE_DENIED      The application does not have the privilege to call this method.
129      * @remarks         The specific error code can be accessed using the GetLastResult() method.
130      */
131         bool IsRoaming(void) const;
132
133     /**
134      * Checks whether call service is available or not.
135      *
136      * @since   2.0
137          *
138          * @privlevel   public
139      * @privilege   %http://tizen.org/privilege/telephony
140      *
141      * @return  @c true if call service is available, @n
142      *          else @c false
143      * @exception       E_SUCCESS       The method is successful.
144      * @exception       E_PRIVILEGE_DENIED      The application does not have the privilege to call this method.
145      * @remarks         The specific error code can be accessed using the GetLastResult() method.
146      */
147         bool IsCallServiceAvailable(void) const;
148
149         /**
150      * Checks whether data service is available or not.
151      *
152      * @since   2.0
153          *
154          * @privlevel   public
155      * @privilege   %http://tizen.org/privilege/telephony
156      *
157      * @return  @c true if data service is available, @n
158      *          else @c false
159      * @exception       E_SUCCESS       The method is successful.
160      * @exception       E_PRIVILEGE_DENIED      The application does not have the privilege to call this method.
161      * @remarks         The specific error code can be accessed using the GetLastResult() method.
162      */
163         bool IsDataServiceAvailable(void) const;
164
165 private:
166         /**
167      * The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.
168      *
169      * @param[in]       rhs     An instance of %NetworkStatus
170      */
171         NetworkStatus(const NetworkStatus& rhs);
172
173         /**
174      * The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects.
175      *
176      * @param[in]       rhs     An instance of %NetworkStatus
177      */
178         NetworkStatus& operator =(const NetworkStatus& rhs);
179
180 private:
181         _NetworkStatusImpl* __pNetworkStatusImpl;
182
183         friend class _NetworkStatusImpl;
184 }; // NetworkStatus
185
186 }} // Tizen::Telephony
187 #endif // _FTEL_NETWORK_STATUS_H_