|
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: Header for MXIMPHost |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef M_PSCHOST_H |
|
21 #define M_PSCHOST_H |
|
22 |
|
23 #include <ximpbase.h> |
|
24 |
|
25 #include "ximphoststates.h" |
|
26 #include "ximpoperationdefs.h" |
|
27 |
|
28 class MXIMPProtocolConnection; |
|
29 class CXIMPApiEventBase; |
|
30 class MXIMPPscContext; |
|
31 class CXIMPPscContext; |
|
32 class CXIMPServiceInfoImp; |
|
33 class CPresenceDataCache; |
|
34 class CXIMPOperationBase; |
|
35 class CXIMPRestrictedObjectCollectionImp; |
|
36 class CProtocolPresenceAuthorizationDataHostImp; |
|
37 class CProtocolPresencePublishingDataHostImp; |
|
38 class CProtocolPresenceWatchingDataHostImp; |
|
39 class CProtocolPresentityGroupsDataHostImp; |
|
40 class CProtocolPresenceDataHostImp; |
|
41 class MProtocolDataHost; |
|
42 |
|
43 /** |
|
44 * ?one_line_short_description |
|
45 * |
|
46 * ?more_complete_description |
|
47 * |
|
48 * @lib ?library |
|
49 * @since S60 v4.0 |
|
50 */ |
|
51 class MXIMPHost |
|
52 { |
|
53 public: |
|
54 |
|
55 /** |
|
56 * Mark a reference to this object. |
|
57 */ |
|
58 virtual void Open() = 0; |
|
59 |
|
60 /** |
|
61 * Remove a reference to this object. |
|
62 * Once all references are removed, the class destroys itself. |
|
63 */ |
|
64 virtual void Close() = 0; |
|
65 |
|
66 /** |
|
67 * @return The currently used connection, Can be NULL if protocol not in use. |
|
68 */ |
|
69 virtual MXIMPProtocolConnection& GetConnection() const = 0; |
|
70 |
|
71 /** |
|
72 * Add the given event to the event manager. The event will |
|
73 * go to the given session. |
|
74 * @param aEvent The event |
|
75 * @param aContext The session context. If NULL -> send to all contexts. |
|
76 */ |
|
77 virtual void AddEventL( CXIMPApiEventBase& aEvent, MXIMPPscContext* aContext = NULL ) = 0; |
|
78 |
|
79 /** |
|
80 * Add preserved event to the event manager. The event will |
|
81 * go to the given session. |
|
82 * @param aEvent The event |
|
83 * @param aContext The session context |
|
84 */ |
|
85 virtual void ActivateEventL( CXIMPApiEventBase& aEvent, MXIMPPscContext* aContext ) = 0; |
|
86 |
|
87 /** |
|
88 * Unregister session when not needed anymore. |
|
89 * @param aContext Unregistered context. |
|
90 */ |
|
91 virtual void UnregisterSession( CXIMPPscContext* aContext ) = 0; |
|
92 |
|
93 /** |
|
94 * Fake a request complete event to |
|
95 * currently run operation. |
|
96 * @param aResult The result |
|
97 */ |
|
98 virtual void FakeCompleteRequest( TXIMPRequestId aReqId, TInt aResult ) = 0; |
|
99 |
|
100 /** |
|
101 * Request complete for adaptation operation |
|
102 * @param aResult The result |
|
103 */ |
|
104 virtual void HandleAdaptationRequestCompleted( TXIMPRequestId aReqId, TInt aResult ) = 0; |
|
105 |
|
106 /** |
|
107 * Request complete for adaptation operation, related |
|
108 * to session management |
|
109 * @param aResult The result |
|
110 */ |
|
111 virtual void HandleSessionMgmtRequestCompleted( TXIMPRequestId aReqId, TInt aResult ) = 0; |
|
112 |
|
113 /** |
|
114 * Request complete for internal operation |
|
115 * @param aResult The result |
|
116 */ |
|
117 virtual void HandleInternalRequestCompleted( TXIMPRequestId aReqId, TInt aResult ) = 0; |
|
118 |
|
119 /** |
|
120 * Access to data cache. |
|
121 */ |
|
122 virtual CProtocolPresenceDataHostImp& PresenceDataAccess() = 0; |
|
123 |
|
124 /** |
|
125 * to get corresponding protocol host from the array of hosts. |
|
126 * @param aInterfaceId host object interface id |
|
127 */ |
|
128 virtual TAny* GetProtocolHost(TInt aInterfaceId) = 0 ; |
|
129 |
|
130 /* virtual CPresenceDataCache& DataAccess() = 0; |
|
131 virtual CProtocolPresenceAuthorizationDataHostImp& AuthorizationDataAccess() = 0; |
|
132 virtual CProtocolPresencePublishingDataHostImp& PublishingDataAccess() = 0; |
|
133 virtual CProtocolPresenceWatchingDataHostImp& WatchingDataAccess() = 0; |
|
134 virtual CProtocolPresentityGroupsDataHostImp& GroupsDataAccess() = 0; |
|
135 */ |
|
136 |
|
137 |
|
138 /** |
|
139 * Add new operation to the internal queue of operations. Ownership is transferred. |
|
140 * @param aOperation The operation to add. |
|
141 */ |
|
142 virtual void AddNewOperationL( CXIMPOperationBase& aOperation ) = 0; |
|
143 |
|
144 /** |
|
145 * Add new operation for processing. |
|
146 */ |
|
147 virtual TXIMPRequestId AddNewOperationL( CXIMPOperationBase* aOperation ) = 0; |
|
148 |
|
149 /** |
|
150 * Do forced teardown by activating all valid cached unbinds. |
|
151 */ |
|
152 virtual void ForcedTeardownL() = 0; |
|
153 |
|
154 /** |
|
155 * Start cleaner timer if not started already. |
|
156 */ |
|
157 virtual void StartCleanerTimer() = 0; |
|
158 |
|
159 /** |
|
160 * Create operation and add it to process queue. |
|
161 */ |
|
162 virtual TXIMPRequestId AddNewOperationL( |
|
163 TInt aOperation, MXIMPBase* aParam, MXIMPBase* aParam2 = NULL ) = 0; |
|
164 |
|
165 |
|
166 /** |
|
167 * Return the protocol ID of the host |
|
168 */ |
|
169 |
|
170 virtual TInt32 ProtocolUID( ) = 0; |
|
171 |
|
172 protected: |
|
173 |
|
174 /** |
|
175 * Protected destructor. |
|
176 * Instancies can't be destroyed via this interface. |
|
177 */ |
|
178 virtual ~MXIMPHost() {}; |
|
179 |
|
180 }; |
|
181 |
|
182 |
|
183 #endif // M_PSCHOST_H |
|
184 |
|
185 |