|
1 /* |
|
2 * Copyright (c) 2002-2005 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 IDWSF_DISCOVERY_SERVICE_CLIENT |
|
26 #define IDWSF_DISCOVERY_SERVICE_CLIENT |
|
27 |
|
28 // INCLUDES |
|
29 #include <e32base.h> |
|
30 #include <badesca.h> |
|
31 #include <flogger.h> |
|
32 |
|
33 #include "midwsfsessionvalidator.h" |
|
34 |
|
35 #include "idwsfcoreserviceconsumer.h" |
|
36 |
|
37 |
|
38 // CONSTANTS |
|
39 _LIT8(KDiscoOption,"urn:com.nokia.serene.idwsf:disco:option"); |
|
40 |
|
41 // FORWARD DECLARATIONS |
|
42 class CIdWsfServiceSession; |
|
43 class CIdWsfDsQueryResponse; |
|
44 |
|
45 // DATA TYPES |
|
46 typedef RPointerArray<CIdWsfServiceSession> RSessionArray; |
|
47 |
|
48 // CLASS DECLARATION |
|
49 class CIdWsfDiscoveryServiceClient : public CIdWsfCoreServiceConsumer, |
|
50 public MIdWsfSessionValidator |
|
51 { |
|
52 public: // Constructors and destructor |
|
53 |
|
54 static CIdWsfDiscoveryServiceClient* NewL(CSIF& aSIF);//, |
|
55 //RFileLogger& aLogger); |
|
56 |
|
57 static CIdWsfDiscoveryServiceClient* NewLC(CSIF& aSIF);//, |
|
58 //RFileLogger& aLogger); |
|
59 |
|
60 ~CIdWsfDiscoveryServiceClient(); |
|
61 |
|
62 // New functions |
|
63 |
|
64 /** |
|
65 * @return KErrNotFound, if no known security mechanism was found |
|
66 * KErrNotReady, if no service session has been initialized |
|
67 */ |
|
68 virtual TInt ValidateL(CIdWsfServiceSession& aSession, |
|
69 MSenRemoteServiceConsumer& aRemoteConsumer); |
|
70 |
|
71 virtual void SetStatusL(const TInt aStatus); |
|
72 |
|
73 /** |
|
74 * @return KErrNotFound, if no known security mechanism was found |
|
75 */ |
|
76 virtual TInt FindServiceL(RPointerArray<CSenWSDescription>& aServiceArray, |
|
77 MSenServiceDescription& aPattern, |
|
78 MSenRemoteServiceConsumer& aRemoteConsumer); |
|
79 |
|
80 static TInt DSOptionsL(RFacetArray& aOptionArray, |
|
81 MSenServiceDescription& aServiceDescription); |
|
82 |
|
83 virtual TBool HasSuperClass( TDescriptionClassType aType ); |
|
84 virtual void SetDataTrafficDetails( TSenDataTrafficDetails& aDetails) ; |
|
85 |
|
86 protected: |
|
87 |
|
88 /** |
|
89 * C++ default constructor. |
|
90 */ |
|
91 CIdWsfDiscoveryServiceClient(CSIF& aSIF, TDescriptionClassType aType);//RFileLogger& aLogger); |
|
92 |
|
93 /** |
|
94 * By default Symbian 2nd phase constructor is private. |
|
95 */ |
|
96 void BaseConstructL(); |
|
97 |
|
98 // New functions |
|
99 |
|
100 /** |
|
101 * @return KErrNotFound, if no known security mechanism was found |
|
102 */ |
|
103 virtual TInt ProcessResponseL(CIdWsfDsQueryResponse* aResponse); |
|
104 //RFileLogger* Log() const; |
|
105 |
|
106 private: // New functions |
|
107 |
|
108 HBufC8* CIdWsfDiscoveryServiceClient::DsLookupRequestL(MSenServiceDescription& aPattern); |
|
109 |
|
110 CIdWsfDsQueryResponse* ParseResponseLC(TDesC8& aMessage); |
|
111 //void SetStatusL(TInt aStatus); |
|
112 |
|
113 protected: // Data |
|
114 enum TClientState |
|
115 { |
|
116 ENotInitialized = 1, |
|
117 EHasSession, |
|
118 EHasResults, |
|
119 EAuthServiceClient, |
|
120 ESaslMechanism |
|
121 }; |
|
122 |
|
123 TClientState iCState; |
|
124 CIdWsfServiceSession* iSession; // Not owned |
|
125 |
|
126 private: // Data |
|
127 //RFileLogger& iLog; |
|
128 RSessionArray iResults; |
|
129 TSenDataTrafficDetails iDiscDetails; |
|
130 }; |
|
131 |
|
132 #endif //IDWSF_DISCOVERY_SERVICE_CLIENT |
|
133 |
|
134 // End of File |