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.
18 * @file FCnt_ContentDownloadHandler.h
19 * @brief This is the header file for the %_ContentDownloadHandler class.
21 * This header file contains the declarations of the %_ContentDownloadHandler class.
24 #ifndef _FCNT_INTERNAL_CONTENT_DOWNLOAD_HANDLER_H_
25 #define _FCNT_INTERNAL_CONTENT_DOWNLOAD_HANDLER_H_
27 #include "FCnt_ContentDownloadListener.h"
29 namespace Tizen { namespace Net { namespace Http
31 class HttpTransaction;
33 namespace Tizen { namespace Net { namespace Http
37 namespace Tizen { namespace Net { namespace Http
42 namespace Tizen { namespace Content
45 class ContentTransferInfo;
46 class _ContentDownloadUserData;
47 class _ContentTransferEvent;
49 class _ContentDownloadHandler
50 : public Tizen::Base::Object
53 _ContentDownloadHandler(void);
54 virtual ~_ContentDownloadHandler(void);
55 result Construct(void);
57 result Cancel(RequestId requestId, _ContentDownloadUserData* pContentDownloadUserDataSequence);
58 RequestId HttpDownload(const Tizen::Base::String uri, int srcFileSize, const Tizen::Base::String destPath, _ContentDownloadUserData* pContentDownloadUserDataSequence);
59 result RequestDownload(Tizen::Base::String& srcUrl, const Tizen::Base::String destFilePath, int timeout, int percent, _ContentDownloadUserData* pUserData);
60 bool CheckSystem(const Tizen::Base::String& destPath, int srcFileSize);
62 void SetTimeout(int sec);
63 void SetProgressIntervalByPercent(int percent);
64 void SetDownloadPath(Tizen::Base::String destFilePath);
65 void SetSlot(int slot);
66 void SetRequestId(RequestId requestId);
69 _ContentDownloadHandler(const _ContentDownloadHandler& rhs);
70 _ContentDownloadHandler& operator =(const _ContentDownloadHandler& rhs);
73 RequestId __requestId;
74 RequestId __restRequestId;
78 Tizen::Base::String __destFilePath;
79 Tizen::Base::String __sourceFilePath;
80 std::unique_ptr<_ContentDownloadListener> __pListener;
81 std::unique_ptr<Tizen::Net::Http::HttpSession> __pSession;
82 std::unique_ptr<Tizen::Net::Http::HttpTransaction> __pTransaction;
83 }; // class _ContentDownloadHandler
87 #endif // _FCNT_INTERNAL_CONTENT_DOWNLOAD_HANDLER_H_