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 // INCLUDE FILES |
|
21 #include <e32std.h> // TFileName |
|
22 |
|
23 #include "SVGTViewerAppDownloads.h" |
|
24 |
|
25 |
|
26 // ============================ MEMBER FUNCTIONS =============================== |
|
27 |
|
28 |
|
29 // ----------------------------------------------------------------------------- |
|
30 // CSVGTViewerAppDownloads::NewL |
|
31 // Two-phased constructor. |
|
32 // ----------------------------------------------------------------------------- |
|
33 // |
|
34 CSVGTViewerAppDownloads* CSVGTViewerAppDownloads::NewL( |
|
35 TBool aIsEmbedded, |
|
36 TBool aIsSynchronous, |
|
37 TBool aLinkFlag ) |
|
38 |
|
39 { |
|
40 CSVGTViewerAppDownloads* self = CSVGTViewerAppDownloads::NewLC( |
|
41 aIsEmbedded, aIsSynchronous, aLinkFlag); |
|
42 CleanupStack::Pop( self ); |
|
43 return self; |
|
44 |
|
45 } |
|
46 |
|
47 // ----------------------------------------------------------------------------- |
|
48 // CSVGTViewerAppDownloads::NewLC |
|
49 // Two-phased constructor. |
|
50 // ----------------------------------------------------------------------------- |
|
51 // |
|
52 CSVGTViewerAppDownloads* CSVGTViewerAppDownloads::NewLC( |
|
53 TBool aIsEmbedded, |
|
54 TBool aIsSynchronous , |
|
55 TBool aLinkFlag ) |
|
56 |
|
57 { |
|
58 CSVGTViewerAppDownloads* self = new( ELeave ) CSVGTViewerAppDownloads( |
|
59 aIsEmbedded, aIsSynchronous, aLinkFlag ); |
|
60 CleanupStack::PushL( self ); |
|
61 self->ConstructL(); |
|
62 return self; |
|
63 } |
|
64 |
|
65 // ----------------------------------------------------------------------------- |
|
66 // Destructor |
|
67 // ----------------------------------------------------------------------------- |
|
68 CSVGTViewerAppDownloads::~CSVGTViewerAppDownloads() |
|
69 { |
|
70 // Reset the Http Download Handle as it is owned by caller |
|
71 iHttpDownload = NULL; |
|
72 } |
|
73 // ----------------------------------------------------------------------------- |
|
74 // CSVGTViewerAppDownloads::LinkOffset() |
|
75 // ----------------------------------------------------------------------------- |
|
76 TInt CSVGTViewerAppDownloads::LinkOffset() |
|
77 { |
|
78 return _FOFF(CSVGTViewerAppDownloads,iLink); |
|
79 } |
|
80 |
|
81 // ----------------------------------------------------------------------------- |
|
82 // CSVGTViewerAppDownloads::FileName |
|
83 // Returns the file name associated with the download. |
|
84 // ----------------------------------------------------------------------------- |
|
85 // |
|
86 TFileName CSVGTViewerAppDownloads::FileName() const |
|
87 { |
|
88 return iFileName; |
|
89 } |
|
90 // ----------------------------------------------------------------------------- |
|
91 // CSVGTViewerAppDownloads::EmbeddedMode |
|
92 // Returns the EmbeddedMode flag associated with the download. |
|
93 // ----------------------------------------------------------------------------- |
|
94 // |
|
95 TBool CSVGTViewerAppDownloads::EmbeddedMode() const |
|
96 { |
|
97 return iEmbeddedMode; |
|
98 } |
|
99 // ----------------------------------------------------------------------------- |
|
100 // CSVGTViewerAppDownloads::SynchronousMode |
|
101 // Returns the SynchronousMode flag associated with the download. |
|
102 // ----------------------------------------------------------------------------- |
|
103 // |
|
104 TBool CSVGTViewerAppDownloads::SynchronousMode() const |
|
105 { |
|
106 return iSynchronousMode; |
|
107 } |
|
108 |
|
109 // ----------------------------------------------------------------------------- |
|
110 // CSVGTViewerAppDownloads::DownloadCompleted |
|
111 // Returns the DownloadCompleted flag associated with the download. |
|
112 // ----------------------------------------------------------------------------- |
|
113 // |
|
114 TBool CSVGTViewerAppDownloads::DownloadCompleted() const |
|
115 { |
|
116 return iDownloadCompleted; |
|
117 } |
|
118 |
|
119 // ----------------------------------------------------------------------------- |
|
120 // CSVGTViewerAppDownloads::QueLink |
|
121 // This Function returns the download handle associated with the download |
|
122 // ----------------------------------------------------------------------------- |
|
123 // |
|
124 TDblQueLink CSVGTViewerAppDownloads::QueLink() const |
|
125 { |
|
126 return iLink; |
|
127 } |
|
128 // ----------------------------------------------------------------------------- |
|
129 // CSVGTViewerAppDownloads::Download |
|
130 // This Function returns the download handle associated with the download |
|
131 // ----------------------------------------------------------------------------- |
|
132 // |
|
133 RHttpDownload* CSVGTViewerAppDownloads::DownloadHandle() |
|
134 { |
|
135 return iHttpDownload; |
|
136 } |
|
137 |
|
138 TBool CSVGTViewerAppDownloads::ImageLinkFlag() const |
|
139 { |
|
140 return iImageLinkFlag; |
|
141 } |
|
142 |
|
143 // ----------------------------------------------------------------------------- |
|
144 // CSVGTViewerAppDownloads::SetFileName |
|
145 // This Function Sets the filename associated with the download |
|
146 // ----------------------------------------------------------------------------- |
|
147 // |
|
148 void CSVGTViewerAppDownloads::SetFileName( const TDesC& aFileName ) |
|
149 { |
|
150 iFileName = aFileName; |
|
151 } |
|
152 // ----------------------------------------------------------------------------- |
|
153 // CSVGTViewerAppDownloads::SetEmbeddedMode |
|
154 // This function sets the EmbeddedMode flag associated with the download. |
|
155 // ----------------------------------------------------------------------------- |
|
156 // |
|
157 void CSVGTViewerAppDownloads::SetEmbeddedMode( TBool aEmbeddedMode ) |
|
158 { |
|
159 iEmbeddedMode = aEmbeddedMode; |
|
160 } |
|
161 // ----------------------------------------------------------------------------- |
|
162 // CSVGTViewerAppDownloads::SetSynchronousMode |
|
163 // This function sets the SynchronousMode flag associated with the download. |
|
164 // ----------------------------------------------------------------------------- |
|
165 // |
|
166 void CSVGTViewerAppDownloads::SetSynchronousMode( TBool aSynchronousMode ) |
|
167 { |
|
168 iSynchronousMode = aSynchronousMode; |
|
169 } |
|
170 |
|
171 // ----------------------------------------------------------------------------- |
|
172 // CSVGTViewerAppDownloads::SetDownloadCompleted |
|
173 // This function sets the Downloadcompleted flag associated with the download. |
|
174 // ----------------------------------------------------------------------------- |
|
175 // |
|
176 void CSVGTViewerAppDownloads::SetDownloadCompleted( TBool aDownloadCompleted ) |
|
177 { |
|
178 iDownloadCompleted = aDownloadCompleted; |
|
179 } |
|
180 |
|
181 // ----------------------------------------------------------------------------- |
|
182 // CSVGTViewerAppDownloads::SetDownloadHandle |
|
183 // This function sets the Download handle associated with the download. |
|
184 // ----------------------------------------------------------------------------- |
|
185 // |
|
186 void CSVGTViewerAppDownloads::SetDownloadHandle( RHttpDownload* aDownloadHandle ) |
|
187 { |
|
188 iHttpDownload = aDownloadHandle; |
|
189 } |
|
190 |
|
191 // ----------------------------------------------------------------------------- |
|
192 // CSVGTViewerAppDownloads::SetImageLinkFlag |
|
193 // Image flag to distinguish the Embeded & hyperlink. |
|
194 // ----------------------------------------------------------------------------- |
|
195 // |
|
196 void CSVGTViewerAppDownloads::SetImageLinkFlag(TBool aLinkFlag) |
|
197 { |
|
198 iImageLinkFlag = aLinkFlag; |
|
199 } |
|
200 |
|
201 // ----------------------------------------------------------------------------- |
|
202 // CSVGTViewerAppDownloads::CSVGTViewerAppDownloads |
|
203 // C++ default constructor can NOT contain any code, that |
|
204 // might leave. |
|
205 // ----------------------------------------------------------------------------- |
|
206 // |
|
207 CSVGTViewerAppDownloads::CSVGTViewerAppDownloads( TBool aIsEmbedded, |
|
208 TBool aIsSynchronous , TBool aLinkFlag ) : |
|
209 iEmbeddedMode( aIsEmbedded ), |
|
210 iSynchronousMode( aIsSynchronous ), |
|
211 iDownloadCompleted( EFalse ), |
|
212 iImageLinkFlag(aLinkFlag) |
|
213 { |
|
214 } |
|
215 |
|
216 // ----------------------------------------------------------------------------- |
|
217 // CSVGTViewerAppDownloads::ConstructL |
|
218 // Symbian 2nd phase constructor can leave. |
|
219 // ----------------------------------------------------------------------------- |
|
220 // |
|
221 void CSVGTViewerAppDownloads::ConstructL() |
|
222 { |
|
223 } |
|
224 // End of File |
|