2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
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
9 // http://www.apache.org/licenses/LICENSE-2.0
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.
19 * @file FNetNetStatistics.h
20 * @brief This is the header file for the %NetStatistics class.
22 * This header file contains the declarations of the %NetStatistics class.
24 #ifndef _FNET_NET_STATISTICS_H_
25 #define _FNET_NET_STATISTICS_H_
27 #include <FBaseObject.h>
28 #include <FBaseResult.h>
29 #include <FNetNetTypes.h>
30 #include <FNetNetAccountInfo.h>
32 namespace Tizen { namespace Net
34 class _NetStatisticsImpl;
37 * @class NetStatistics
38 * @brief This class represents the statistical information of the data network.
42 * @remarks The %NetStatistics class cannot be tested on the emulator.
44 * The %NetStatistics class provides methods for getting the statistical information of the data network.
46 * For more information on the class features, see <a href="../org.tizen.native.appprogramming/html/guide/net/network_statistics.htm">Network Statistics</a>.
48 class _OSP_EXPORT_ NetStatistics
49 : public Tizen::Base::Object
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.
61 * This destructor overrides Tizen::Base::Object::~Object().
65 virtual ~NetStatistics(void);
68 * Initializes this instance of %NetStatistics.
72 * @return An error code
73 * @exception E_SUCCESS The method is successful.
74 * @exception E_SYSTEM An internal error has occurred.
76 result Construct(void);
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.
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
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>.
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&).
106 long long GetNetStatisticsInfo(NetBearerType bearerType, NetStatisticsInfoType netStatType) const;
109 * Resets the specified statistical information on the network according to the operation mode.
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
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>.
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()
134 result Reset(NetBearerType bearerType, NetStatisticsInfoType netStatType);
137 * Resets all the specified statistical information on the network according to the operation mode.
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
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>.
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()
161 result ResetAll(NetBearerType bearerType);
165 * The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.
167 * @param[in] rhs An instance of %NetStatistics
169 NetStatistics(const NetStatistics& rhs);
172 * The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects.
174 * @param[in] rhs An instance of %NetStatistics
176 NetStatistics& operator =(const NetStatistics& rhs);
179 _NetStatisticsImpl* __pNetStatisticsImpl;
181 friend class _NetStatisticsImpl;
185 #endif // _FNET_NET_STATISTICS_H_