1 // SALOME ModuleCatalog : implementation of ModuleCatalog server which parsers xml description of modules
3 // Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
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.
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.
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
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
24 // File : SALOME_ModuleCatalog_Handler.hxx
25 // Author : Estelle Deville
29 #ifndef SALOME_CATALOG_HANDLER_H
30 #define SALOME_CATALOG_HANDLER_H
32 #include "SALOME_ModuleCatalog_Parser.hxx"
38 #if defined MODULECATALOG_EXPORTS
40 #define MODULECATALOG_EXPORT __declspec( dllexport )
42 #define MODULECATALOG_EXPORT
46 #define MODULECATALOG_EXPORT __declspec( dllimport )
48 #define MODULECATALOG_EXPORT
52 class MODULECATALOG_EXPORT SALOME_ModuleCatalog_Handler : public QXmlDefaultHandler
55 //! standard constructor
56 SALOME_ModuleCatalog_Handler();
58 //! standard destructor
59 virtual ~SALOME_ModuleCatalog_Handler();
62 //! method to overload handler function startDocument
63 /*! Is called before a xml file is parsed
64 \return true if no error was detected
66 virtual bool startDocument();
69 //! method to overload handler function startElement
71 \param QString argument by value
72 \param QString argument by value
73 \param QString argument by value
74 \param QXmlAttributes argument by value
75 \return true if no error was detected
77 virtual bool startElement(const QString&, const QString &,
78 const QString& qName, const QXmlAttributes& atts);
80 //! method to overload handler function endElement
82 \param QString argument by value
83 \param QString argument by value
84 \param QString argument by value
85 \return true if no error was detected
88 virtual bool endElement(const QString&, const QString &,
89 const QString& qName);
92 //! method to overload handler function characters
94 \param QString argument by value
95 \return true if no error was detected
97 virtual bool characters(const QString& chars);
99 //! method to overload handler function endDocument
100 /*! Is called at the end of the parsing
101 \return true if no error was detected
103 virtual bool endDocument();
105 //! method to overload handler function errorProtocol
107 \return the error message
109 virtual QString errorProtocol();
111 //! method to overload handler function fatalError
113 \param QXmlParseExecption argument by value
114 \return true if no error was detected
116 virtual bool fatalError(const QXmlParseException& exception);
123 QString test_path_prefix_name ;
124 QString test_computer_name ;
125 QString test_path_prefix ;
127 QString test_component_name;
128 QString test_component_username;
129 QString test_component_type ;
130 QString test_component_multistudy ;
131 QString test_component_icon ;
132 QString test_component_impltype;
133 QString test_component_version;
134 QString test_component_comment;
136 QString test_interface_name;
138 QString test_service_name;
139 QString test_defaultservice;
140 QString test_typeofnode;
142 QString test_inParameter_type;
143 QString test_inParameter_name;
144 QString test_inParameter;
145 QString test_inParameter_list;
147 QString test_outParameter_type;
148 QString test_outParameter_name;
149 QString test_outParameter;
150 QString test_outParameter_list;
152 QString test_inDataStreamParameter_type;
153 QString test_inDataStreamParameter_name;
154 QString test_inDataStreamParameter_dependency;
155 QString test_inDataStreamParameter;
156 QString test_inDataStreamParameter_list;
158 QString test_outDataStreamParameter_type;
159 QString test_outDataStreamParameter_name;
160 QString test_outDataStreamParameter_dependency;
161 QString test_outDataStreamParameter;
162 QString test_outDataStreamParameter_list;
164 QString test_service;
165 QString test_service_list;
166 QString test_interface_list;
167 QString test_constraint;
169 QString test_component;
171 ParserPathPrefix _pathPrefix;
173 ParserComponent _aModule;
176 ParserInterfaces _interfaceList;
177 ParserInterface _aInterface;
179 ParserServices _serviceList;
180 ParserService _aService;
182 ParserParameters _inParamList;
183 ParserParameter _inParam;
185 ParserParameters _outParamList;
186 ParserParameter _outParam;
188 ParserDataStreamParameters _inDataStreamParamList;
189 ParserDataStreamParameter _inDataStreamParam;
191 ParserDataStreamParameters _outDataStreamParamList;
192 ParserDataStreamParameter _outDataStreamParam;
194 std::stack<QString> _xml_pile;
197 #endif // SALOME_CATALOG_HANDLER_H