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