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 on the Packet-Switched (PS) data call.
42 * @remarks The %NetStatistics class cannot be tested on the emulator.
44 * The %NetStatistics class provides methods for getting the statistical information on the Packet-Switched (PS) data call.
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. For full construction, the Construct() method must be called right after calling this constructor.
57 * @remarks After creating an instance of this class, the Construct() method must be called explicitly to initialize this instance.
62 * This destructor overrides Tizen::Base::Object::~Object().
66 virtual ~NetStatistics(void);
69 * Initializes this instance of %NetStatistics.
73 * @return An error code
74 * @exception E_SUCCESS The method is successful.
75 * @exception E_SYSTEM An internal error has occurred.
77 result Construct(void);
81 * Gets the statistical information. @n
82 * This can consist of details such as the call duration, the sent and received size, and so on.
87 * @privilege http://tizen.org/privilege/network.statistics
89 * @return The number of bytes sent or received, @n
90 * else @c INVALID_HANDLE if an error occurs
91 * @param[in] bearerType The bearer type of the data call operation @n
92 * NET_BEARER_WIFI_DIRECT and NET_BEARER_USB are not supported.
93 * @param[in] netStatType The type of statistical information to get
94 * @exception E_SUCCESS The method is successful.
95 * @exception E_INVALID_ARG A specified input parameter is invalid.
96 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
97 * @remarks The specific error code can be accessed using the GetLastResult() method.
99 long long GetNetStatisticsInfo(NetBearerType bearerType, NetStatisticsInfoType netStatType) const;
102 * Resets the specified statistical information on the network according to the operation mode.
106 * @privlevel platform
107 * @privilege http://tizen.org/privilege/netstatisticsmanager
109 * @return An error code
110 * @param[in] bearerType The bearer type (OperationMode) whose statistical information is reset @n NET_BEARER_WIFI_DIRECT and NET_BEARER_USB are not supported.
111 * @param[in] netStatType The type of statistical information to reset
112 * @exception E_SUCCESS The method is successful.
113 * @exception E_INVALID_ARG A specified input parameter is invalid.
114 * @exception E_SYSTEM An internal error has occurred.
115 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
116 * @remarks This method must use warning pop-up for user notification.
117 * @see GetNetStatisticsInfo()
119 result Reset(NetBearerType bearerType, NetStatisticsInfoType netStatType);
122 * Resets all the specified statistical information on the network according to the operation mode.
126 * @privlevel platform
127 * @privilege http://tizen.org/privilege/netstatisticsmanager
129 * @return An error code
130 * @param[in] bearerType The bearer type (OperationMode) whose statistical information would be reset @n NET_BEARER_WIFI_DIRECT and NET_BEARER_USB are not supported.
131 * @exception E_SUCCESS The method is successful.
132 * @exception E_INVALID_ARG The specified input parameter is invalid.
133 * @exception E_SYSTEM An internal error has occurred.
134 * @exception E_PRIVILEGE_DENIED The application does not have the privilege to call this method.
136 * @remarks This method must use warning pop-up for user notification.
137 * @see GetNetStatisticsInfo()
139 result ResetAll(NetBearerType bearerType);
143 * The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.
145 * @param[in] rhs An instance of %NetStatistics
147 NetStatistics(const NetStatistics& rhs);
150 * The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects.
152 * @param[in] rhs An instance of %NetStatistics
154 NetStatistics& operator =(const NetStatistics& rhs);
157 _NetStatisticsImpl* __pNetStatisticsImpl;
159 friend class _NetStatisticsImpl;
163 #endif // _FNET_NET_STATISTICS_H_