[content] Change version in spec file
[platform/framework/native/content.git] / inc / FCntContentTransferInfo.h
1 //
2 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
3 //
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
7 //
8 //     http://www.apache.org/licenses/LICENSE-2.0
9 //
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.
15 //
16 /**
17  * @file                FCntContentTransferInfo.h
18  * @brief               This is the header file for the %ContentTransferInfo class.
19  *
20  * This header file contains the declarations of the %ContentTransferInfo class.
21  */
22
23 #ifndef _FCNT_CONTENT_TRANSFER_INFO_H_
24 #define _FCNT_CONTENT_TRANSFER_INFO_H_
25
26 #include <FBaseUtilUri.h>
27
28 namespace Tizen { namespace Content
29 {
30
31 class _ContentTransferInfoImpl;
32 class IContentTransferListener;
33
34 /**
35  * @if OSPDEPREC
36  * @enum ContentTransferStatus
37  *
38  * Defines the content transfer status.
39  *
40  * @since       2.0
41  * #endif
42  */
43 enum  ContentTransferStatus
44 {
45         CONTENT_TRANSFER_STATUS_NONE,                                                                   /**< None */
46         CONTENT_TRANSFER_STATUS_DOWNLOADING,                                    /**< The Downloading status */
47         CONTENT_TRANSFER_STATUS_DOWNLOAD_COMPLETED,     /**<  The Download completed status */
48         CONTENT_TRANSFER_STATUS_DOWNLOAD_READY,                         /**<  The Download ready status */
49 };
50
51 /**
52  * @if OSPDEPREC
53  * @class       ContentTransferInfo
54  * @brief       <i> [Deprecated] </i> This class contains methods that provide information about the content transfer.
55  *
56  * @deprecated  This class is deprecated. Instead of using this class, use DownloadManager class.
57  * @since       2.0
58  *
59  * The %ContentTransferInfo class provides information about the transfer of content between the device and servers.
60  * @endif
61  */
62 class _OSP_EXPORT_ ContentTransferInfo
63         : virtual public Tizen::Base::Object
64 {
65 public:
66         /**
67          * This is the constructor for this class.
68          *
69          * @brief       <i> [Deprecated] </i>
70          * @deprecated  This class is deprecated. Instead of using this class, use DownloadManager class.
71          * @since               2.0
72          */
73         ContentTransferInfo(void);
74
75         /**
76          * This destructor overrides Tizen::Base::Object::~Object().
77          *
78          * @brief       <i> [Deprecated] </i>
79          * @deprecated  This class is deprecated. Instead of using this class, use DownloadManager class.
80          * @since               2.0
81          */
82         virtual ~ContentTransferInfo(void);
83
84         /**
85          * Gets the requested Uniform Resource Identifier (URI).
86          *
87          * @brief       <i> [Deprecated] </i>
88          * @deprecated  This class is deprecated. Instead of using this class, use DownloadManager class.
89          * @since               2.0
90          *
91          * @return              The requested URI
92          */
93         Tizen::Base::Utility::Uri GetUri(void) const;
94
95         /**
96          * Gets the request ID.
97          *
98          * @brief       <i> [Deprecated] </i>
99          * @deprecated  This class is deprecated. Instead of using this class, use DownloadManager class.
100          * @since               2.0
101          *
102          * @return              The request ID
103          *
104          */
105         RequestId GetRequestId(void) const;
106
107         /**
108          * Gets the destination file path.
109          *
110          * @brief       <i> [Deprecated] </i>
111          * @deprecated  This class is deprecated. Instead of using this class, use DownloadManager class.
112          * @since               2.0
113          *
114          * @return              The destination file path
115          *
116          */
117         Tizen::Base::String GetDestPath(void) const;
118
119         /**
120          * Gets the content transfer's status.
121          *
122          * @brief       <i> [Deprecated] </i>
123          * @deprecated  This class is deprecated. Instead of using this class, use DownloadManager class.
124          * @since               2.0
125          *
126          * @return              The content transfer's status
127          */
128         ContentTransferStatus GetContentTransferStatus(void) const;
129
130 private:
131         void SetAllInfo(RequestId reqId, const Tizen::Base::Utility::Uri& uri, const Tizen::Base::String& destPath, const Tizen::Base::String& sourcePath, int sourceFileSize, ContentTransferStatus status);
132
133         void SetRestRequestId(RequestId reqId);
134
135         RequestId GetRestRequestId(void) const;
136
137         int GetSourceFileSize(void) const;
138
139         void SetSlotId(int slot);
140
141         int GetSlotId(void) const;
142
143         void SetTimeout(int sec);
144
145         int GetTimeout(void) const;
146
147         void SetListener(IContentTransferListener* pListener);
148
149         ContentTransferInfo* CopyN(void);
150
151         void SetIsBuffer(bool isBuffer);
152
153         bool GetIsBuffer(void) const;
154
155         void SetProgressInterval(int intervalValue);
156
157         int GetProgressInterval(void) const;
158
159         void SetDownloadStatus(ContentTransferStatus status);
160
161 private:
162         RequestId __requestId;
163         RequestId __restRequestId;
164         ContentTransferStatus __status;
165         Tizen::Base::String __destPath;
166         Tizen::Base::Utility::Uri __uri;
167         Tizen::Base::String __sourcePath;
168         int __sourceFileSize;
169         int __slotId;
170         IContentTransferListener* __pListener;
171         int __timeout;
172         bool __isBuffer;
173         int __intervalValue;
174         _ContentTransferInfoImpl* __pImpl; // pubonly - for ABC
175         friend class _ContentTransferInfoImpl;
176         friend class _ContentTransferImpl;
177         friend class _ContentDownloadListener;
178
179 };  // class ContentTransferInfo
180
181 }}  // Tizen::Content
182
183 #endif  // _FCNT_CONTENT_TRANSFER_INFO_H_