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_DownloadManagerImpl.h
18 * @brief This is the header file for the %_DownloadManagerImpl class.
20 * This header file contains the declarations of the %_DownloadManagerImpl class.
22 #ifndef _FCNT_DOWNLOAD_MANAGER_IMPL_H_
23 #define _FCNT_DOWNLOAD_MANAGER_IMPL_H_
25 #include <FBaseResult.h>
26 #include <FBaseString.h>
27 #include <FBaseRtEvent.h>
28 #include <FBaseColHashMapT.h>
30 namespace Tizen { namespace Content
33 class DownloadRequest;
34 class _DownloadRequestImpl;
36 class IDownloadListener;
38 class _OSP_EXPORT_ _DownloadManagerImpl
39 : public Tizen::Base::Object
50 _DownloadManagerImpl(void);
51 virtual ~_DownloadManagerImpl(void);
53 result Start(const DownloadRequest& request, RequestId& reqId);
54 result Pause(RequestId reqId);
55 result Resume(RequestId reqId);
56 result Cancel(RequestId reqId);
58 DownloadRequest* GetDownloadRequestN(RequestId reqId);
60 int GetState(RequestId reqId) const;
62 result GetMimeType(RequestId reqId, Tizen::Base::String& mimeType);
64 result GetProgress(RequestId reqId, int& progress);
66 result SetAllowedNetwork(unsigned long flags);
68 void SetDownloadListener(IDownloadListener* pListener);
70 void DestroyResources(RequestId reqId);
72 static result ConvertToResult(int error);
74 static _DownloadManagerImpl* GetInstance(void);
77 IDownloadListener* __pListener;
78 Tizen::Base::Runtime::Event* __pEvent;
81 _DownloadManagerImpl(const _DownloadManagerImpl& clientChannel);
82 _DownloadManagerImpl& operator =(const _DownloadManagerImpl& clientChannel);
84 static void InitSingleton(void);
85 static void DestroySingleton(void);
87 result RegisterCallback(RequestId reqId);
88 void UnregisterCallback(RequestId reqId);
91 static _DownloadManagerImpl* __pInstance;
92 }; // _DownloadManagerImpl
96 #endif //_FCNT_DOWNLOAD_MANAGER_IMPL_H_