2 // Open Service Platform
3 // Copyright (c) 2012 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 FWebCtrl_WebDataHandler.h
20 * @brief The file contains the declaration of _WebDataHandler class.
22 * The file contains the declaration of _WebDataHandler class.
24 #ifndef _FWEB_CTRL_INTERNAL_WEBDATA_HANDLER_H_
25 #define _FWEB_CTRL_INTERNAL_WEBDATA_HANDLER_H_
27 #include <unique_ptr.h>
28 #include <FBaseObject.h>
29 #include <FBaseString.h>
30 #include <FNetHttpHttpSession.h>
31 #include <FNetHttpHttpTransaction.h>
32 #include <FNetHttpIHttpTransactionEventListener.h>
35 namespace Tizen { namespace Web { namespace Controls
38 class IWebDownloadListener;
42 : public Tizen::Net::Http::IHttpTransactionEventListener
45 _WebDataHandler(void);
46 virtual ~_WebDataHandler(void);
48 //IHttpTransactionEventListener
49 virtual void OnTransactionReadyToRead(Tizen::Net::Http::HttpSession& httpSession, Tizen::Net::Http::HttpTransaction& httpTransaction, int availableBodyLen);
50 virtual void OnTransactionAborted(Tizen::Net::Http::HttpSession& httpSession, Tizen::Net::Http::HttpTransaction& httpTransaction, result r);
51 virtual void OnTransactionReadyToWrite(Tizen::Net::Http::HttpSession& httpSession, Tizen::Net::Http::HttpTransaction& httpTransaction, int recommendedChunkSize);
52 virtual void OnTransactionHeaderCompleted(Tizen::Net::Http::HttpSession& httpSession, Tizen::Net::Http::HttpTransaction& httpTransaction, int headerLen, bool bAuthRequired);
53 virtual void OnTransactionCertVerificationRequiredN(Tizen::Net::Http::HttpSession& httpSession, Tizen::Net::Http::HttpTransaction& httpTransaction, Tizen::Base::String* pCert);
54 virtual void OnTransactionCompleted(Tizen::Net::Http::HttpSession& httpSession, Tizen::Net::Http::HttpTransaction& httpTransaction);
56 Tizen::Web::Controls::_WebEvent* GetWebEvent(void) const;
57 void SetWebEvent(const Tizen::Web::Controls::_WebEvent* pWebEvent);
59 Tizen::Web::Controls::IWebDownloadListener* GetDownloadListener(void) const;
60 void SetDownloadListener(const Tizen::Web::Controls::IWebDownloadListener* pDownloadListener);
62 result StartDownload(const Tizen::Base::String& url);
65 Tizen::Web::Controls::IWebDownloadListener* __pDownloadListener;
66 Tizen::Web::Controls::_WebEvent* __pWebEvent;
67 std::unique_ptr<Tizen::Net::Http::HttpSession> __pHttpSession;
71 }}} //Tizen::Web::Controls
72 #endif // _FWEB_CTRL_INTERNAL_WEBDATA_HANDLER_H_