2 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
4 // Licensed under the Apache License, Version 2.0 (the License);
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
8 // http://www.apache.org/licenses/LICENSE-2.0
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
17 * @file FCnt_ContentDownloadHandler.h
18 * @brief This is the header file for the %_ContentDownloadHandler class.
20 * This header file contains the declarations of the %_ContentDownloadHandler class.
23 #ifndef _FCNT_INTERNAL_CONTENT_DOWNLOAD_HANDLER_H_
24 #define _FCNT_INTERNAL_CONTENT_DOWNLOAD_HANDLER_H_
26 #include "FCnt_ContentDownloadListener.h"
28 namespace Tizen { namespace Net { namespace Http
30 class HttpTransaction;
32 namespace Tizen { namespace Net { namespace Http
36 namespace Tizen { namespace Net { namespace Http
41 namespace Tizen { namespace Content
44 class ContentTransferInfo;
45 class _ContentDownloadUserData;
46 class _ContentTransferEvent;
48 class _ContentDownloadHandler
49 : public Tizen::Base::Object
52 _ContentDownloadHandler(void);
53 virtual ~_ContentDownloadHandler(void);
54 result Construct(void);
56 result Cancel(RequestId requestId, _ContentDownloadUserData* pContentDownloadUserDataSequence);
57 RequestId HttpDownload(const Tizen::Base::String uri, int srcFileSize, const Tizen::Base::String destPath, _ContentDownloadUserData* pContentDownloadUserDataSequence);
58 result RequestDownload(Tizen::Base::String& srcUrl, const Tizen::Base::String destFilePath, int timeout, int percent, _ContentDownloadUserData* pUserData);
59 bool CheckSystem(const Tizen::Base::String& destPath, int srcFileSize);
61 void SetTimeout(int sec);
62 void SetProgressIntervalByPercent(int percent);
63 void SetDownloadPath(Tizen::Base::String destFilePath);
64 void SetSlot(int slot);
65 void SetRequestId(RequestId requestId);
68 _ContentDownloadHandler(const _ContentDownloadHandler& rhs);
69 _ContentDownloadHandler& operator =(const _ContentDownloadHandler& rhs);
72 RequestId __requestId;
73 RequestId __restRequestId;
77 Tizen::Base::String __destFilePath;
78 Tizen::Base::String __sourceFilePath;
79 std::unique_ptr<_ContentDownloadListener> __pListener;
80 std::unique_ptr<Tizen::Net::Http::HttpSession> __pSession;
81 std::unique_ptr<Tizen::Net::Http::HttpTransaction> __pTransaction;
82 }; // class _ContentDownloadHandler
86 #endif // _FCNT_INTERNAL_CONTENT_DOWNLOAD_HANDLER_H_