|
1 /* |
|
2 * Copyright (c) 2003 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: Transaction factory interface. |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef __MPENGTRANSACTIONFACTORY_H__ |
|
19 #define __MPENGTRANSACTIONFACTORY_H__ |
|
20 |
|
21 // INCLUDES |
|
22 #include <e32base.h> |
|
23 |
|
24 // FORWARD DECLARATIONS |
|
25 class MPEngCSPInfo; |
|
26 class MPEngOutgoingTransactionHandler; |
|
27 class MPEngIncomingTransactionHandler; |
|
28 |
|
29 |
|
30 |
|
31 // CONSTANTS |
|
32 |
|
33 |
|
34 // CLASS DECLARATION |
|
35 /** |
|
36 * Abstract interface for transaction factories. |
|
37 * |
|
38 * Transaction factories are used to create concrete |
|
39 * transaction handlers. Presence engine subcomponents |
|
40 * like ContactListLibrary and AttributeLibrary |
|
41 * implement concrete transaction factories and |
|
42 * concrete transaction handlers. |
|
43 * |
|
44 * @since 2.1 |
|
45 */ |
|
46 class MPEngTransactionFactory |
|
47 { |
|
48 public: // New functions |
|
49 |
|
50 /** |
|
51 * Clean up stack support for the factory |
|
52 * |
|
53 * Transaction factory will be treated as reference counted |
|
54 * singleton. |
|
55 * @since 3.0 |
|
56 */ |
|
57 virtual void Close( void ) = 0; |
|
58 |
|
59 |
|
60 /** |
|
61 * Factory method to create handler for incoming data |
|
62 * |
|
63 * When incoming message from the Network server arrives, it is |
|
64 * offered to all transaction factories over this interface to |
|
65 * process the data. |
|
66 * If data requires processing, it is done by the Transaction |
|
67 * handler returned by this function call. |
|
68 * If there is no need to process data by the factory, NULL |
|
69 * pointer is returned instead. |
|
70 * |
|
71 * Incoming data is passed to the factory as plain XML as it was |
|
72 * retrieved from the network. |
|
73 * Created Incoming request handler will be then run by |
|
74 * the presence Server to process it. |
|
75 * |
|
76 * @since 3.0 |
|
77 * @param aIncomingRequest XML data as it was retrieved from the |
|
78 * network server. |
|
79 * @return NULL for no processing, or instance of the |
|
80 * incoming transaction handler |
|
81 */ |
|
82 virtual MPEngIncomingTransactionHandler* IncomingTransactionHandlerL( |
|
83 const TDesC8& aIncomingRequest ) = 0; |
|
84 |
|
85 |
|
86 |
|
87 /** |
|
88 * Factory method to create outgoing handler(s) |
|
89 * |
|
90 * This method is called to retrieve handlers for outgoing |
|
91 * operation. |
|
92 * First parameter defines transaction operation from which |
|
93 * factory shall understand if request concerns it. |
|
94 * There is optional parameter which caries data needed |
|
95 * for the operation procession. How ever it can be NULL |
|
96 * if transaction does not require it. |
|
97 * Once transaction handler is created and appended into the |
|
98 * passed array, owner ship of the handler is taken by |
|
99 * the caller of the function. |
|
100 * |
|
101 * @since 3.0 |
|
102 * @param aOperation enumeration of the operation |
|
103 * @param aData optional data needed for operation |
|
104 * @param aHandlers array where newly created handlers |
|
105 * are stored |
|
106 */ |
|
107 virtual void OutgoingTransactionHandlerL( |
|
108 TInt aOperation, |
|
109 const TDesC& aData, |
|
110 RPointerArray<MPEngOutgoingTransactionHandler>& aHandlers ) = 0; |
|
111 |
|
112 |
|
113 |
|
114 protected: //Destructor |
|
115 |
|
116 /** |
|
117 * Virtual inline destructor. |
|
118 * |
|
119 * Concrete factories can't be destroyed |
|
120 * using this interface. |
|
121 * |
|
122 * (Transaction Factories must be implemented as ref counted |
|
123 * singletons.) |
|
124 */ |
|
125 virtual ~MPEngTransactionFactory() {}; |
|
126 }; |
|
127 |
|
128 #endif // __MPENGTRANSACTIONFACTORY_H__ |
|
129 |
|
130 // End of File |
|
131 |