Update doxygen.
[framework/osp/net.git] / inc / FNetNetStatistics.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 /**
19  * @file                FNetNetStatistics.h
20  * @brief               This is the header file for the %NetStatistics class.
21  *
22  * This header file contains the declarations of the %NetStatistics class.
23  */
24 #ifndef _FNET_NET_STATISTICS_H_
25 #define _FNET_NET_STATISTICS_H_
26
27 #include <FBaseObject.h>
28 #include <FBaseResult.h>
29 #include <FNetNetTypes.h>
30 #include <FNetNetAccountInfo.h>
31
32 namespace Tizen { namespace Net
33 {
34 class _NetStatisticsImpl;
35
36 /**
37  * @class       NetStatistics
38  * @brief       This class represents the statistical information of the data network.
39  *
40  * @since       2.0
41  *
42  * @remarks     The %NetStatistics class cannot be tested on the emulator.
43  *
44  * The %NetStatistics class provides methods for getting the statistical information of the data network.
45  *
46  * For more information on the class features, see <a href="../org.tizen.native.appprogramming/html/guide/net/network_statistics.htm">Network Statistics</a>.
47  */
48 class _OSP_EXPORT_ NetStatistics
49         : public Tizen::Base::Object
50 {
51 public:
52         /**
53          * The object is not fully constructed after this constructor is called. @n
54          * For full construction, the Construct() method must be called right after calling this constructor.
55          *
56          * @since               2.0
57          */
58         NetStatistics(void);
59
60         /**
61          * This destructor overrides Tizen::Base::Object::~Object().
62          *
63          * @since               2.0
64          */
65         virtual ~NetStatistics(void);
66
67         /**
68          * Initializes this instance of %NetStatistics.
69          *
70          * @since               2.0
71          *
72          * @return              An error code
73          * @exception   E_SUCCESS                       The method is successful.
74          * @exception   E_SYSTEM                        An internal error has occurred.
75          */
76         result Construct(void);
77
78 public:
79         /**
80          * Gets the statistical information. @n
81          * This can consist of details such as the call duration, the sent and received size, and so on.
82          *
83          * @since               2.0
84          *
85          * @privlevel   public
86          * @privilege   %http://tizen.org/privilege/network.statistics @n
87          *                              (%http://tizen.org/privilege/network.statistics.read is deprecated.)
88          * @feature             %http://tizen.org/feature/network.wifi for the @c NET_BEARER_WIFI value and @n
89          *                              %http://tizen.org/feature/network.telephony for the @c NET_BEARER_PS value of @c bearerType
90          *
91          * @return              The number of bytes sent or received, @n
92          *                              else @c INVALID_HANDLE if an error occurs
93          * @param[in]   bearerType                      The bearer type of the data call operation @n
94          *                                                                              @c NET_BEARER_WIFI_DIRECT and @c NET_BEARER_USB and @c NET_BEARER_MMS are not supported.
95          * @param[in]   netStatType                     The type of statistical information to get
96          * @exception   E_SUCCESS                       The method is successful.
97          * @exception   E_INVALID_ARG           A specified input parameter is invalid.
98          * @exception   E_PRIVILEGE_DENIED      The application does not have the privilege to call this method.
99          * @exception   E_UNSUPPORTED_OPERATION The target device does not support the required feature. @b Since: @b 2.1
100          *                                      For more information, see <a href="../org.tizen.gettingstarted/html/tizen_overview/application_filtering.htm">Application Filtering</a>.
101          * @remarks
102          *                              - The specific error code can be accessed using the GetLastResult() method.
103          *                              - Before calling this method, check whether the feature is supported by 
104          *                              Tizen::System::SystemInfo::GetValue(const Tizen::Base::String&, bool&).
105          */
106         long long GetNetStatisticsInfo(NetBearerType bearerType, NetStatisticsInfoType netStatType) const;
107
108         /**
109          * Resets the specified statistical information on the network according to the operation mode.
110          *
111          * @since               2.0
112          *
113          * @privlevel   platform
114          * @privilege   %http://tizen.org/privilege/netstatisticsmanager
115          * @feature             %http://tizen.org/feature/network.wifi for the @c NET_BEARER_WIFI value and @n
116          *                              %http://tizen.org/feature/network.telephony for the @c NET_BEARER_PS value of @c bearerType
117          *
118          * @return              An error code
119          * @param[in]   bearerType                      The bearer type (OperationMode) whose statistical information is reset @n 
120          *                                                              @c NET_BEARER_WIFI_DIRECT and @c NET_BEARER_USB and @c NET_BEARER_MMS are not supported.
121          * @param[in]   netStatType                     The type of statistical information to reset
122          * @exception   E_SUCCESS                       The method is successful.
123          * @exception   E_INVALID_ARG           A specified input parameter is invalid.
124          * @exception   E_SYSTEM                        An internal error has occurred.
125          * @exception   E_PRIVILEGE_DENIED      The application does not have the privilege to call this method.
126          * @exception   E_UNSUPPORTED_OPERATION The target device does not support the required feature. @b Since: @b 2.1
127          *                                      For more information, see <a href="../org.tizen.gettingstarted/html/tizen_overview/application_filtering.htm">Application Filtering</a>.
128          * @remarks
129          *                              - This method must use warning pop-up for user notification.
130          *                              - Before calling this method, check whether the feature is supported by 
131          *                              Tizen::System::SystemInfo::GetValue(const Tizen::Base::String&, bool&).
132          * @see                 GetNetStatisticsInfo()
133          */
134         result Reset(NetBearerType bearerType, NetStatisticsInfoType netStatType);
135
136         /**
137          * Resets all the specified statistical information on the network according to the operation mode.
138          *
139          * @since               2.0
140          *
141          * @privlevel   platform
142          * @privilege   %http://tizen.org/privilege/netstatisticsmanager
143          * @feature             %http://tizen.org/feature/network.wifi for the @c NET_BEARER_WIFI value and @n
144          *                              %http://tizen.org/feature/network.telephony for the @c NET_BEARER_PS value of @c bearerType
145          *
146          * @return              An error code
147          * @param[in]   bearerType                      The bearer type (OperationMode) whose statistical information would be reset @n 
148          *                                                              @c NET_BEARER_WIFI_DIRECT and @c NET_BEARER_USB and @c NET_BEARER_MMS are not supported.
149          * @exception   E_SUCCESS                       The method is successful.
150          * @exception   E_INVALID_ARG           The specified input parameter is invalid.
151          * @exception   E_SYSTEM                        An internal error has occurred.
152          * @exception   E_PRIVILEGE_DENIED      The application does not have the privilege to call this method.
153          * @exception   E_UNSUPPORTED_OPERATION The target device does not support the required feature. @b Since: @b 2.1
154          *                                      For more information, see <a href="../org.tizen.gettingstarted/html/tizen_overview/application_filtering.htm">Application Filtering</a>.
155          * @remarks
156          *                              - This method must use warning pop-up for user notification.
157          *                              - Before calling this method, check whether the feature is supported by 
158          *                              Tizen::System::SystemInfo::GetValue(const Tizen::Base::String&, bool&).
159          * @see                 GetNetStatisticsInfo()
160          */
161         result ResetAll(NetBearerType bearerType);
162
163 private:
164         /*
165          * The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.
166          *
167          * @param[in]   rhs                     An instance of %NetStatistics
168          */
169         NetStatistics(const NetStatistics& rhs);
170
171         /*
172          * The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects.
173          *
174          * @param[in]   rhs                     An instance of %NetStatistics
175          */
176         NetStatistics& operator =(const NetStatistics& rhs);
177
178 private:
179         _NetStatisticsImpl* __pNetStatisticsImpl;
180
181         friend class _NetStatisticsImpl;
182 }; // NetStatistics
183
184 } } //Tizen::Net
185 #endif // _FNET_NET_STATISTICS_H_