Salome HOME
be38d636469e844be541dc2855d1c20d4ede20b0
[modules/kernel.git] / src / ModuleCatalog / SALOME_ModuleCatalog_Handler.hxx
1 // File: SALOME_ModuleCatalog_Handler.hxx
2 // Created: Tue June 27 2001
3 // Author: Estelle Deville
4 // Project: SALOME
5 // Copyright : CEA/DEN/DMSS/LGLS
6 // $Header$
7
8 #ifndef SALOME_CATALOG_HANDLER_H
9 #define SALOME_CATALOG_HANDLER_H
10
11 #include "utilities.h"
12 #include "SALOME_ModuleCatalog_Parser.hxx"
13 #include <qxml.h>
14 #include <string>
15 #include <vector>
16
17 class SALOME_ModuleCatalog_Handler : public QXmlDefaultHandler 
18 {
19 public:
20   //! standard constructor
21   SALOME_ModuleCatalog_Handler();
22
23   //! standard destructor
24   virtual ~SALOME_ModuleCatalog_Handler();
25
26
27   //! method to overload handler function startDocument
28   /*! Is called before a xml file is parsed
29    \return true if no error was detected
30   */ 
31   virtual bool startDocument();
32
33
34   //! method to overload handler function startElement
35   /*! 
36    \param Qstring argument by value
37    \param Qstring argument by value
38    \param Qstring argument by value
39    \param QXmlAttributes argument by value
40    \return true if no error was detected
41   */
42   virtual bool startElement(const QString&, const QString &,
43                             const QString& qName, const QXmlAttributes& atts); 
44
45   //! method to overload handler function endElement
46   /*!
47    \param Qstring argument by value
48    \param Qstring argument by value
49    \param Qstring argument by value
50    \return true if no error was detected
51    \sa _Find
52   */   
53   virtual bool endElement(const QString&, const QString &,
54                           const QString& qName);
55   
56
57   //! method to overload handler function characters
58   /*!
59    \param Qstring argument by value
60    \return true if no error was detected
61   */
62   virtual bool characters(const QString& chars);
63   
64   //! method to overload handler function endDocument
65   /*! Is called at the end of the parsing
66    \return true if no error was detected
67   */
68   virtual bool endDocument();
69
70   //! method to overload handler function errorProtocol
71  /*!
72    \return the error message
73   */
74   virtual QString errorProtocol();
75
76   //! method to overload handler function fatalError
77   /*!
78     \param QXmlParseExecption argument by value
79     \return true if no error was detected
80   */
81   virtual bool fatalError(const QXmlParseException& exception);
82  
83 private:
84   QString errorProt ;
85
86   string content;
87
88   const char* test_path_prefix_name ;
89   const char* test_computer_name ;
90   const char* test_path_prefix ;
91
92   const char* test_component_name;
93   const char* test_component_username;
94   const char* test_component_type ;
95   const char* test_component_multistudy ;
96   const char* test_component_icone ;
97
98   const char* test_interface_name;
99
100   const char* test_service_name;
101   const char* test_defaultservice;
102
103   const char* test_inParameter_type;
104   const char* test_inParameter_name;
105   const char* test_inParameter;
106   const char* test_inParameter_list;
107   const char* test_outParameter_type;
108   const char* test_outParameter_name;
109   const char* test_outParameter;
110   const char* test_outParameter_list;
111
112   const char* test_service;
113   const char* test_service_list;
114   const char* test_interface_list;
115   const char* test_constraint;
116   
117   const char* test_component;
118
119   ParserPathPrefix _path_prefix;
120
121   ParserComponent _amodule;
122
123
124   ListOfDefinitionInterface _interfacelist;
125   ParserDefInterface _aInterface;
126   ListOfParserServices _servicelist;
127   ParserService _aService;
128   ParserServParam _inparam;
129   ParserServParam _outparam;
130   ListOfParserServicesParameter _inparamlist;
131   ListOfParserServicesParameter _outparamlist;
132 };
133
134 #endif // SALOME_CATALOG_HANDLER_H