|
1 // Copyright (c) 2001-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 // This file contains the definition of the SMILDTD class |
|
15 // |
|
16 // |
|
17 /** |
|
18 * @file |
|
19 * @publishedPartner |
|
20 * @released |
|
21 */ |
|
22 #ifndef __SMILDTD_H__ |
|
23 #define __SMILDTD_H__ |
|
24 |
|
25 #include <e32def.h> |
|
26 #include <gmxmldocument.h> |
|
27 #include "smildtdenum.h" |
|
28 |
|
29 /** |
|
30 MXMLDtd is a mixin class. If User wants to derive from MXMLDtd class , |
|
31 then one should not derive from any other class at the same time. |
|
32 i.e A class can not derive from CBase at all using MXMLDtd. |
|
33 |
|
34 Represents the SMIL DTD. |
|
35 It is used for validation of SMIL documents. |
|
36 @publishedPartner |
|
37 @released |
|
38 */ |
|
39 class CSMILDtd: public MXMLDtd |
|
40 { |
|
41 public: |
|
42 |
|
43 /** Allocates and constructs a new SMIL DTD validator. |
|
44 |
|
45 @leave KErrNoMemory Out of memory |
|
46 @return New SMIL DTD validator */ |
|
47 IMPORT_C static CSMILDtd* NewL(); |
|
48 |
|
49 /** Allocates and constructs a new SMIL DTD validator, leaving the object on the |
|
50 cleanup stack. |
|
51 |
|
52 @leave KErrNoMemory Out of memory |
|
53 @return New SMIL DTD validator */ |
|
54 IMPORT_C static CSMILDtd* NewLC(); |
|
55 |
|
56 /** Destructor. */ |
|
57 IMPORT_C virtual ~CSMILDtd(); |
|
58 |
|
59 protected: |
|
60 /* |
|
61 * Function to determine whether an Element name is valid in DTD |
|
62 * @return ETrue the if element name valid - else EFalse |
|
63 * @param aElement the element name to be tested |
|
64 * @leave can leave due to OOM |
|
65 */ |
|
66 virtual TBool IsValidElementL(const TDesC& aElement) const; |
|
67 |
|
68 /* |
|
69 * Function to determine whether an attribute name and value is valid in DTD |
|
70 * @return KErrNone if name&value are valid, KXMLBadAttributeName if attrib name invalid |
|
71 * KXMLBadAttributeValue if attrib value invalid |
|
72 * @param aElement the element to which the attributes belong |
|
73 * @param aAttribute the attribute to be tested |
|
74 * @leave aAttributeValue the attributeValue to be tested |
|
75 * @leave can leave due to OOM |
|
76 */ |
|
77 |
|
78 virtual TInt IsValidAttributeForElementL(const TDesC& aElement, const TDesC& aAttribute, const TDesC& aAttributeValue) const; |
|
79 |
|
80 /* |
|
81 * Function to determine whether the parent/child relationship is valid in DTD |
|
82 * @return ETrue if parent/child relationship is valid |
|
83 * @param aParentElement the name of the parent element to be tested |
|
84 * @param aChildElements an array of child element name to be tested |
|
85 * @leave can leave due to OOM |
|
86 */ |
|
87 |
|
88 virtual TBool AreValidChildElementsL(const TDesC& aParentElement, const CDesCArray& aChildElements) const; |
|
89 |
|
90 |
|
91 /* |
|
92 * Function to determine whether it is valid for a particular element to |
|
93 * have children |
|
94 * @param aElement the name of the element to be tested |
|
95 * @return ETrue if it is valid for element to have children |
|
96 */ |
|
97 virtual TBool CanElementHaveChildren(const TDesC& aElement) const; |
|
98 |
|
99 |
|
100 /* |
|
101 * Constructor |
|
102 */ |
|
103 CSMILDtd(); |
|
104 |
|
105 private: |
|
106 /* |
|
107 * Second stage constructor |
|
108 */ |
|
109 void ConstructL(); |
|
110 |
|
111 TBool CheckValidChildren(const TSMILDTDChildStateType aStateTrans[],TInt aStateCount, const CDesCArray& aChildElements) const; |
|
112 |
|
113 }; |
|
114 |
|
115 #endif |
|
116 |
|
117 |
|
118 |