|
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: MNcdProtocol declaration |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef M_NCDPROTOCOL_H |
|
20 #define M_NCDPROTOCOL_H |
|
21 |
|
22 #include <e32base.h> |
|
23 |
|
24 class MNcdParser; |
|
25 class CNcdRequestBase; |
|
26 class CNcdRequestConfiguration; |
|
27 class MCatalogsContext; |
|
28 class MNcdProtocolDefaultObserver; |
|
29 class MNcdSessionHandler; |
|
30 |
|
31 /** |
|
32 * Interface for protocol entry point. |
|
33 * |
|
34 * @note Requests are created with NcdRequestGenerator |
|
35 * |
|
36 */ |
|
37 class MNcdProtocol |
|
38 |
|
39 { |
|
40 public: |
|
41 |
|
42 /** |
|
43 * Creates a parser for parsing protocol responses. |
|
44 * |
|
45 * @param aContext Current context |
|
46 * @param aServerURI Server where the protocol response originates. |
|
47 * This is used for session bookkeeping. |
|
48 */ |
|
49 virtual MNcdParser* CreateParserL( MCatalogsContext& aContext, |
|
50 const TDesC& aServerUri ) = 0; |
|
51 |
|
52 |
|
53 /** |
|
54 * Process a preminet request |
|
55 * |
|
56 * @note This method must be called for all requests before they are |
|
57 * sent. |
|
58 * |
|
59 * @param aRequest Request to process |
|
60 * @param aServerUri Server URI for the request |
|
61 * @param aForceConfigurationData If true, configuration data is always included in the |
|
62 * request, otherwise only if there is no existing session for the request. |
|
63 * @return Final request data that can be sent to a server |
|
64 */ |
|
65 virtual HBufC8* ProcessPreminetRequestL( const MCatalogsContext& aContext, |
|
66 CNcdRequestBase& aRequest, |
|
67 const TDesC& aServerUri, |
|
68 TBool aForceConfigurationData = EFalse ) = 0; |
|
69 |
|
70 |
|
71 /** |
|
72 * Process a configuration request |
|
73 * |
|
74 * @note This method must be called for all requests before they are |
|
75 * sent. |
|
76 * |
|
77 * @param aRequest Request to process |
|
78 * @param aServerUri Server URI for the request |
|
79 * @return Final request data that can be sent to a server |
|
80 */ |
|
81 virtual HBufC8* ProcessConfigurationRequestL( |
|
82 const MCatalogsContext& aContext, |
|
83 CNcdRequestConfiguration& aRequest ) = 0; |
|
84 |
|
85 /** |
|
86 * Retrieves the default handler for protocol events. |
|
87 * All events not needed by the parser observer should be passed to |
|
88 * the default observer. |
|
89 * @return Default protocol events observer |
|
90 */ |
|
91 //virtual MNcdProtocolDefaultObserver& ProtocolDefaultObserver() const = 0; |
|
92 |
|
93 |
|
94 /** |
|
95 * Session handler getter |
|
96 * @throw KErrNotFound if the context is not found |
|
97 */ |
|
98 virtual MNcdSessionHandler& SessionHandlerL( |
|
99 const MCatalogsContext& aContext ) const = 0; |
|
100 |
|
101 |
|
102 protected: |
|
103 |
|
104 virtual ~MNcdProtocol() |
|
105 { |
|
106 } |
|
107 }; |
|
108 |
|
109 |
|
110 |
|
111 #endif |