Annotation of Amaya/amaya/templates.h, revision 1.6

1.1       francesc    1: #ifndef TEMPLATE_TEMPLATES
                      2: #define TEMPLATE_TEMPLATES
                      3: 
                      4: #define THOT_EXPORT extern
                      5: #include "amaya.h"
                      6: #include "document.h"
1.2       francesc    7: #include "mydictionary.h"
1.1       francesc    8: 
1.5       quint       9: /* Structure of a template */
                     10: struct _XTigerTemplate;
                     11: typedef struct _XTigerTemplate *XTigerTemplate;
                     12: 
                     13: //Private structure of a template
                     14: struct _XTigerTemplate
                     15: {      
                     16:   ThotBool        isLibrary;                   //Is this a library? (otherway it's a template)
                     17:   ThotBool        isPredefined;   //Is this the predefined library
                     18:   DicDictionary   libraries;                   //Imported libraries
                     19:   DicDictionary   simpleTypes;         //All simple types declared in the document
                     20:   DicDictionary   elements;                            //All element types declared in the document
                     21:   DicDictionary   components;                  //All component types declared in the document
                     22:   DicDictionary   unions;                                //All union types declared in the document
                     23:   Document        doc;            //Use to store component structures
                     24:   int             users;          //Number of documents using this template
                     25: };
                     26: 
1.6     ! quint      27: typedef enum _TypeNature {SimpleTypeNat, XmlElementNat, ComponentNat,
        !            28:                           UnionNat} TypeNature;
        !            29: 
        !            30: // XTiger simple type
        !            31: typedef enum _SimpleTypeType {XTNumber, XTString, XTBoolean} SimpleTypeType;
        !            32: 
1.5       quint      33: /* Structure of a Declaration */
                     34: 
                     35: typedef struct _XmlElement
                     36: {
                     37:        char    *name;
                     38: } XmlElement;
                     39: 
                     40: typedef struct _SimpleType
                     41: {
                     42:        SimpleTypeType type;
                     43: } SimpleType;
                     44: 
                     45: typedef struct _Component
                     46: {
                     47:        Element        content;
                     48: } Component;
                     49: 
                     50: typedef struct _Union
                     51: {
                     52:        DicDictionary  include; //Dictionary<Declaration>
                     53:        DicDictionary  exclude; //Dictionary<Declaration>
                     54: } Union;
                     55: 
1.6     ! quint      56: /* Structure of a declaration */
        !            57: struct _Declaration;
        !            58: typedef struct _Declaration *Declaration;
        !            59: 
1.5       quint      60: struct _Declaration
                     61: {
                     62:        char          *name;
                     63:        TypeNature     nature;
                     64:        XTigerTemplate declaredIn;
                     65:        union
                     66:        {
                     67:                SimpleType   simpleType;
                     68:                Component    componentType;
                     69:                Union        unionType;
                     70:                XmlElement   elementType;
                     71:        };
                     72: };
                     73: 
                     74: struct menuType
                     75: {
1.6     ! quint      76:        char        *label;
        !            77:        TypeNature   type;
1.5       quint      78: };
1.2       francesc   79: 
1.1       francesc   80: #endif /* TEMPLATE_TEMPLATES */

Webmaster