Fix : The original content is restored again if CreateContent API fail
[platform/framework/native/content.git] / src / FCnt_ContentDownloadUserData.h
1 //
2 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
3 //
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
7 //
8 //     http://www.apache.org/licenses/LICENSE-2.0
9 //
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.
15 //
16 /**
17  * @file                FCnt_ContentDownloadUserData.h
18  * @brief               This is the header file for the %_ContentDownloadUserData class.
19  *
20  * This header file contains the declarations of the %_ContentDownloadUserData class.
21  */
22
23 #ifndef _FCNT_INTERNAL_CONTENT_DOWNLOAD_USERDATA_H_
24 #define _FCNT_INTERNAL_CONTENT_DOWNLOAD_USERDATA_H_
25
26 #include <FCntContentTransferInfo.h>
27 #include <FIo_FileImpl.h>
28 #include "FCnt_ContentTransferEvent.h"
29
30 namespace Tizen { namespace Content
31 {
32
33 class _ContentDownloadUserData
34         : public Tizen::Base::Object
35 {
36 public:
37         _ContentDownloadUserData(void);
38         virtual ~_ContentDownloadUserData(void);
39
40         _ContentDownloadUserData(const _ContentDownloadUserData& userData);
41         _ContentDownloadUserData& operator =(const _ContentDownloadUserData& userData);
42
43         RequestId GetRequestId(void) const;
44         ContentId GetContentId(void) const;
45         Tizen::Base::String GetUrl(void) const;
46         Tizen::Base::String GetDestPath(void) const;
47         bool GetDownloadBufferFlag(void) const;
48         bool GetSlotFlag(void) const;
49         int GetSlot(void) const;
50         int GetDownloadCount(void) const;
51         int GetPercent(void) const;
52         _ContentTransferEvent* GetContentTransferEvent(void) const;
53         ContentTransferInfo* GetContentTransferInfo(void) const;
54         bool GetCheckDownloading(int slot) const;
55         long long GetTotalSize(void) const;
56         long long GetPrevData(void) const;
57
58         void SetRequestId(RequestId reqId);
59         void SetContentId(const ContentId& contentId);
60         void SetUrl(Tizen::Base::String& url);
61         void SetDestPath(Tizen::Base::String& destPath);
62         void SetDownloadBufferFlag(bool isBuffer);
63         void SetSlotFlag(bool slotFlag);
64         void SetSlot(int slot);
65         void SetDownloadCount(int downloadCount);
66         void SetMaxCount(int maxDownloadCount);
67         void SetPercent(int percent);
68         void SetContentTransferEvent(_ContentTransferEvent* transferEvent);
69         void SetContentTransferInfo(ContentTransferInfo* transferInfo);
70         void SetCheckDownloading(int slot, bool check);
71         void SetTotalSize(long long totalSize);
72         void SetPrevData(long long data);
73
74 private:
75         RequestId __reqId;
76         ContentId __contentId;
77         int __slot;
78         int __downloadCount;
79         int __maxDownloadCount;
80         int __percent;
81         long long __totalSize;
82         long long __prevDownloadData;
83         bool __isBuffer;
84         bool __slotFlag;
85         std::unique_ptr<bool[]> __pCheckDownloading;
86         _ContentTransferEvent* __pContentTransferEvent;
87         ContentTransferInfo* __pContentTransferInfo;
88         Tizen::Base::String __url;
89         Tizen::Base::String __destPath;
90 };  // _ContentDownloadUserData
91
92 }}  // Tizen::Content
93
94 #endif  // _FCNT_INTERNAL_CONTENT_DOWNLOAD_USERDATA_H_