|
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: |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #include "ncdnode.h" |
|
20 #include "catalogshttpoperation.h" |
|
21 #include "catalogshttpconfig.h" |
|
22 #include "catalogshttpsession.h" |
|
23 #include "catalogsdebug.h" |
|
24 #include "ncdskindownloadhandler.h" |
|
25 #include "ncdnodemetadataimpl.h" |
|
26 #include "ncdnodeskinimpl.h" |
|
27 |
|
28 // ======== MEMBER FUNCTIONS ======== |
|
29 |
|
30 // --------------------------------------------------------------------------- |
|
31 // NewL |
|
32 // --------------------------------------------------------------------------- |
|
33 // |
|
34 CNcdSkinDownloadHandler* CNcdSkinDownloadHandler::NewL( |
|
35 const CNcdNodeIdentifier& aNodeId, |
|
36 CNcdNodeManager& aNodeManager, |
|
37 MCatalogsHttpSession& aHttpSession ) |
|
38 { |
|
39 CNcdSkinDownloadHandler* self = new( ELeave ) |
|
40 CNcdSkinDownloadHandler( aNodeManager, aHttpSession ); |
|
41 CleanupStack::PushL( self ); |
|
42 self->ConstructL( aNodeId ); |
|
43 CleanupStack::Pop( self ); |
|
44 |
|
45 return self; |
|
46 } |
|
47 |
|
48 |
|
49 // --------------------------------------------------------------------------- |
|
50 // Destructor |
|
51 // --------------------------------------------------------------------------- |
|
52 // |
|
53 CNcdSkinDownloadHandler::~CNcdSkinDownloadHandler() |
|
54 { |
|
55 } |
|
56 |
|
57 |
|
58 // --------------------------------------------------------------------------- |
|
59 // DownloadL |
|
60 // --------------------------------------------------------------------------- |
|
61 // |
|
62 MCatalogsHttpOperation* CNcdSkinDownloadHandler::DownloadL() |
|
63 { |
|
64 DLTRACEIN( ( "" ) ); |
|
65 |
|
66 // Get node |
|
67 CNcdNode& node( NodeL() ); |
|
68 CNcdNodeMetaData& metadata( node.NodeMetaDataL() ); |
|
69 const CNcdNodeSkin& skin( metadata.SkinL() ); |
|
70 |
|
71 DLTRACE(( _L("Download skin id: %S"), &skin.Uri() )); |
|
72 MCatalogsHttpOperation* dl = HttpSession().CreateDownloadL( |
|
73 skin.Uri(), |
|
74 EFalse ); |
|
75 CleanupStack::PushL( dl ); |
|
76 |
|
77 SetCurrentDownload( CurrentDownload() + 1 ); |
|
78 CleanupStack::Pop( dl ); |
|
79 DLTRACEOUT( ( "" ) ); |
|
80 return dl; |
|
81 } |
|
82 |
|
83 |
|
84 // --------------------------------------------------------------------------- |
|
85 // FinishDownloadL |
|
86 // --------------------------------------------------------------------------- |
|
87 // |
|
88 void CNcdSkinDownloadHandler::FinishDownloadL( |
|
89 MCatalogsHttpOperation& /* aDownload */, |
|
90 MNcdFileHandler* /* aFileHandler */) |
|
91 { |
|
92 DLTRACEIN( ( "" ) ); |
|
93 // Nothing to do since Transport takes care of moving the file |
|
94 DLTRACEOUT( ( "" ) ); |
|
95 } |
|
96 |
|
97 |
|
98 // --------------------------------------------------------------------------- |
|
99 // Constructor |
|
100 // --------------------------------------------------------------------------- |
|
101 // |
|
102 CNcdSkinDownloadHandler::CNcdSkinDownloadHandler( |
|
103 CNcdNodeManager& aNodeManager, |
|
104 MCatalogsHttpSession& aHttpSession ) : |
|
105 CNcdBaseDownloadHandler( aNodeManager, aHttpSession ) |
|
106 { |
|
107 } |