|
1 /* |
|
2 * Copyright (c) 2006 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: CNcdBaseDownloadHandler implementation |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #include <f32file.h> |
|
20 |
|
21 #include "ncdnode.h" |
|
22 #include "ncdnodemanager.h" |
|
23 #include "catalogshttpoperation.h" |
|
24 #include "catalogshttpconfig.h" |
|
25 #include "catalogshttpsession.h" |
|
26 #include "catalogsdebug.h" |
|
27 #include "ncdbasedownloadhandler.h" |
|
28 #include "ncdnodeidentifier.h" |
|
29 |
|
30 |
|
31 // ======== MEMBER FUNCTIONS ======== |
|
32 |
|
33 |
|
34 // --------------------------------------------------------------------------- |
|
35 // Destructor |
|
36 // --------------------------------------------------------------------------- |
|
37 // |
|
38 CNcdBaseDownloadHandler::~CNcdBaseDownloadHandler() |
|
39 { |
|
40 DLTRACEIN(("")); |
|
41 delete iNodeId; |
|
42 DLTRACEOUT(("")); |
|
43 } |
|
44 |
|
45 |
|
46 // --------------------------------------------------------------------------- |
|
47 // CurrentDownload |
|
48 // --------------------------------------------------------------------------- |
|
49 // |
|
50 TInt CNcdBaseDownloadHandler::CurrentDownload() const |
|
51 { |
|
52 return iCurrentDownload; |
|
53 } |
|
54 |
|
55 |
|
56 // --------------------------------------------------------------------------- |
|
57 // DownloadCount |
|
58 // --------------------------------------------------------------------------- |
|
59 // |
|
60 TInt CNcdBaseDownloadHandler::DownloadCount() const |
|
61 { |
|
62 return iDownloads; |
|
63 } |
|
64 |
|
65 |
|
66 |
|
67 // --------------------------------------------------------------------------- |
|
68 // Constructor |
|
69 // --------------------------------------------------------------------------- |
|
70 // |
|
71 CNcdBaseDownloadHandler::CNcdBaseDownloadHandler( |
|
72 CNcdNodeManager& aNodeManager, |
|
73 MCatalogsHttpSession& aHttpSession ) : |
|
74 iNodeManager( aNodeManager ), iHttpSession( aHttpSession ), iDownloads( 1 ) |
|
75 { |
|
76 } |
|
77 |
|
78 |
|
79 // --------------------------------------------------------------------------- |
|
80 // ConstructL |
|
81 // --------------------------------------------------------------------------- |
|
82 // |
|
83 void CNcdBaseDownloadHandler::ConstructL( const CNcdNodeIdentifier& aNodeId ) |
|
84 { |
|
85 DLTRACEIN(("")); |
|
86 iNodeId = CNcdNodeIdentifier::NewL( aNodeId ); |
|
87 DLTRACEOUT(("")); |
|
88 } |
|
89 |
|
90 |
|
91 // --------------------------------------------------------------------------- |
|
92 // Node getter |
|
93 // --------------------------------------------------------------------------- |
|
94 // |
|
95 CNcdNode& CNcdBaseDownloadHandler::NodeL() const |
|
96 { |
|
97 return iNodeManager.NodeL( *iNodeId ); |
|
98 } |
|
99 |
|
100 |
|
101 // --------------------------------------------------------------------------- |
|
102 // Node ID getter |
|
103 // --------------------------------------------------------------------------- |
|
104 // |
|
105 const CNcdNodeIdentifier& CNcdBaseDownloadHandler::NodeId() const |
|
106 { |
|
107 DASSERT( iNodeId ); |
|
108 return *iNodeId; |
|
109 } |
|
110 |
|
111 // --------------------------------------------------------------------------- |
|
112 // HTTP session getter |
|
113 // --------------------------------------------------------------------------- |
|
114 // |
|
115 MCatalogsHttpSession& CNcdBaseDownloadHandler::HttpSession() const |
|
116 { |
|
117 return iHttpSession; |
|
118 } |
|
119 |
|
120 |
|
121 // --------------------------------------------------------------------------- |
|
122 // Node manager getter |
|
123 // --------------------------------------------------------------------------- |
|
124 // |
|
125 CNcdNodeManager& CNcdBaseDownloadHandler::NodeManager() const |
|
126 { |
|
127 return iNodeManager; |
|
128 } |
|
129 |
|
130 // --------------------------------------------------------------------------- |
|
131 // Download count setter |
|
132 // --------------------------------------------------------------------------- |
|
133 // |
|
134 |
|
135 void CNcdBaseDownloadHandler::SetTotalDownloads( TInt aDownloads ) |
|
136 { |
|
137 iDownloads = aDownloads; |
|
138 } |
|
139 |
|
140 |
|
141 // --------------------------------------------------------------------------- |
|
142 // Current download setter |
|
143 // --------------------------------------------------------------------------- |
|
144 // |
|
145 void CNcdBaseDownloadHandler::SetCurrentDownload( TInt aCurrentDownload ) |
|
146 { |
|
147 iCurrentDownload = aCurrentDownload; |
|
148 } |
|
149 |