merge with master
[framework/osp/net.git] / src / http / FNetHttp_HttpTransactionEventArg.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                FNetHttp_HttpTransactionEventArg.h
20  * @brief               This is the header file for %_HttpTransactionEventArg class.
21  */
22
23 #ifndef _FNET_HTTP_INTERNAL_HTTP_TRANSACTION_EVENT_ARG_H_
24 #define _FNET_HTTP_INTERNAL_HTTP_TRANSACTION_EVENT_ARG_H_
25
26 #include <FBaseRtIEventArg.h>
27 #include "FNetHttp_HttpCommon.h"
28
29 namespace Tizen { namespace Base
30 {
31 class String;
32 } }
33
34 namespace Tizen { namespace Base { namespace Collection
35 {
36 class IList;
37 } } }
38
39 namespace Tizen { namespace Net { namespace Http
40 {
41 /**
42  * @class       _HttpTransactionEventArg FNetHttp_HttpTransactionEventArg.h "OspdOaf/FNet/H/FNetHttp_HttpTransactionEventArg.h"
43  * @brief       This class is used as an argument on firing a Transaction Event.
44  *
45  * @since 2.1
46  *
47  * _HttpTransactionEventArg::FireImpl() receives an argument of this type, when any %Http Transaction event is generated.
48  */
49
50 class _HttpTransactionEventArg
51         : public Tizen::Base::Object
52         , public Tizen::Base::Runtime::IEventArg
53 {
54
55 public:
56         _HttpTransactionEventArg(int transactionId, _HttpTransactionEventType eventType);
57
58         ~_HttpTransactionEventArg(void);
59
60         int GetTransactionId(void) const;
61
62         _HttpTransactionEventType GetEventType(void);
63
64         void SetError(result error);
65
66         result GetError(void) const;
67
68         void SetReadHeaderLength(int readHeaderLength);
69
70         int GetReadHeaderLength(void) const;
71
72         void SetAuthType(long httpAuth);
73
74         long GetAuthType(void) const;
75
76         void SetProxyAuth(bool isProxyAuth);
77
78         bool IsProxyAuth(void) const;
79
80         void SetReadBodyLength(int readBodyLength);
81
82         int GetReadBodyLength(void) const;
83
84         void SetRecommendedSize(int recommendedSize);
85
86         int GetRecommendedSize(void) const;
87
88         void SetUploadProgress(long long currentSize, long long totalSize);
89
90         long long GetCurrentUploadProgress(void) const;
91
92         long long GetTotalUploadProgress(void) const;
93
94         void SetDownloadProgress(long long currentSize, long long totalSize);
95
96         long long GetCurrentDownloadProgress(void) const;
97
98         long long GetTotalDownloadProgress(void) const;
99
100         void SetServerCert(Tizen::Base::String* pServerCert);
101
102         Tizen::Base::String* GetServerCert(void) const;
103
104         void SetServerCertList(Tizen::Base::Collection::IList* pServerCertList);
105
106         Tizen::Base::Collection::IList* GetServerCertList(void) const;
107
108
109 private:
110         _HttpTransactionEventArg(const _HttpTransactionEventArg& rhs);
111
112         _HttpTransactionEventArg& operator =(const _HttpTransactionEventArg& rhs);
113
114 private:
115         int __transactionId;
116         _HttpTransactionEventType __eventType;
117         result __result;
118         int __readHeaderLength;
119         long __httpAuth;
120         bool __isProxyAuth;
121         int __readBodyLength;
122         int __recommendedSize;
123         long long __uploadCurrentProgress;
124         long long __uploadTotalProgress;
125         long long __downloadCurrentProgress;
126         long long __downloadTotalProgress;
127         Tizen::Base::String* __pServerCert;
128         Tizen::Base::Collection::IList* __pServerCertList;
129
130 }; // _HttpTransactionEventArg
131
132 } } } // Tizen::Net::Http
133 #endif // _FNET_HTTP_INTERNAL_HTTP_TRANSACTION_EVENT_ARG_H_