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