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 writing file from MS |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef C_CUPNPUPLOADCOMMAND_H |
|
20 #define C_CUPNPUPLOADCOMMAND_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 uploading files from MS. |
|
33 * |
|
34 * @since Series 60 3.1 |
|
35 */ |
|
36 class CUpnpUploadCommand : 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 CUpnpUploadCommand* NewL(CUpnpAVCPManager& aAVCPManager, |
|
50 CUpnpAVCPEngineSession& aSession, const RMessage2& aMessage); |
|
51 /** |
|
52 * Destructor. |
|
53 */ |
|
54 virtual ~CUpnpUploadCommand(); |
|
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 set result from previous performed command. |
|
76 * It sets result from directory listing. |
|
77 * @since Series 60 3.1 |
|
78 */ |
|
79 void SetResultL(const RMessage2& aMessage); |
|
80 |
|
81 public: // Method from observers |
|
82 /** |
|
83 * From MUpnpResponseHandler, it is notified when SOAP respone |
|
84 * with relevant session id comes. |
|
85 * @param aErrorCode error code |
|
86 * @param aAction action with attached respone |
|
87 * @since Series 60 3.1 |
|
88 */ |
|
89 void InterpretL(TInt aErrorCode, CUpnpAction* aAction); |
|
90 /** |
|
91 * From MUpnpHttpResponseHandler, it is notified when HTTP respone |
|
92 * with relevant session id comes. |
|
93 * @param aErrorCode error code |
|
94 * @param aMessage response message |
|
95 * @since Series 60 3.1 |
|
96 */ |
|
97 void InterpretL(TInt aErrorCode, CUpnpHttpMessage* aMessage); |
|
98 /** |
|
99 * From MUpnpResolverObserver, it is notified after translation path into id. |
|
100 * |
|
101 * @param aErrorCode error code (KErrNone if Ok) |
|
102 * @param aIdElement object describing searched element |
|
103 * @since Series 60 3.1 |
|
104 */ |
|
105 void ResolvedIdL(TInt aErrCode, CUpnpPathElement* aIdElement); |
|
106 |
|
107 private: |
|
108 /** |
|
109 * C++ default constructor. |
|
110 */ |
|
111 CUpnpUploadCommand(CUpnpAVCPManager& aAVCPManager, |
|
112 CUpnpAVCPEngineSession& aSession, const RMessage2& aMessage); |
|
113 /** |
|
114 * Symbian 2nd phase constructor. |
|
115 */ |
|
116 void ConstructL(); |
|
117 |
|
118 |
|
119 private: |
|
120 // path resolver |
|
121 CUpnpPathResolver* iPathResolver; |
|
122 // object id taken from path specified by request |
|
123 HBufC8* iObjectId; |
|
124 // location to local file, it is file to be sent |
|
125 HBufC8* iSrcPath; |
|
126 // import URI |
|
127 HBufC8* iImportURI; |
|
128 |
|
129 |
|
130 }; |
|
131 |
|
132 #endif // C_CUPNPUPLOADCOMMAND_H |
|