|
1 /** @file |
|
2 * Copyright (c) 2007 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: Declares the TUpnpSoapParser class |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef __UPNPSOAPPARSER_H__ |
|
20 #define __UPNPSOAPPARSER_H__ |
|
21 |
|
22 // CLASS DECLARATION |
|
23 class CUpnpContentHandlersController; |
|
24 class CUpnpAction; |
|
25 class CUpnpDescriptionProperty; |
|
26 class CUpnpSoapMessage; |
|
27 |
|
28 #include <e32def.h> |
|
29 #include "upnpdescriptionproperty.h" |
|
30 |
|
31 /** |
|
32 * Class is responsible for parsing soap messages logic |
|
33 * with usage of CUpnpControllersContentHandler |
|
34 */ |
|
35 class TUpnpSoapParser |
|
36 { |
|
37 public: |
|
38 |
|
39 /** |
|
40 * Constructor |
|
41 * @param iParsingControler controler that will be used to invoke soap parsing |
|
42 */ |
|
43 TUpnpSoapParser( CUpnpContentHandlersController& aParsingController ); |
|
44 |
|
45 /** |
|
46 * For internal use. Update all necessary information from a SOAP-message |
|
47 * that should be OK answer (e.g. received by Http 200 OK message). |
|
48 * @param aMessage SOAP response message |
|
49 * @param aAction an action to update |
|
50 */ |
|
51 void UpdateActionWithOKResponseL( CUpnpSoapMessage* aMessage, |
|
52 CUpnpAction* aAction ); |
|
53 |
|
54 /** |
|
55 * For internal use. Update all necessary information from a SOAP-message |
|
56 * that should contain SOAP error (fault) message (eg. received by http |
|
57 * 500 InternalServerError message. |
|
58 * @param aMessage SOAP response message |
|
59 * @param aAction an action to update |
|
60 */ |
|
61 void UpdateActionWithErrorResponseL( CUpnpSoapMessage* aMessage, |
|
62 CUpnpAction* aAction ); |
|
63 |
|
64 /** |
|
65 * Update action with all necessary information from |
|
66 * a SOAP request message. |
|
67 * @since Series60 3.2 |
|
68 * @param aMessage SOAP request message |
|
69 * @param aAction - an action to update |
|
70 */ |
|
71 void UpdateActionWithRequestL( CUpnpSoapMessage* aMessage, CUpnpAction* aAction ); |
|
72 |
|
73 private: |
|
74 /** |
|
75 * Process parsed description property passed as an argument, and the rest of parsed |
|
76 * properties and update action arguments with them. |
|
77 * @param aProperties arguments list (first with action name is ignored) |
|
78 * @param aAction an action to update |
|
79 */ |
|
80 void ProcessActionArgumentsL( |
|
81 RPointerArray<CUpnpDescriptionProperty>& aProperties, CUpnpAction* aAction ); |
|
82 |
|
83 /** |
|
84 * Update all action arguments with previously parsed properties. |
|
85 * @param aProperties arguments list (first with action name is ignored) |
|
86 * @param aAction an action to update |
|
87 */ |
|
88 void UpdateActionArgumentsL( |
|
89 RPointerArray<CUpnpDescriptionProperty>& aProperty, CUpnpAction* aAction ); |
|
90 |
|
91 /** |
|
92 * Update action error value from parsed description property |
|
93 * @param aPropert parsed property |
|
94 * @param aAction an action to update |
|
95 */ |
|
96 void UpdateActionFaultL( CUpnpDescriptionProperty* aProperty, CUpnpAction* aAction ); |
|
97 |
|
98 /** |
|
99 * Common code used by 3 particular update soap action methods |
|
100 * |
|
101 */ |
|
102 void UpdateActionL( CUpnpSoapMessage* aMessage, |
|
103 CUpnpAction* aAction, RPointerArray<CUpnpDescriptionProperty>& aParsedValues ); |
|
104 |
|
105 private: |
|
106 //not owned |
|
107 CUpnpContentHandlersController& iParsingController; |
|
108 |
|
109 }; |
|
110 |
|
111 #endif //__UPNPSOAPPARSER_H__ |