1 /* |
|
2 * Copyright (c) 2002 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: TWPIMVisitor crawls a logical proxy |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 // INCLUDE FILES |
|
21 #include <e32base.h> |
|
22 #include <CWPCharacteristic.h> |
|
23 #include <CWPParameter.h> |
|
24 #include "TWPIMVisitor.h" |
|
25 |
|
26 // CONSTANTS |
|
27 const TInt KNumNames = 1; |
|
28 |
|
29 // ============================ MEMBER FUNCTIONS =============================== |
|
30 |
|
31 // ----------------------------------------------------------------------------- |
|
32 // TWPIMVisitor::TWPIMVisitor |
|
33 // C++ default constructor can NOT contain any code, that |
|
34 // might leave. |
|
35 // ----------------------------------------------------------------------------- |
|
36 // |
|
37 TWPIMVisitor::TWPIMVisitor() |
|
38 { |
|
39 iNapDef = NULL; |
|
40 iName.Set( KNullDesC ); |
|
41 } |
|
42 |
|
43 // ----------------------------------------------------------------------------- |
|
44 // TWPIMVisitor::VisitL |
|
45 // ----------------------------------------------------------------------------- |
|
46 // |
|
47 void TWPIMVisitor::VisitL( CWPParameter& aElement ) |
|
48 { |
|
49 switch( aElement.ID() ) |
|
50 { |
|
51 case EWPParameterName: |
|
52 if( iName == KNullDesC ) |
|
53 { |
|
54 iName.Set( aElement.Value() ); |
|
55 } |
|
56 break; |
|
57 |
|
58 default: |
|
59 break; |
|
60 } |
|
61 } |
|
62 |
|
63 // ----------------------------------------------------------------------------- |
|
64 // TWPIMVisitor::VisitL |
|
65 // ----------------------------------------------------------------------------- |
|
66 // |
|
67 void TWPIMVisitor::VisitL( CWPCharacteristic& aElement ) |
|
68 { |
|
69 if( !iNapDef && aElement.Type() == KWPPxPhysical ) |
|
70 { |
|
71 aElement.AcceptL( *this ); |
|
72 } |
|
73 } |
|
74 |
|
75 // ----------------------------------------------------------------------------- |
|
76 // TWPIMVisitor::VisitLinkL |
|
77 // ----------------------------------------------------------------------------- |
|
78 // |
|
79 void TWPIMVisitor::VisitLinkL( CWPCharacteristic& aLink ) |
|
80 { |
|
81 if( !iNapDef && aLink.Type() == KWPNapDef ) |
|
82 { |
|
83 iNapDef = &aLink; |
|
84 } |
|
85 }; |
|
86 |
|
87 |
|
88 |
|
89 // End of File |
|