Salome HOME
c12c49cef7c9a83b8dca8839515c98346673d74c
[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 <vector>
37
38 class SALOME_ModuleCatalog_Handler : public QXmlDefaultHandler 
39 {
40 public:
41   //! standard constructor
42   SALOME_ModuleCatalog_Handler();
43
44   //! standard destructor
45   virtual ~SALOME_ModuleCatalog_Handler();
46
47
48   //! method to overload handler function startDocument
49   /*! Is called before a xml file is parsed
50    \return true if no error was detected
51   */ 
52   virtual bool startDocument();
53
54
55   //! method to overload handler function startElement
56   /*! 
57    \param Qstring argument by value
58    \param Qstring argument by value
59    \param Qstring argument by value
60    \param QXmlAttributes argument by value
61    \return true if no error was detected
62   */
63   virtual bool startElement(const QString&, const QString &,
64                             const QString& qName, const QXmlAttributes& atts); 
65
66   //! method to overload handler function endElement
67   /*!
68    \param Qstring argument by value
69    \param Qstring argument by value
70    \param Qstring argument by value
71    \return true if no error was detected
72    \sa _Find
73   */   
74   virtual bool endElement(const QString&, const QString &,
75                           const QString& qName);
76   
77
78   //! method to overload handler function characters
79   /*!
80    \param Qstring argument by value
81    \return true if no error was detected
82   */
83   virtual bool characters(const QString& chars);
84   
85   //! method to overload handler function endDocument
86   /*! Is called at the end of the parsing
87    \return true if no error was detected
88   */
89   virtual bool endDocument();
90
91   //! method to overload handler function errorProtocol
92  /*!
93    \return the error message
94   */
95   virtual QString errorProtocol();
96
97   //! method to overload handler function fatalError
98   /*!
99     \param QXmlParseExecption argument by value
100     \return true if no error was detected
101   */
102   virtual bool fatalError(const QXmlParseException& exception);
103  
104 private:
105   QString errorProt ;
106
107   string content;
108
109   const char* test_path_prefix_name ;
110   const char* test_computer_name ;
111   const char* test_path_prefix ;
112
113   const char* test_component_name;
114   const char* test_component_username;
115   const char* test_component_type ;
116   const char* test_component_multistudy ;
117   const char* test_component_icone ;
118
119   const char* test_interface_name;
120
121   const char* test_service_name;
122   const char* test_defaultservice;
123
124   const char* test_inParameter_type;
125   const char* test_inParameter_name;
126   const char* test_inParameter;
127   const char* test_inParameter_list;
128   const char* test_outParameter_type;
129   const char* test_outParameter_name;
130   const char* test_outParameter;
131   const char* test_outParameter_list;
132
133   const char* test_service;
134   const char* test_service_list;
135   const char* test_interface_list;
136   const char* test_constraint;
137   
138   const char* test_component;
139
140   ParserPathPrefix _path_prefix;
141
142   ParserComponent _amodule;
143
144
145   ListOfDefinitionInterface _interfacelist;
146   ParserDefInterface _aInterface;
147   ListOfParserServices _servicelist;
148   ParserService _aService;
149   ParserServParam _inparam;
150   ParserServParam _outparam;
151   ListOfParserServicesParameter _inparamlist;
152   ListOfParserServicesParameter _outparamlist;
153 };
154
155 #endif // SALOME_CATALOG_HANDLER_H