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 FNetHttp_HttpTransactionEvent.h
20 * @brief This is the header file for %_HttpTransactionEvent class.
22 * This header file contains the declarations of _HttpTransactionEvent class.
23 * The _HttpTransactionEvent class can call listener's method. So, when an event is occurred,
24 * application can handle it appropriately.
27 #ifndef _FNET_HTTP_INTERNAL_HTTP_TRANSACTION_EVENT_H_
28 #define _FNET_HTTP_INTERNAL_HTTP_TRANSACTION_EVENT_H_
30 #include <FNetHttpHttpTypes.h>
31 #include <FNetHttpIHttpProgressEventListener.h>
32 #include <FBaseRt_Event.h>
33 #include "FNetHttp_HttpCommon.h"
35 namespace Tizen { namespace Net { namespace Http
37 class _HttpSessionImpl;
38 class _HttpTransactionImpl;
40 * @class _HttpTransactionEvent
41 * @brief This class handles an Http Transaction event. It is inherited from Event class.
45 * When an Http Transaction event is occurred, the __HttpTransactionEvent class finds listener and calls
46 * the appropriate listener's method. @n
49 class _HttpTransactionEvent
50 : public Tizen::Base::Runtime::_Event
54 _HttpTransactionEvent(void);
56 ~_HttpTransactionEvent(void);
58 result Construct(_HttpSessionImpl* pHttpSessionImpl, _HttpTransactionImpl* pHttpTransactionImpl);
60 result SetHttpProgressListener(const IHttpProgressEventListener* pListener);
62 bool GetCertRequestedResult(void) const;
64 _HttpSessionImpl* GetHttpSessionImpl(void) const;
66 result FireTransactionReadyToReadEvent(int readBodyLength, bool async = false);
68 result FireTransactionReadyToWriteEvent(int recommenedLength, bool async = false);
70 result FireTransactionHeaderCompletedEvent(int headerLength, long proxyAuth, long httpAuth, bool async = false);
72 result FireTransactionCertVerificationRequiredNEvent(Tizen::Base::String* pServerCert, bool async = false);
74 result FireTransactionCertVerificationRequestedNEvent(Tizen::Base::Collection::IList* pServerCertList, bool async = false);
76 result FireTransactionCompletedEvent(bool async = false);
78 result FireTransactionAbortedEvent(result error, bool async = false);
80 result FireHttpUploadInProgressEvent(int currentLength, int totalLength, bool async = false);
82 result FireHttpDownloadInProgressEvent(int currentLength, int totalLength, bool async = false);
85 virtual void FireImpl(Tizen::Base::Runtime::IEventListener& listener, const Tizen::Base::Runtime::IEventArg& arg);
88 _HttpTransactionEvent(const _HttpTransactionEvent& rhs);
90 _HttpTransactionEvent& operator =(const _HttpTransactionEvent& rhs);
93 _HttpSessionImpl* __pHttpSessionImpl;
94 _HttpTransactionImpl* __pHttpTransactionImpl;
95 IHttpProgressEventListener* __pHttpProgressListener;
97 bool __isCertRequestedResult;
99 }; // _HttpTransactionEvent
101 } } } // Tizen::Net::Http
102 #endif // _FNET_HTTP_INTERNAL_HTTP_TRANSACTION_EVENT_H_