|
1 /* |
|
2 * Copyright (c) 2002-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: Header declaration |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 |
|
23 |
|
24 |
|
25 #ifndef M_SEN_HANDLER_H |
|
26 #define M_SEN_HANDLER_H |
|
27 |
|
28 // INCLUDES |
|
29 #include <e32std.h> |
|
30 |
|
31 // CONSTANTS |
|
32 namespace SenHandler |
|
33 { |
|
34 enum THandlerType |
|
35 { |
|
36 ESessionHandler = 1, // CSenMessageHandler instance |
|
37 EMessageHandler // CSenSessionHandler instance |
|
38 }; |
|
39 |
|
40 enum THandlerDirection |
|
41 { |
|
42 EOutgoing = 1, |
|
43 EIncoming, |
|
44 EBoth |
|
45 }; |
|
46 |
|
47 enum THandlerPhase |
|
48 { |
|
49 EDiscovery = 1, |
|
50 EValidate, |
|
51 EMessage |
|
52 }; |
|
53 } |
|
54 |
|
55 // FORWARD DECLARATIONS |
|
56 class MSenHandlerContext; |
|
57 |
|
58 // CLASS DECLARATION |
|
59 class MSenHandler |
|
60 { |
|
61 public: |
|
62 |
|
63 // New functions |
|
64 |
|
65 /** |
|
66 * Method is used to resolve concrete type (class) |
|
67 * for this handler instance. |
|
68 * @return the class type of this handler |
|
69 */ |
|
70 virtual SenHandler::THandlerType Type() const = 0; |
|
71 |
|
72 /** |
|
73 * Indicates the direction this handler is serving. |
|
74 * @return enum, which tells where this handler will |
|
75 * be applied - outgoing, incoming, or on both directions. |
|
76 */ |
|
77 virtual SenHandler::THandlerDirection Direction() const = 0; |
|
78 |
|
79 /** |
|
80 * Dictates the phase on which this handler is performing. |
|
81 * @return phase enum, telling at what phase of processing |
|
82 * will this hanlder be applied |
|
83 */ |
|
84 virtual SenHandler::THandlerPhase Phase() = 0; |
|
85 |
|
86 /** |
|
87 * Method is used to resolve real, system-widely |
|
88 * unique name for this handler. By default, this |
|
89 * typically returns the ECOM cue (default_data) |
|
90 * of the concrete plug-in instance. |
|
91 * @return the unique name of this handler |
|
92 */ |
|
93 virtual TPtrC8 Name() const = 0; |
|
94 |
|
95 /** |
|
96 * Handlers must also be capable to represent their structure and state |
|
97 * (type, direction and phase) in UCS8 XML form. This can be achieved either |
|
98 * by overriding this method, or by deriving from xml fragment class, like |
|
99 * CSenBaseFragment. |
|
100 * @ param aWs is the stream where to write UCS8 (UTF-8) XML document into. |
|
101 */ |
|
102 virtual void WriteAsXMLToL(RWriteStream& aWs) = 0; |
|
103 |
|
104 /** |
|
105 * Method for getting XML representation of a handler. |
|
106 * |
|
107 * @return UCS8 (UTF-8) XML document representation of this handler. |
|
108 * This XML will include handlers type, direction, phase and name. |
|
109 */ |
|
110 virtual HBufC8* AsXmlL() = 0; |
|
111 |
|
112 /** |
|
113 * InitL method uses a handler context to initialize this |
|
114 * handler instance, and it is called once right after |
|
115 * a ECOM instance lookup is done successfully. InitL() |
|
116 * method may also be used in re-initialization of |
|
117 * ready allocated, preserved handler instancies owned |
|
118 * by a WSF. |
|
119 * @return KErrNone or some WSF specific or system-wide error code |
|
120 */ |
|
121 virtual TInt InitL(MSenHandlerContext& aCtx) = 0; |
|
122 |
|
123 }; |
|
124 |
|
125 #endif // M_SEN_HANDLER_H |
|
126 |
|
127 // End of File |