|
1 // Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // |
|
15 |
|
16 /** |
|
17 @file |
|
18 @publishedPartner |
|
19 @released |
|
20 */ |
|
21 |
|
22 #ifndef SYMBIAN_NODEMESSAGES_H |
|
23 #define SYMBIAN_NODEMESSAGES_H |
|
24 |
|
25 #define SYMBIAN_NETWORKING_UPS |
|
26 #include <es_enum.h> |
|
27 #include <elements/nm_signatures.h> |
|
28 #include <elements/nm_address.h> |
|
29 #include <elements/nm_messages_base.h> |
|
30 #include <comms-infras/ss_common.h> |
|
31 #include <comms-infras/ss_logext.h> |
|
32 #include <es_sock.h> |
|
33 #ifdef SYMBIAN_ENABLE_SPLIT_HEADERS |
|
34 #include <es_sock_partner.h> |
|
35 #endif |
|
36 |
|
37 |
|
38 #include <comms-infras/metatype.h> |
|
39 #include <elements/factory.h> |
|
40 |
|
41 #ifdef SYMBIAN_ADAPTIVE_TCP_RECEIVE_WINDOW |
|
42 #include <comms-infras/es_event.h> |
|
43 #endif // SYMBIAN_ADAPTIVE_TCP_RECEIVE_WINDOW |
|
44 |
|
45 #ifdef SYMBIAN_NETWORKING_UPS |
|
46 #include <comms-infras/ss_upsaccesspointconfigext.h> |
|
47 #endif |
|
48 #include <comms-infras/es_parameterfamily.h> |
|
49 #include <comms-infras/ss_parameterfamilybundle.h> |
|
50 |
|
51 |
|
52 #include <comms-infras/ss_refcountowner.h> |
|
53 |
|
54 #include <comms-infras/ss_commsprov.h> |
|
55 |
|
56 namespace ESock |
|
57 { |
|
58 |
|
59 |
|
60 /** |
|
61 Factory query payload base class. |
|
62 Note: The multiple inheritance is safe to do as the vptr size is always less than STypeID |
|
63 size. |
|
64 |
|
65 @publishedPartner |
|
66 @released |
|
67 */ |
|
68 class TFactoryQueryBase : public Meta::SMetaDataNetCtor, public Factories::MFactoryQuery |
|
69 { |
|
70 public: |
|
71 static const TInt KMaxInlineFactoryQuerySize = 48; |
|
72 }; |
|
73 |
|
74 /** |
|
75 Attribute creation policy using Sockman globals. |
|
76 |
|
77 @publishedPartner |
|
78 @released |
|
79 */ |
|
80 class TVCFromSockManAttributeCreationPolicy |
|
81 { |
|
82 public: |
|
83 IMPORT_C static Meta::SMetaData* New(TPtrC8& aSrc, TPtr8& aDst); |
|
84 }; |
|
85 |
|
86 class TAlwaysFindFactoryQuery : public TFactoryQueryBase |
|
87 { |
|
88 protected: |
|
89 IMPORT_C virtual Factories::MFactoryQuery::TMatchResult Match(Factories::TFactoryObjectInfo& aObjectInfo); |
|
90 |
|
91 public: |
|
92 IMPORT_C explicit TAlwaysFindFactoryQuery (); |
|
93 |
|
94 DECLARE_MVIP_CTR(TAlwaysFindFactoryQuery) |
|
95 EXPORT_DATA_VTABLE_AND_FN |
|
96 }; |
|
97 |
|
98 class TMetaConnectionFactoryQuery : public TFactoryQueryBase |
|
99 { |
|
100 public: |
|
101 IMPORT_C TMetaConnectionFactoryQuery(); |
|
102 |
|
103 IMPORT_C explicit TMetaConnectionFactoryQuery(const TProviderInfo& aProviderInfo, const TUid aTierImplUid); |
|
104 |
|
105 protected: |
|
106 IMPORT_C virtual Factories::MFactoryQuery::TMatchResult Match(Factories::TFactoryObjectInfo& aFactoryObjectInfo); |
|
107 |
|
108 public: |
|
109 //We have it by value here as we need the XMetaConnectionFactoryQuery object |
|
110 //to be sent in a message. |
|
111 TProviderInfo iProviderInfo; |
|
112 TUid iTierImplUid; // Tier Implementation Uid == Tier factory id |
|
113 |
|
114 DECLARE_MVIP_CTR(TMetaConnectionFactoryQuery) |
|
115 EXPORT_DATA_VTABLE_AND_FN |
|
116 }; |
|
117 |
|
118 class TDefaultConnectionFactoryQuery : public TFactoryQueryBase |
|
119 /** Class implementing MFactoryQuery to find a connection provider. |
|
120 |
|
121 @publishedPartner |
|
122 @released |
|
123 */ |
|
124 { |
|
125 public: |
|
126 IMPORT_C explicit TDefaultConnectionFactoryQuery(const Messages::TNodeId& aMCprId); |
|
127 |
|
128 |
|
129 IMPORT_C explicit TDefaultConnectionFactoryQuery(); |
|
130 |
|
131 protected: |
|
132 IMPORT_C virtual Factories::MFactoryQuery::TMatchResult Match(Factories::TFactoryObjectInfo& aFactoryObjectInfo); |
|
133 |
|
134 public: |
|
135 const Messages::TNodeId iMCprId; |
|
136 DECLARE_MVIP_CTR(TDefaultConnectionFactoryQuery) |
|
137 EXPORT_DATA_VTABLE_AND_FN |
|
138 }; |
|
139 |
|
140 class TDefaultSCPRFactoryQuery : public TFactoryQueryBase |
|
141 /** |
|
142 @publishedPartner |
|
143 @released |
|
144 */ |
|
145 { |
|
146 public: |
|
147 IMPORT_C TDefaultSCPRFactoryQuery(); |
|
148 |
|
149 //used to look up sub-connection from control side |
|
150 IMPORT_C TDefaultSCPRFactoryQuery(const Messages::TNodeId& aControlProvider, TSubConnOpen::TSubConnType aSCPRType); |
|
151 protected: |
|
152 IMPORT_C virtual Factories::MFactoryQuery::TMatchResult Match(Factories::TFactoryObjectInfo& aFactoryObjectInfo); |
|
153 public: |
|
154 Messages::TNodeId iControlProvider; |
|
155 TSubConnOpen::TSubConnType iSCPRType; //default/reserved |
|
156 |
|
157 DECLARE_MVIP_CTR(TDefaultSCPRFactoryQuery) |
|
158 EXPORT_DATA_VTABLE_AND_FN |
|
159 }; |
|
160 |
|
161 class TDefaultFlowFactoryQuery : public TFactoryQueryBase |
|
162 /** |
|
163 @publishedPartner |
|
164 @released |
|
165 */ |
|
166 { |
|
167 public: |
|
168 IMPORT_C TDefaultFlowFactoryQuery(); |
|
169 |
|
170 IMPORT_C TDefaultFlowFactoryQuery(const Messages::TNodeId& aSCprId); |
|
171 IMPORT_C TDefaultFlowFactoryQuery(const Messages::TNodeId& aCprId, const Messages::TNodeId& aSCprId); |
|
172 IMPORT_C TDefaultFlowFactoryQuery(const Messages::TNodeId& aCprId, const Messages::TNodeId& aSCprId, Messages::TNodeSignal::TMessageId aMessageId, TInt aProtocolType); |
|
173 protected: |
|
174 IMPORT_C virtual Factories::MFactoryQuery::TMatchResult Match(Factories::TFactoryObjectInfo& aFactoryObjectInfo); |
|
175 public: |
|
176 Messages::TNodeId iCprId; |
|
177 Messages::TNodeId iSCprId; |
|
178 Messages::TNodeSignal::TMessageId iMessageId; |
|
179 TInt iProtocolType; |
|
180 |
|
181 DECLARE_MVIP_CTR(TDefaultFlowFactoryQuery) |
|
182 EXPORT_DATA_VTABLE_AND_FN |
|
183 }; |
|
184 |
|
185 class TDefaultProtocolIntfFactoryQuery : public TFactoryQueryBase |
|
186 /** |
|
187 @publishedPartner |
|
188 @released |
|
189 */ |
|
190 { |
|
191 public: |
|
192 IMPORT_C TDefaultProtocolIntfFactoryQuery(); |
|
193 IMPORT_C TDefaultProtocolIntfFactoryQuery(const Messages::TNodeId& aCprId); |
|
194 |
|
195 protected: |
|
196 IMPORT_C virtual Factories::MFactoryQuery::TMatchResult Match(Factories::TFactoryObjectInfo& aFactoryObjectInfo); |
|
197 public: |
|
198 Messages::TNodeId iCprId; |
|
199 DECLARE_MVIP_CTR(TDefaultProtocolIntfFactoryQuery) |
|
200 EXPORT_DATA_VTABLE_AND_FN |
|
201 }; |
|
202 |
|
203 |
|
204 DECLARE_MESSAGE_SIG_1(SigFamilyBundle, RCFParameterFamilyBundleC, FamilyBundle) |
|
205 DECLARE_MESSAGE_SIG_2(SigNumberFamilyBundle, TInt, Value, RCFParameterFamilyBundleC, FamilyBundle) |
|
206 DECLARE_MESSAGE_SIG_3(SigPlayerRoleUidFactoryQuery, TInt, FactoryContainerType, TUid, Uid, ESock::TFactoryQueryBase*, Query) |
|
207 DECLARE_MESSAGE_SIG_1(SigSubConnParams, CSubConParameterBundle*, SubConParameterBundle) |
|
208 DECLARE_MESSAGE_SIG_2(SigNumberSubConnParams, TInt, Value, const CSubConParameterBundle*, SubConParameterBundle) |
|
209 DECLARE_MESSAGE_SIG_2(SigBundleRMessage2, CRefCountOwnedParameterBundle*, Bundle, const RMessage2*, Message) |
|
210 DECLARE_MESSAGE_SIG_1(SigBundle, CRefCountOwnedParameterBundle*, Bundle) |
|
211 DECLARE_MESSAGE_SIG_3(SigNodeIdClientTypeUid, Messages::TNodeId, NodeId, Messages::TClientType, ClientType, TUid, Uid) |
|
212 DECLARE_MESSAGE_SIG_3(SigNodeIdClientTypeNumber, Messages::TNodeId, NodeId, Messages::TClientType, ClientType, TUint, Value) |
|
213 |
|
214 |
|
215 /** |
|
216 Message signature to carry and own a reference on a RMetaExtensionContainerC |
|
217 The reference will be automatically aquired upon explicit construction |
|
218 The reference will be automatically released after dispatch or on error |
|
219 The RMetaExtensionContainerC to be posted MUST be open else a panic will occur (in udeb) |
|
220 */ |
|
221 struct TSigMetaExtContainer : public Messages::TSignatureBase |
|
222 { |
|
223 public: |
|
224 IMPORT_C virtual void DispatchL(const Messages::TRuntimeCtxId& aSender, const Messages::TRuntimeCtxId& aRecipient); |
|
225 IMPORT_C virtual void Error(const Messages::TRuntimeCtxId& aSender, const Messages::TRuntimeCtxId& aRecipient, TInt aError); |
|
226 |
|
227 protected: |
|
228 inline TSigMetaExtContainer() {} |
|
229 inline explicit TSigMetaExtContainer(const Messages::TNodeSignal::TMessageId& aMessageId, RMetaExtensionContainerC& aConfig) |
|
230 : Messages::TSignatureBase(aMessageId), iConfig(aConfig) |
|
231 { |
|
232 } |
|
233 |
|
234 public: |
|
235 DECLARE_MVIP_CTR( TSigMetaExtContainer ) |
|
236 EXPORT_DATA_VTABLE_AND_FN |
|
237 RMetaExtensionContainerC iConfig; |
|
238 }; |
|
239 |
|
240 template<TInt id, TInt32 realm> |
|
241 class TMessageSigMetaExtContainer : public TSigMetaExtContainer, public Messages::TSignatureBase::TTypeToMessageId<id, realm> |
|
242 { |
|
243 public: |
|
244 explicit TMessageSigMetaExtContainer(RMetaExtensionContainerC& aConfig) |
|
245 : TSigMetaExtContainer(Messages::TNodeSignal::TMessageId(id, realm), aConfig) |
|
246 { |
|
247 } |
|
248 }; |
|
249 |
|
250 |
|
251 |
|
252 template<TInt id, TInt32 realm> |
|
253 class TMessageSigFamilyBundleDefaultToNull : public TSigFamilyBundle, public Messages::TSignatureBase::TTypeToMessageId<id, realm> |
|
254 /** |
|
255 Message to carry a RCFParameterFamilyBundle. |
|
256 Can be instantiated with no parameters, in which case the null RCFParameterFamilyBundle is used |
|
257 */ |
|
258 { |
|
259 public: |
|
260 TMessageSigFamilyBundleDefaultToNull(const RCFParameterFamilyBundleC& aFamilyBundle = RCFParameterFamilyBundleC()) |
|
261 : TSigFamilyBundle(Messages::TNodeSignal::TMessageId(id, realm), aFamilyBundle) |
|
262 {} |
|
263 }; |
|
264 |
|
265 template<TInt id, TInt32 realm> |
|
266 class TMessageSigNumberDefaultFamilyBundleDefaultToNull : public TSigNumberFamilyBundle, public Messages::TSignatureBase::TTypeToMessageId<id, realm> |
|
267 /** |
|
268 Message to carry a Number and a RCFParameterFamilyBundle. |
|
269 Can be instantiated with no parameters, in which case 0 and the null RCFParameterFamilyBundle are used. |
|
270 */ |
|
271 { |
|
272 public: |
|
273 TMessageSigNumberDefaultFamilyBundleDefaultToNull(TInt aValue = 0, const RCFParameterFamilyBundleC& aFamilyBundle = RCFParameterFamilyBundleC()) |
|
274 : TSigNumberFamilyBundle(Messages::TNodeSignal::TMessageId(id, realm), aValue, aFamilyBundle) |
|
275 {} |
|
276 }; |
|
277 |
|
278 template<TInt id, TInt32 realm> |
|
279 class TCFMessageSigNodeIdClientTypeNumberDefault : public TSigNodeIdClientTypeNumber, public Messages::TSignatureBase::TTypeToMessageId<id, realm> |
|
280 { |
|
281 public: |
|
282 TCFMessageSigNodeIdClientTypeNumberDefault(Messages::TNodeId aNodeId, Messages::TClientType aClientType, TUint aValue = 0) |
|
283 : TSigNodeIdClientTypeNumber(Messages::TNodeSignal::TMessageId(id, realm), aNodeId, aClientType, aValue) |
|
284 {} |
|
285 }; |
|
286 |
|
287 } //namespace ESock |
|
288 |
|
289 namespace Meta |
|
290 { |
|
291 // Ugly hack: mingw does not evaulate macros early enough to pass as template arguments so we hard code the |
|
292 // value for the x86gcc platform. A compile time assertion ensures that the value stays correct. |
|
293 #if defined(__GCCXML__) || defined(__X86GCC__) |
|
294 #define KSigPlayerRoleUidFactory_iQuery 20 |
|
295 #else |
|
296 #define KSigPlayerRoleUidFactory_iQuery ( _FOFF(ESock::TSigPlayerRoleUidFactoryQuery, iQuery) ) |
|
297 #endif |
|
298 |
|
299 __ASSERT_COMPILE( KSigPlayerRoleUidFactory_iQuery == _FOFF(ESock::TSigPlayerRoleUidFactoryQuery, iQuery) ); |
|
300 |
|
301 typedef Messages::TSignatureWithPolymorphicPayloadMetaType<ESock::TSigPlayerRoleUidFactoryQuery, KSigPlayerRoleUidFactory_iQuery, ESock::TVCFromSockManAttributeCreationPolicy> TMetaHandler; |
|
302 } |
|
303 |
|
304 |
|
305 #ifndef SYMBIAN_ENABLE_SPLIT_HEADERS |
|
306 #include <addressupdate.h> |
|
307 #endif |
|
308 |
|
309 #endif //SYMBIAN_NODEMESSAGES_H |
|
310 |