]> SALOME platform Git repositories - modules/kernel.git/blob - src/ModuleCatalog/SALOME_ModuleCatalog_Handler.hxx
Salome HOME
DCQ : Merge with Ecole_ete_a6.
[modules/kernel.git] / src / ModuleCatalog / SALOME_ModuleCatalog_Handler.hxx
1 //  SALOME ModuleCatalog : implementation of ModuleCatalog server which parsers xml description of modules
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_ModuleCatalog_Handler.hxx
25 //  Author : Estelle Deville
26 //  Module : SALOME
27 //  $Header$
28
29 #ifndef SALOME_CATALOG_HANDLER_H
30 #define SALOME_CATALOG_HANDLER_H
31
32 #include "utilities.h"
33 #include "SALOME_ModuleCatalog_Parser.hxx"
34 #include <qxml.h>
35 #include <string>
36 #include <stack>
37 #include <map>
38
39 class SALOME_ModuleCatalog_Handler : public QXmlDefaultHandler 
40 {
41 public:
42   //! standard constructor
43   SALOME_ModuleCatalog_Handler();
44
45   //! standard destructor
46   virtual ~SALOME_ModuleCatalog_Handler();
47
48
49   //! method to overload handler function startDocument
50   /*! Is called before a xml file is parsed
51    \return true if no error was detected
52   */ 
53   virtual bool startDocument();
54
55
56   //! method to overload handler function startElement
57   /*! 
58    \param QString argument by value
59    \param QString argument by value
60    \param QString argument by value
61    \param QXmlAttributes argument by value
62    \return true if no error was detected
63   */
64   virtual bool startElement(const QString&, const QString &,
65                             const QString& qName, const QXmlAttributes& atts); 
66
67   //! method to overload handler function endElement
68   /*!
69    \param QString argument by value
70    \param QString argument by value
71    \param QString argument by value
72    \return true if no error was detected
73    \sa _Find
74   */   
75   virtual bool endElement(const QString&, const QString &,
76                           const QString& qName);
77   
78
79   //! method to overload handler function characters
80   /*!
81    \param QString argument by value
82    \return true if no error was detected
83   */
84   virtual bool characters(const QString& chars);
85   
86   //! method to overload handler function endDocument
87   /*! Is called at the end of the parsing
88    \return true if no error was detected
89   */
90   virtual bool endDocument();
91
92   //! method to overload handler function errorProtocol
93  /*!
94    \return the error message
95   */
96   virtual QString errorProtocol();
97
98   //! method to overload handler function fatalError
99   /*!
100     \param QXmlParseExecption argument by value
101     \return true if no error was detected
102   */
103   virtual bool fatalError(const QXmlParseException& exception);
104  
105 private:
106   QString errorProt ;
107
108   string content;
109
110   QString test_path_prefix_name ;
111   QString test_computer_name ;
112   QString test_path_prefix ;
113
114   QString test_component_name;
115   QString test_component_username;
116   QString test_component_type ;
117   QString test_component_multistudy ;
118   QString test_component_icon ;
119   QString test_component_impltype;
120
121   QString test_interface_name;
122
123   QString test_service_name;
124   QString test_defaultservice;
125   QString test_typeofnode;
126
127   QString test_inParameter_type;
128   QString test_inParameter_name;
129   QString test_inParameter;
130   QString test_inParameter_list;
131
132   QString test_outParameter_type;
133   QString test_outParameter_name;
134   QString test_outParameter;
135   QString test_outParameter_list;
136
137   QString test_inDataStreamParameter_type;
138   QString test_inDataStreamParameter_name;
139   QString test_inDataStreamParameter_dependency;
140   QString test_inDataStreamParameter;
141   QString test_inDataStreamParameter_list;
142
143   QString test_outDataStreamParameter_type;
144   QString test_outDataStreamParameter_name;
145   QString test_outDataStreamParameter_dependency;
146   QString test_outDataStreamParameter;
147   QString test_outDataStreamParameter_list;
148
149   QString test_service;
150   QString test_service_list;
151   QString test_interface_list;
152   QString test_constraint;
153   
154   QString test_component;
155
156   ParserPathPrefix _pathPrefix;
157
158   ParserComponent _aModule;
159
160
161   ParserInterfaces _interfaceList;
162   ParserInterface  _aInterface;
163
164   ParserServices   _serviceList;
165   ParserService    _aService;
166
167   ParserParameters _inParamList;
168   ParserParameter  _inParam;
169
170   ParserParameters _outParamList;
171   ParserParameter  _outParam;
172
173   ParserDataStreamParameters _inDataStreamParamList;
174   ParserDataStreamParameter  _inDataStreamParam;
175
176   ParserDataStreamParameters _outDataStreamParamList;
177   ParserDataStreamParameter  _outDataStreamParam;
178
179   std::stack<QString> _xml_pile;
180 };
181
182 #endif // SALOME_CATALOG_HANDLER_H