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_DownloadRequestImpl.h
19 * @brief This is the header file for the %_DownloadRequestImpl class.
21 * This header file contains the declarations of the %_DownloadRequestImpl class.
23 #ifndef _FCNT_DOWNLOAD_REQUEST_IMPL_H_
24 #define _FCNT_DOWNLOAD_REQUEST_IMPL_H_
26 #include <FBaseResult.h>
27 #include <FBaseString.h>
28 #include <FBaseColHashMap.h>
29 #include <FBaseColIMap.h>
31 #include <FCntTypes.h>
33 namespace Tizen { namespace Content
36 class IDownloadEventListener;
37 class IDownloadProgressListener;
38 class DownloadRequest;
40 class _OSP_EXPORT_ _DownloadRequestImpl
41 : public Tizen::Base::Object
44 _DownloadRequestImpl(void);
45 _DownloadRequestImpl(const Tizen::Base::String& url);
46 _DownloadRequestImpl(const Tizen::Base::String& url, const Tizen::Base::String& dirPath);
47 _DownloadRequestImpl(const _DownloadRequestImpl& rhs);
49 virtual ~_DownloadRequestImpl(void);
51 _DownloadRequestImpl& operator =(const _DownloadRequestImpl& rhs);
52 bool operator ==(const _DownloadRequestImpl& rhs) const;
54 virtual bool Equals(const Object& obj) const;
55 virtual int GetHashCode(void) const;
57 void SetDirectoryPath(const Tizen::Base::String& dirPath);
58 void SetFileName(const Tizen::Base::String& fileName);
60 Tizen::Base::String GetUrl(void) const;
61 Tizen::Base::String GetDirectoryPath(void) const;
62 Tizen::Base::String GetFileName(void) const;
64 void SetNotification(bool enable);
65 result SetNotificationExtraData(const Tizen::Base::Collection::IMap *pExtraData);
66 void SetNetworkType(DownloadNetworkType type);
68 bool IsNotificationEnabled(void) const;
69 const Tizen::Base::Collection::IMap* GetNotificationExtraData(void) const;
70 DownloadNetworkType GetNetworkType(void) const;
72 result AddRequestHeader(const Tizen::Base::String& field, const Tizen::Base::String& value);
73 result SetRequestHeader(const Tizen::Base::String& field, const Tizen::Base::String& value);
74 result RemoveRequestHeader(const Tizen::Base::String& field);
75 Tizen::Base::String* GetRequestHeaderN(const Tizen::Base::String& field);
77 static _DownloadRequestImpl* GetInstance(const DownloadRequest* pRequest);
78 Tizen::Base::Collection::IMap* GetRequestHeader(void);
82 Tizen::Base::String __url;
83 Tizen::Base::String __dirPath;
84 Tizen::Base::String __fileName;
86 DownloadNetworkType __networkType;
87 Tizen::Base::Collection::HashMap __notifyExtraData;
88 Tizen::Base::Collection::HashMap __requestHeader;
90 }; // _DownloadRequestImpl
94 #endif //_FCNT_DOWNLOAD_MANAGER_IMPL_H_