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_ContentDownloadUserData.cpp
19 * @brief This is the implementation file for the %_ContentDownloadUserData class.
21 * This file contains implementation of the %_ContentDownloadUserData class.
24 #include <FBaseSysLog.h>
25 #include <FCntTypes.h>
26 #include "FCnt_ContentDownloadUserData.h"
28 using namespace Tizen;
29 using namespace Tizen::Base;
31 namespace Tizen { namespace Content
34 _ContentDownloadUserData::_ContentDownloadUserData(void)
35 : __reqId(INVALID_REQUEST_ID)
36 , __contentId(UuId::GetInvalidUuId())
39 , __maxDownloadCount(-1)
42 , __prevDownloadData(0)
45 , __pCheckDownloading(null)
46 , __pContentTransferEvent(null)
47 , __pContentTransferInfo(null)
53 _ContentDownloadUserData::~_ContentDownloadUserData(void)
59 _ContentDownloadUserData::GetRequestId(void) const
65 _ContentDownloadUserData::GetContentId(void) const
71 _ContentDownloadUserData::GetUrl(void) const
77 _ContentDownloadUserData::GetDestPath(void) const
83 _ContentDownloadUserData::GetDownloadBufferFlag(void) const
89 _ContentDownloadUserData::GetSlotFlag(void) const
95 _ContentDownloadUserData::GetSlot(void) const
101 _ContentDownloadUserData::GetDownloadCount(void) const
103 return __downloadCount;
107 _ContentDownloadUserData::GetPercent(void) const
112 _ContentTransferEvent*
113 _ContentDownloadUserData::GetContentTransferEvent(void) const
115 return __pContentTransferEvent;
119 _ContentDownloadUserData::GetContentTransferInfo(void) const
121 return __pContentTransferInfo;
125 _ContentDownloadUserData::GetCheckDownloading(int slot) const
127 return (__pCheckDownloading.get())[slot];
131 _ContentDownloadUserData::GetTotalSize(void) const
137 _ContentDownloadUserData::GetPrevData(void) const
139 return __prevDownloadData;
143 _ContentDownloadUserData::SetRequestId(RequestId reqId)
149 _ContentDownloadUserData::SetContentId(const ContentId& contentId)
151 __contentId = contentId;
155 _ContentDownloadUserData::SetUrl(String& url)
161 _ContentDownloadUserData::SetDestPath(String& destPath)
163 __destPath = destPath;
167 _ContentDownloadUserData::SetDownloadBufferFlag(bool isBuffer)
169 __isBuffer = isBuffer;
173 _ContentDownloadUserData::SetSlotFlag(bool slotFlag)
175 __slotFlag = slotFlag;
179 _ContentDownloadUserData::SetSlot(int slot)
185 _ContentDownloadUserData::SetDownloadCount(int downloadCount)
187 __downloadCount = downloadCount;
191 _ContentDownloadUserData::SetMaxCount(int maxDownloadCount)
193 __maxDownloadCount = maxDownloadCount;
194 std::unique_ptr<bool[]> pCheckDownloading(new (std::nothrow) bool[__maxDownloadCount]);
195 SysTryLog(NID_CNT, pCheckDownloading != null, "[E_OUT_OF_MEMORY] Failed to construct bool on SetMaxCount().");
197 __pCheckDownloading = std::move(pCheckDownloading);
201 _ContentDownloadUserData::SetPercent(int percent)
207 _ContentDownloadUserData::SetContentTransferEvent(_ContentTransferEvent* transferEvent)
209 __pContentTransferEvent = transferEvent;
213 _ContentDownloadUserData::SetContentTransferInfo(ContentTransferInfo* transferInfo)
215 __pContentTransferInfo = transferInfo;
219 _ContentDownloadUserData::SetCheckDownloading(int slot, bool check)
221 (__pCheckDownloading.get())[slot] = check;
225 _ContentDownloadUserData::SetTotalSize(long long totalSize)
227 __totalSize = totalSize;
231 _ContentDownloadUserData::SetPrevData(long long data)
233 __prevDownloadData = data;