|
1 /* |
|
2 * Copyright (c) 2004,2005 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: This class defines the downloads and the required attributes. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef SVGTVIEWERAPPDOWNLOADS_H |
|
21 #define SVGTVIEWERAPPDOWNLOADS_H |
|
22 |
|
23 // INCLUDES |
|
24 #include <downloadmgrclient.h> //RHttpDownload |
|
25 #include <e32base.h> //CBase |
|
26 |
|
27 |
|
28 // CLASS DECLARATION |
|
29 |
|
30 /** |
|
31 * This class declares the Downloads and the associated attributes. |
|
32 * |
|
33 * @since 3.0 |
|
34 */ |
|
35 class CSVGTViewerAppDownloads : public CBase |
|
36 { |
|
37 public: // Constructors and destructor |
|
38 |
|
39 /** |
|
40 * Two-phased constructor. |
|
41 * @param aLinkFlag Image flag to distinguish the Embeded & hyperlink. |
|
42 */ |
|
43 static CSVGTViewerAppDownloads* NewL( TBool aIsEmbedded, |
|
44 TBool aIsSynchronous, |
|
45 TBool aLinkFlag ); |
|
46 |
|
47 /** |
|
48 * Two-phased constructor. |
|
49 * @param aLinkFlag Image flag to distinguish the Embeded & hyperlink. |
|
50 */ |
|
51 static CSVGTViewerAppDownloads* NewLC( TBool aIsEmbedded, |
|
52 TBool aIsSynchronous, TBool aLinkFlag ); |
|
53 |
|
54 |
|
55 /** |
|
56 * Destructor. |
|
57 */ |
|
58 virtual ~CSVGTViewerAppDownloads(); |
|
59 |
|
60 /** |
|
61 * returns link offset. |
|
62 */ |
|
63 static TInt LinkOffset(); |
|
64 |
|
65 public: // New functions |
|
66 |
|
67 /** |
|
68 * This Function returns the filename associated with the download |
|
69 * @return FileName |
|
70 */ |
|
71 TFileName FileName() const; |
|
72 |
|
73 /** |
|
74 * This Function returns the flag iEmbeddedMode |
|
75 * associated with the download |
|
76 * @return TBool |
|
77 */ |
|
78 TBool EmbeddedMode() const; |
|
79 |
|
80 /** |
|
81 * This Function returns the flag iSynchronousMode |
|
82 * associated with the download |
|
83 * @return TBool |
|
84 */ |
|
85 TBool SynchronousMode() const; |
|
86 |
|
87 /** |
|
88 * This Function returns the flag iDownloadCompleted |
|
89 * associated with the download |
|
90 * @return TBool |
|
91 */ |
|
92 TBool DownloadCompleted() const; |
|
93 |
|
94 /** |
|
95 * This Function returns the Link in the doubly linked list |
|
96 * associated with the download |
|
97 * @return TBool |
|
98 */ |
|
99 TDblQueLink QueLink() const; |
|
100 |
|
101 /** |
|
102 * This Function returns the download handle |
|
103 * associated with the download |
|
104 * @return RHttpDownload |
|
105 */ |
|
106 RHttpDownload* DownloadHandle(); |
|
107 |
|
108 /** |
|
109 * This Function returns the Image Link flag status |
|
110 * associated with the download |
|
111 * @return TBool |
|
112 */ |
|
113 TBool ImageLinkFlag() const; |
|
114 |
|
115 /** |
|
116 * This Function Sets the filename |
|
117 * associated with the download |
|
118 */ |
|
119 void SetFileName( const TDesC& aFileName ); |
|
120 |
|
121 /** |
|
122 * This Function Sets the flag EmbeddedMode |
|
123 * associated with the download |
|
124 */ |
|
125 void SetEmbeddedMode( TBool aEmbeddedMode ); |
|
126 |
|
127 |
|
128 /** |
|
129 * This Function Sets the flag SynchronousMode |
|
130 * associated with the download |
|
131 */ |
|
132 void SetSynchronousMode( TBool aSynchronousMode ); |
|
133 |
|
134 /** |
|
135 * This Function Sets the flag iDownloadCompleted |
|
136 * associated with the download |
|
137 */ |
|
138 void SetDownloadCompleted( TBool aDownloadCompleted ); |
|
139 |
|
140 /** |
|
141 * This Function Sets the Download Handle |
|
142 * associated with the download |
|
143 */ |
|
144 void SetDownloadHandle( RHttpDownload* aDownloadHandle ); |
|
145 |
|
146 /** |
|
147 * This function sets the image link flag. |
|
148 * @param aLinkFlag Image flag to distinguish the Embeded & hyperlink. |
|
149 */ |
|
150 void SetImageLinkFlag(TBool aLinkFlag); |
|
151 |
|
152 private: |
|
153 |
|
154 /** |
|
155 * C++ default constructor. |
|
156 */ |
|
157 CSVGTViewerAppDownloads( |
|
158 TBool aIsEmbedded, |
|
159 TBool aIsSynchronous, |
|
160 TBool aLinkFlag ); |
|
161 |
|
162 |
|
163 /** |
|
164 * By default Symbian 2nd phase constructor is private. |
|
165 */ |
|
166 void ConstructL(); |
|
167 |
|
168 private: // Data |
|
169 |
|
170 // Pointer to Download handle |
|
171 RHttpDownload* iHttpDownload; |
|
172 |
|
173 // Downloaded fileName |
|
174 TFileName iFileName; |
|
175 |
|
176 // Boolean variable to indicate whether the downloaded file |
|
177 // has to be opened in embedded mode or independent mode. |
|
178 TBool iEmbeddedMode; |
|
179 |
|
180 // Boolean variable to indicate whether the download |
|
181 // has to be performed in a synchronous mode or asynchronous mode |
|
182 TBool iSynchronousMode; |
|
183 |
|
184 // Flag to indicate successful download completion |
|
185 TBool iDownloadCompleted; |
|
186 |
|
187 // Doubly linked list link |
|
188 TDblQueLink iLink; |
|
189 |
|
190 //Image flag to distinguish the Embeded & hyperlink. |
|
191 //EFalse for FetchImage |
|
192 //ETrue for HyperLink. |
|
193 TBool iImageLinkFlag; |
|
194 }; |
|
195 |
|
196 #endif // SVGTVIEWERAPPDOWNLOADS_H |
|
197 |
|
198 // End of File |