|
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: Defines the ECOM interface for Handler plug-in implementation |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 |
|
23 |
|
24 |
|
25 #ifndef SEN_MESSAGE_HANDLER_H |
|
26 #define SEN_MESSAGE_HANDLER_H |
|
27 |
|
28 // INCLUDES |
|
29 #include <ecom/ecom.h> |
|
30 |
|
31 #include "senhandlerbase.h" // internal Framework\inc |
|
32 #include "msenhandlercontext.h" // internal Framework\inc |
|
33 #include "msenmessagecontext.h" // internal Framework\inc |
|
34 |
|
35 // CLASS DECLARATION |
|
36 |
|
37 /** |
|
38 * Custom ECOM interface definition. This interface is used by |
|
39 * clients to find specific handler plugins which implement |
|
40 * pure virtual functions defined in MSenTranport interface. |
|
41 */ |
|
42 class CSenMessageHandler : public CSenHandlerBase |
|
43 { |
|
44 public: |
|
45 |
|
46 // Constructors and destructor: |
|
47 |
|
48 /** |
|
49 * Wraps ECom object instantiation, which returns the |
|
50 * default ECOM implementation for this interface. |
|
51 * Note: This is not a "normal" NewL method, since |
|
52 * normally NewL methods are only defined for concrete |
|
53 * classes. Note that the implementations of this interface |
|
54 * also provide NewL methods. |
|
55 * |
|
56 * Additionally, this static constructor performs InitL() |
|
57 * using the provided handler context for the newly allocated |
|
58 * handler instance. |
|
59 * |
|
60 * @param aCtx is handle to the handler specific context |
|
61 */ |
|
62 static CSenMessageHandler* NewL(MSenHandlerContext& aCtx); |
|
63 |
|
64 /** |
|
65 * Wraps ECom object instantiation, which returns the |
|
66 * interface implementation matching to given aCue, |
|
67 * IMPLEMENTATION_INFO::default_data. |
|
68 * For details, see EcomSIFDefinition.inl comments. |
|
69 * Note: This is not a "normal" NewL method, since normally NewL |
|
70 * methods are only defined for concrete classes. |
|
71 * Note that the implementations of this interface |
|
72 * also provide NewL methods. |
|
73 * |
|
74 * Additionally, this static constructor performs InitL() |
|
75 * using the provided handler context for the newly allocated |
|
76 * handler instance. |
|
77 * |
|
78 * @param aCue is the "name" of the requested implementation. |
|
79 * Implementations advertise their cue as specified |
|
80 * in their resource file field |
|
81 * @param aCtx is handle to the handler specific context |
|
82 */ |
|
83 static CSenMessageHandler* NewL(const TDesC8& aCue, |
|
84 MSenHandlerContext& aCtx); |
|
85 /** |
|
86 * Destructor. |
|
87 */ |
|
88 virtual ~CSenMessageHandler(); |
|
89 |
|
90 // From MSenHandler: |
|
91 /** |
|
92 * Method is used to resolve concrete type (class) |
|
93 * for this handler instance. |
|
94 * |
|
95 * @return the class type of this handler |
|
96 */ |
|
97 inline SenHandler::THandlerType Type() const; |
|
98 |
|
99 /** |
|
100 * Method is used to resolve real, system-wide |
|
101 * unique name for this handler. By default, this |
|
102 * typically returns the ECOM cue (default_data) |
|
103 * of the concrete plug-in instance. |
|
104 * |
|
105 * @return the unique name of this handler |
|
106 */ |
|
107 inline TPtrC8 Name() const; |
|
108 |
|
109 |
|
110 // New functions: |
|
111 |
|
112 /** |
|
113 * InvokeL is the most emergent method in message handler interface. |
|
114 * Each sub-class must implement this method thus providing message |
|
115 * processing routine. |
|
116 * |
|
117 * @param aCtx is the message context that will be accessed and |
|
118 * typically altered by implemented handler, in order to provide |
|
119 * modifications on the layer in message construction, validation, |
|
120 * or some other focused area that the handler was intended to take |
|
121 * responsibility for. For example, certain handler might add |
|
122 * some new (SOAP) headers into the message through this context. |
|
123 * @return KErrNone or some WSF specific, or system-wide error code |
|
124 */ |
|
125 virtual TInt InvokeL(MSenMessageContext& aCtx) = 0; |
|
126 |
|
127 protected: |
|
128 |
|
129 /** |
|
130 * C++ default constructor. |
|
131 */ |
|
132 CSenMessageHandler(MSenHandlerContext& aCtx); |
|
133 |
|
134 protected: // Data |
|
135 MSenHandlerContext& iHandlerContext; |
|
136 |
|
137 private: // Data |
|
138 /** |
|
139 * Instance identifier key. When instance of an implementation is created |
|
140 * by ECOM framework, the framework will assign UID for it. |
|
141 * The UID is used in destructor to notify framework that this instance is |
|
142 * being destroyed and resources can be released. |
|
143 */ |
|
144 TUid iDtor_ID_Key; |
|
145 |
|
146 HBufC8* iName; |
|
147 }; |
|
148 |
|
149 // This includes the implementation of the instantiation functions and destructor |
|
150 #include "senmessagehandler.inl" |
|
151 |
|
152 #endif // SEN_MESSAGE_HANDLER_H |
|
153 |
|
154 // End of File |