1 /** @file |
|
2 * Copyright (c) 2005-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: Class responsible for reading file from MS |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef C_CUPNPDOWNLOADCOMMAND_H |
|
20 #define C_CUPNPDOWNLOADCOMMAND_H |
|
21 |
|
22 // INCLUDES |
|
23 #include "upnpcommand.h" |
|
24 #include "upnpresponsehandler.h" |
|
25 #include "upnpresolverobserver.h" |
|
26 |
|
27 // FORWARD DECLARATIONS |
|
28 class CUpnpPathResolver; |
|
29 |
|
30 // CLASS DECLARATION |
|
31 /** |
|
32 * Class responsible for downloadind files from MS. |
|
33 * |
|
34 * @since Series 60 3.1 |
|
35 */ |
|
36 class CUpnpDownloadCommand : public CUpnpCommand, |
|
37 public MUpnpResponseHandler, |
|
38 public MUpnpHttpResponseHandler, |
|
39 public MUpnpResolverObserver |
|
40 { |
|
41 public: |
|
42 /** |
|
43 * Two-phased constructor. |
|
44 * |
|
45 * @param aAVCPManager manager |
|
46 * @param aSession server-side session |
|
47 * @param aMessage message |
|
48 */ |
|
49 static CUpnpDownloadCommand* NewL(CUpnpAVCPManager& aAVCPManager, |
|
50 CUpnpAVCPEngineSession& aSession, const RMessage2& aMessage); |
|
51 /** |
|
52 * Destructor. |
|
53 */ |
|
54 virtual ~CUpnpDownloadCommand(); |
|
55 |
|
56 public: // Method from CUpnpCommand |
|
57 /** |
|
58 * From CUpnpCommand returns session id. |
|
59 * It is also defined in MUpnpResponseHandler, MUpnpHttpResponseHandler |
|
60 * @since Series 60 3.1 |
|
61 */ |
|
62 TInt SessionId(); |
|
63 /** |
|
64 * From CUpnpCommand implement logic for leaves that appear during InterpretL. |
|
65 * It is also defined in MUpnpResponseHandler, MUpnpHttpResponseHandler |
|
66 * @since Series 60 3.1 |
|
67 */ |
|
68 void RunError(TInt aErrorCode); |
|
69 /** |
|
70 * From CUpnpCommand perfroms operation connected with command |
|
71 * @since Series 60 3.1 |
|
72 */ |
|
73 void ExecuteL(); |
|
74 /** |
|
75 * From CUpnpCommand it is empty implementation. |
|
76 * @since Series 60 3.1 |
|
77 */ |
|
78 void SetResultL(const RMessage2& aMessage); |
|
79 |
|
80 public: // Method from observers |
|
81 /** |
|
82 * From MUpnpResponseHandler, it is notified when SOAP respone |
|
83 * with relevant session id comes. |
|
84 * @param aErrorCode error code |
|
85 * @param aAction action with attached respone |
|
86 * @since Series 60 3.1 |
|
87 */ |
|
88 void InterpretL(TInt aErrorCode, CUpnpAction* aAction); |
|
89 /** |
|
90 * From MUpnpHttpResponseHandler, it is notified when HTTP respone |
|
91 * with relevant session id comes. |
|
92 * @param aErrorCode error code |
|
93 * @param aMessage response message |
|
94 * @since Series 60 3.1 |
|
95 */ |
|
96 void InterpretL(TInt aErrorCode, CUpnpHttpMessage* aMessage); |
|
97 /** |
|
98 * From MUpnpResolverObserver, it is notified after translation path into id. |
|
99 * |
|
100 * @param aErrorCode error code (KErrNone if Ok) |
|
101 * @param aIdElement object describing searched element |
|
102 * @since Series 60 3.1 |
|
103 */ |
|
104 void ResolvedIdL(TInt aErrCode, CUpnpPathElement* aIdElement); |
|
105 |
|
106 private: |
|
107 /** |
|
108 * C++ default constructor. |
|
109 */ |
|
110 CUpnpDownloadCommand(CUpnpAVCPManager& aAVCPManager, |
|
111 CUpnpAVCPEngineSession& aSession, const RMessage2& aMessage); |
|
112 /** |
|
113 * Symbian 2nd phase constructor. |
|
114 */ |
|
115 void ConstructL(); |
|
116 |
|
117 private: |
|
118 // path resolver |
|
119 CUpnpPathResolver* iPathResolver; |
|
120 // object id taken from path specified by request |
|
121 HBufC8* iObjectId; |
|
122 // path to destinnation file (local file in cache directory) |
|
123 HBufC8* iDestPath; |
|
124 // flag indicates that RANGE was used |
|
125 TBool iUseRange; |
|
126 // structure keeps information about position of file to read |
|
127 TFilePosition iPosition; |
|
128 }; |
|
129 |
|
130 #endif //C_CUPNPDOWNLOADCOMMAND_H |
|