|
1 // Copyright (c) 2000-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 #ifndef EXTRACTORVISITOR_H |
|
17 #define EXTRACTORVISITOR_H |
|
18 |
|
19 #include <e32base.h> |
|
20 #include <btsdp.h> |
|
21 #include "sdputil.h" |
|
22 #include "MAttributeVisitor.h" |
|
23 #include "DataEncoder.h" |
|
24 |
|
25 class CSdpAttr; |
|
26 class CSdpServRecord; |
|
27 class CSdpAttrIdMatchList; |
|
28 |
|
29 class MAttributeMatchHandler |
|
30 { |
|
31 public: |
|
32 virtual void AttributeInMatchListL(CSdpAttr &aAttr)=0; |
|
33 }; |
|
34 |
|
35 |
|
36 NONSHARABLE_CLASS(CAttrExtractVisitor) : public CBase, private MAttributeVisitor, public MAttributeMatchHandler |
|
37 { |
|
38 public: |
|
39 static CAttrExtractVisitor *NewLC(TElementEncoder aEncoder); |
|
40 static CAttrExtractVisitor *NewL(TElementEncoder aEncoder); |
|
41 ~CAttrExtractVisitor(); |
|
42 |
|
43 IMPORT_C static void EncodeAttributesL(TElementEncoder aEncoder, CSdpServRecord &aRec, CSdpAttrIdMatchList &aList); |
|
44 |
|
45 private: |
|
46 CAttrExtractVisitor(TElementEncoder aEncoder); |
|
47 void ConstructL(); |
|
48 |
|
49 |
|
50 |
|
51 // Implementation of MAttributeVisitor interface |
|
52 void VisitAttributeL(CSdpAttr &aAttribute); |
|
53 void VisitAttributeValueL(CSdpAttrValue &aValue, TSdpElementType aType); |
|
54 void StartListL(CSdpAttrValueList &aList); |
|
55 void EndListL(); |
|
56 |
|
57 // Implementation of MAttributeMatchHandler |
|
58 void AttributeInMatchListL(CSdpAttr &aAttr); |
|
59 |
|
60 private: |
|
61 TElementEncoder iEncoder; |
|
62 }; |
|
63 |
|
64 #endif |