Salome HOME
This commit was generated by cvs2git to track changes on a CVS vendor
[modules/superv.git] / src / GraphBase / DataFlowBase_XmlHandler.hxx
1 //=============================================================================
2 //  File      : GraphBase_XmlHandler.hxx
3 //  Created   : Thu Jun 14 14:02:23 2001
4 //  Author    : Arnaud RES
5 //  Project   : SALOME
6 //  Copyright : CEA
7 //  $Header$
8
9 #define  INCLUDE_MENUITEM_DEF 
10 #define QT_ALTERNATE_QTSMANIP
11
12 #include <qxml.h>
13 #include <qstringlist.h>
14 #include <qaction.h>
15 #include <qlist.h>
16
17 //#include <SALOMEconfig.h>
18 //#include CORBA_CLIENT_HEADER(SALOME_SuperVision)
19
20 #include "DataFlowBase_Graph.hxx"
21
22 #define maxlevel 7
23
24 namespace GraphBase {
25
26   class XmlHandler : public QXmlDefaultHandler {
27
28     CORBA::ORB_ptr _Orb ;
29     bool dataflowxml ;
30     string fieldname[maxlevel] ;
31     string fieldvalue[maxlevel] ;
32     long step[maxlevel] ;
33     long depth ;
34     bool constructor ;
35     GraphBase::SNode aNode ;
36     SALOME_ModuleCatalog::ServicesParameter aParameter ;
37     SUPERV::ListOfStrings aPythonFunction ;
38     GraphBase::SLink aLink ;
39 //    SALOME_SuperVisionBase::ServicesParameterValue aLinkValue ;
40     CORBA::Any aLinkValue ;
41     int X ;
42     int Y ;
43     int VXSize ;
44     vector<int > VX ;
45     vector<int > VY ;
46     QString     errorProt;
47
48     GraphBase::SGraph aDataFlow ;
49
50   public:
51
52     XmlHandler();
53     XmlHandler( CORBA::ORB_ptr Orb , const bool aConstructor );
54     virtual ~XmlHandler();
55
56     GraphBase::SGraph & GetDataFlow() {
57            return aDataFlow ; } ;
58
59     // return the error protocol if parsing failed
60     QString errorProtocol();
61   
62     // overloaded handler functions
63     bool startDocument();
64     bool startElement( const QString& namespaceURI, const QString& localName, 
65                        const QString& qName, const QXmlAttributes& atts );
66     bool endElement( const QString& namespaceURI, const QString& localName,
67                      const QString& qName );
68     bool characters( const QString& ch );
69   
70     QString errorString();
71   
72     bool fatalError   (const QXmlParseException& exception);
73
74     SUPERV::SDate StringToDate( QString& qstrDate) const; 
75
76     const long getdepth() const { return depth ; } ;
77     const string getfieldname( const long adepth ) const { return fieldname[adepth] ; } ;
78     const string getfieldvalue( const long adepth ) const { return fieldvalue[adepth] ; } ;
79
80   };
81
82 } ;
83