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_ContentDownloadUserData.cpp
18 * @brief This is the implementation file for the %_ContentDownloadUserData class.
20 * This file contains implementation of the %_ContentDownloadUserData class.
23 #include <FBaseSysLog.h>
24 #include <FCntTypes.h>
25 #include "FCnt_ContentDownloadUserData.h"
27 using namespace Tizen;
28 using namespace Tizen::Base;
30 namespace Tizen { namespace Content
33 _ContentDownloadUserData::_ContentDownloadUserData(void)
34 : __reqId(INVALID_REQUEST_ID)
35 , __contentId(UuId::GetInvalidUuId())
38 , __maxDownloadCount(-1)
41 , __prevDownloadData(0)
44 , __pCheckDownloading(null)
45 , __pContentTransferEvent(null)
46 , __pContentTransferInfo(null)
52 _ContentDownloadUserData::~_ContentDownloadUserData(void)
58 _ContentDownloadUserData::GetRequestId(void) const
64 _ContentDownloadUserData::GetContentId(void) const
70 _ContentDownloadUserData::GetUrl(void) const
76 _ContentDownloadUserData::GetDestPath(void) const
82 _ContentDownloadUserData::GetDownloadBufferFlag(void) const
88 _ContentDownloadUserData::GetSlotFlag(void) const
94 _ContentDownloadUserData::GetSlot(void) const
100 _ContentDownloadUserData::GetDownloadCount(void) const
102 return __downloadCount;
106 _ContentDownloadUserData::GetPercent(void) const
111 _ContentTransferEvent*
112 _ContentDownloadUserData::GetContentTransferEvent(void) const
114 return __pContentTransferEvent;
118 _ContentDownloadUserData::GetContentTransferInfo(void) const
120 return __pContentTransferInfo;
124 _ContentDownloadUserData::GetCheckDownloading(int slot) const
126 return (__pCheckDownloading.get())[slot];
130 _ContentDownloadUserData::GetTotalSize(void) const
136 _ContentDownloadUserData::GetPrevData(void) const
138 return __prevDownloadData;
142 _ContentDownloadUserData::SetRequestId(RequestId reqId)
148 _ContentDownloadUserData::SetContentId(const ContentId& contentId)
150 __contentId = contentId;
154 _ContentDownloadUserData::SetUrl(String& url)
160 _ContentDownloadUserData::SetDestPath(String& destPath)
162 __destPath = destPath;
166 _ContentDownloadUserData::SetDownloadBufferFlag(bool isBuffer)
168 __isBuffer = isBuffer;
172 _ContentDownloadUserData::SetSlotFlag(bool slotFlag)
174 __slotFlag = slotFlag;
178 _ContentDownloadUserData::SetSlot(int slot)
184 _ContentDownloadUserData::SetDownloadCount(int downloadCount)
186 __downloadCount = downloadCount;
190 _ContentDownloadUserData::SetMaxCount(int maxDownloadCount)
192 __maxDownloadCount = maxDownloadCount;
193 std::unique_ptr<bool[]> pCheckDownloading(new (std::nothrow) bool[__maxDownloadCount]);
194 SysTryLog(NID_CNT, pCheckDownloading != null, "[E_OUT_OF_MEMORY] Failed to construct bool on SetMaxCount().");
196 __pCheckDownloading = std::move(pCheckDownloading);
200 _ContentDownloadUserData::SetPercent(int percent)
206 _ContentDownloadUserData::SetContentTransferEvent(_ContentTransferEvent* transferEvent)
208 __pContentTransferEvent = transferEvent;
212 _ContentDownloadUserData::SetContentTransferInfo(ContentTransferInfo* transferInfo)
214 __pContentTransferInfo = transferInfo;
218 _ContentDownloadUserData::SetCheckDownloading(int slot, bool check)
220 (__pCheckDownloading.get())[slot] = check;
224 _ContentDownloadUserData::SetTotalSize(long long totalSize)
226 __totalSize = totalSize;
230 _ContentDownloadUserData::SetPrevData(long long data)
232 __prevDownloadData = data;