Salome HOME
OCCT dev version porting (6.7.2)
[modules/geom.git] / src / GEOMGUI / GEOMGUI_XmlHandler.h
1 // Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
2 //
3 // Copyright (C) 2003-2007  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, or (at your option) any later version.
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.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 //
22
23 // GEOM GEOMGUI : reading of xml file with list of available plugin actions
24 // File   : GEOMGUI_XmlHandler.h
25 // Author : Julia DOROVSKIKH, Open CASCADE S.A.S.
26
27 #ifndef GEOMGUI_XMLHANDLER_H
28 #define GEOMGUI_XMLHANDLER_H
29
30 // GEOM includes
31 #include "GEOMGUI.h"
32
33 // Qt includes
34 #include <QXmlDefaultHandler>
35 #include <QMap>
36 #include <QList>
37
38 //GUI includes
39 #include <QtxMap.h>
40
41 //class HypothesisData;
42 //class HypothesesSet;
43
44 struct GEOMGUI_ActionData
45 {
46   QString myLabel; // unique ID
47   QString myIcon;
48   QString myMenu;
49   QString myTooltip;
50   QString myStatusBar;
51
52   //int     myAccel;
53   //bool    myToggle;
54   //QString myShortcut;
55 };
56
57 struct GEOMGUI_PluginData
58 {
59   QString myName;
60   QString myServerLib;
61   QString myClientLib;
62
63   //QList<GEOMGUI_ActionData*> myListOfActions;
64   QList<GEOMGUI_ActionData> myListOfActions;
65 };
66
67 class GEOMGUI_EXPORT GEOMGUI_XmlHandler : public QXmlDefaultHandler
68 {
69 public:
70   GEOMGUI_XmlHandler();
71   virtual ~GEOMGUI_XmlHandler();
72
73   bool     startDocument();
74   bool     startElement( const QString&, const QString&, 
75                          const QString&, const QXmlAttributes& );
76   bool     endElement( const QString&, const QString&, const QString& );
77   bool     characters( const QString& ); 
78
79   QString  errorString();
80   QString  errorProtocol();
81   bool     fatalError( const QXmlParseException& );
82
83 public:
84   GEOMGUI_PluginData       myPluginData;
85
86 private:
87   QString                  myErrorProt;
88 };
89
90 #endif // GEOMGUI_XMLHANDLER_H