merge with master
[platform/framework/native/content.git] / src / inc / FCnt_DownloadRequestImpl.h
1 //
2 // Open Service Platform
3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
4 //
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
8 //
9 //     http://www.apache.org/licenses/LICENSE-2.0
10 //
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.
16 //
17 /**
18  * @file                FCnt_DownloadRequestImpl.h
19  * @brief               This is the header file for the %_DownloadRequestImpl class.
20  *
21  * This header file contains the declarations of the %_DownloadRequestImpl class.
22  */
23 #ifndef _FCNT_DOWNLOAD_REQUEST_IMPL_H_
24 #define _FCNT_DOWNLOAD_REQUEST_IMPL_H_
25
26 #include <FBaseResult.h>
27 #include <FBaseString.h>
28 #include <FBaseColHashMap.h>
29 #include <FBaseColIMap.h>
30
31 #include <FCntTypes.h>
32
33 namespace Tizen { namespace Content
34 {
35
36 class IDownloadEventListener;
37 class IDownloadProgressListener;
38 class DownloadRequest;
39
40 class _OSP_EXPORT_ _DownloadRequestImpl
41         : public Tizen::Base::Object
42 {
43 public:
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);
48         
49         virtual ~_DownloadRequestImpl(void);
50
51         _DownloadRequestImpl& operator =(const _DownloadRequestImpl& rhs);
52         bool operator ==(const _DownloadRequestImpl& rhs) const;
53
54         virtual bool Equals(const Object& obj) const;
55         virtual int GetHashCode(void) const;
56
57         void SetDirectoryPath(const Tizen::Base::String& dirPath); 
58         void SetFileName(const Tizen::Base::String& fileName); 
59
60         Tizen::Base::String GetUrl(void) const;
61         Tizen::Base::String GetDirectoryPath(void) const;
62         Tizen::Base::String GetFileName(void) const;
63
64         void SetNotification(bool enable);
65         result SetNotificationExtraData(const Tizen::Base::Collection::IMap *pExtraData);
66         void SetNetworkType(DownloadNetworkType type);
67
68         bool IsNotificationEnabled(void) const;
69         const Tizen::Base::Collection::IMap* GetNotificationExtraData(void) const;
70         DownloadNetworkType GetNetworkType(void) const;
71
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);
76
77         static _DownloadRequestImpl* GetInstance(const DownloadRequest* pRequest);
78         Tizen::Base::Collection::IMap* GetRequestHeader(void);
79
80 private:
81
82         Tizen::Base::String __url;
83         Tizen::Base::String __dirPath;
84         Tizen::Base::String __fileName;
85         bool __notification;
86         DownloadNetworkType __networkType;
87         Tizen::Base::Collection::HashMap __notifyExtraData;
88         Tizen::Base::Collection::HashMap __requestHeader;
89
90 }; // _DownloadRequestImpl
91
92 } } // Tizen::Content
93
94 #endif //_FCNT_DOWNLOAD_MANAGER_IMPL_H_
95