|
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: Document structure validator. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef CWPVALIDATOR_H |
|
20 #define CWPVALIDATOR_H |
|
21 |
|
22 // INCLUDES |
|
23 #include <e32base.h> |
|
24 #include <s32std.h> |
|
25 #include "MWPVisitor.h" |
|
26 |
|
27 // FORWARD DECLARATIONS |
|
28 class MWPElement; |
|
29 struct TMapping; |
|
30 |
|
31 // CLASS DECLARATION |
|
32 |
|
33 /** |
|
34 * CWPValidator is document structure validator. |
|
35 * |
|
36 * @lib ProvisioningEngine |
|
37 * @since 2.0 |
|
38 */ |
|
39 class CWPValidator : public CBase, public MWPVisitor |
|
40 { |
|
41 public: // Constructors and destructor |
|
42 |
|
43 /** |
|
44 * Two-phased constructor. |
|
45 */ |
|
46 static CWPValidator* NewL(); |
|
47 |
|
48 /** |
|
49 * Two-phased constructor. |
|
50 */ |
|
51 static CWPValidator* NewLC(); |
|
52 |
|
53 /** |
|
54 * Destructor. |
|
55 */ |
|
56 ~CWPValidator(); |
|
57 |
|
58 public: // From MWPVisitor |
|
59 |
|
60 void VisitL(CWPCharacteristic& aCharacteristic); |
|
61 void VisitL(CWPParameter& aParameter); |
|
62 void VisitLinkL(CWPCharacteristic& aCharacteristic ); |
|
63 |
|
64 private: |
|
65 /** |
|
66 * Checks if the current element can contain an element |
|
67 * of type aTo and retrieves the new validating table. |
|
68 * @param aTo The element to check |
|
69 */ |
|
70 void MapToL( MWPElement& aTo ); |
|
71 TBool Rangecheck(const TInt toType); |
|
72 |
|
73 private: |
|
74 /** |
|
75 * C++ default constructor. |
|
76 */ |
|
77 CWPValidator(); |
|
78 |
|
79 /** |
|
80 * By default Symbian 2nd phase constructor is private. |
|
81 */ |
|
82 void ConstructL(); |
|
83 |
|
84 private: |
|
85 /// Currently possible mappings |
|
86 const TMapping* iCurrentMapping; |
|
87 |
|
88 /// Currently handled element |
|
89 const MWPElement* iCurrentElement; |
|
90 TBool iFlag; |
|
91 }; |
|
92 |
|
93 #endif /* CWPENGINE_H */ |