Salome HOME
Copyright update 2022
[modules/yacs.git] / src / salomewrap / SalomeWrap_DataModel.hxx
1 // Copyright (C) 2006-2022  CEA/DEN, EDF R&D
2 //
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
7 //
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11 // Lesser General Public License for more details.
12 //
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
16 //
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 //
19
20 #ifndef _SALOMEWRAP_DATAMODEL_HXX_
21 #define _SALOMEWRAP_DATAMODEL_HXX_
22
23 #include "SalomeWrapExport.hxx"
24
25 #include <SalomeApp_DataModel.h>
26
27 #include <QWidget>
28 #include <map>
29 #include <string>
30
31 class SALOMEWRAP_EXPORT SalomeWrap_DataModel: public SalomeApp_DataModel
32 {
33 public:
34   SalomeWrap_DataModel(CAM_Module* theModule);
35   virtual ~SalomeWrap_DataModel();
36   
37   virtual void createNewSchema(const QString& schemaName,
38                                QWidget* viewWindow);
39   virtual bool renameSchema(const QString& oldName,
40                             const QString& newName,
41                             QWidget* viewWindow);
42   virtual bool deleteSchema(QWidget* viewWindow);
43   virtual void createNewRun(const QString& schemaName,
44                             const QString& runName,
45                             QWidget* refWindow,
46                             QWidget* viewWindow);
47   virtual void setSelected(QWidget* viewWindow);
48
49   SUIT_DataObject* getDataObject(std::string entry);
50   QWidget* getViewWindow(std::string entry);
51
52  public:
53   enum ObjectType
54     {
55       SchemaObject,
56       RunObject,
57       UnknownObject
58     };
59
60 protected:
61   std::map<QWidget*, std::string> _viewEntryMap;
62   std::map<std::string, QWidget*> _entryViewMap;
63   std::map<std::string, int> _runCountMap;
64 };
65
66
67 #endif