Salome HOME
PR: mergefrom_PAL_OCC_21Oct04
[modules/kernel.git] / src / DataTypeCatalog / SALOME_DataTypeCatalog_Handler.hxx
1 //  SALOME DataTypeCatalog : catalog of data types
2 //
3 //  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 //  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
5 // 
6 //  This library is free software; you can redistribute it and/or 
7 //  modify it under the terms of the GNU Lesser General Public 
8 //  License as published by the Free Software Foundation; either 
9 //  version 2.1 of the License. 
10 // 
11 //  This library is distributed in the hope that it will be useful, 
12 //  but WITHOUT ANY WARRANTY; without even the implied warranty of 
13 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
14 //  Lesser General Public License for more details. 
15 // 
16 //  You should have received a copy of the GNU Lesser General Public 
17 //  License along with this library; if not, write to the Free Software 
18 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
19 // 
20 //  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org 
21 //
22 //
23 //
24 //  File   : SALOME_DataTypeCatalog_Handler.hxx
25 //  Author : Estelle Deville
26 //  Module : SALOME
27 //  $Header$
28
29 #ifndef SALOME_DATA_CATALOG_HANDLER_H
30 #define SALOME_DATA_CATALOG_HANDLER_H
31
32 #include "SALOME_DataTypeCatalog_Parser.hxx"
33 #include <qxml.h>
34 #include <string>
35 #include <vector>
36
37 class SALOME_DataTypeCatalog_Handler : public QXmlDefaultHandler 
38 {
39 public:
40   //! standard constructor
41   SALOME_DataTypeCatalog_Handler();
42
43   //! standard destructor
44   virtual ~SALOME_DataTypeCatalog_Handler();
45
46
47   //! method to overload handler function startDocument
48   /*! Is called before a xml file is parsed
49    \return true if no error was detected
50   */ 
51   virtual bool startDocument();
52
53
54   //! method to overload handler function startElement
55   /*! 
56    \param Qstring argument by value
57    \param Qstring argument by value
58    \param Qstring argument by value
59    \param QXmlAttributes argument by value
60    \return true if no error was detected
61   */
62   virtual bool startElement(const QString&, const QString &,
63                             const QString& qName, const QXmlAttributes& atts); 
64
65   //! method to overload handler function endElement
66   /*!
67    \param Qstring argument by value
68    \param Qstring argument by value
69    \param Qstring argument by value
70    \return true if no error was detected
71    \sa _Find
72   */   
73   virtual bool endElement(const QString&, const QString &,
74                           const QString& qName);
75   
76
77   //! method to overload handler function characters
78   /*!
79    \param Qstring argument by value
80    \return true if no error was detected
81   */
82   virtual bool characters(const QString& chars);
83   
84   //! method to overload handler function endDocument
85   /*! Is called at the end of the parsing
86    \return true if no error was detected
87   */
88   virtual bool endDocument();
89
90   //! method to overload handler function errorProtocol
91  /*!
92    \return the error message
93   */
94   virtual QString errorProtocol();
95
96   //! method to overload handler function fatalError
97   /*!
98     \param QXmlParseExecption argument by value
99     \return true if no error was detected
100   */
101   virtual bool fatalError(const QXmlParseException& exception);
102  
103 private:
104   QString errorProt ;
105
106   std::string content;
107
108   const char* test_data_type_name ;
109   const char* test_data_type_interf_read ;
110   const char* test_data_type_interf_write ;
111   const char* test_data_type_parent_name ;
112   const char* test_data_type_parents ;
113   const char* test_data_type;
114
115   ParserDataType _a_data_type;
116
117   ListOfParserDataTypeName _a_data_parents_list ;
118 };
119
120 #endif // SALOME_DATA_CATALOG_HANDLER_H