Salome HOME
mergefrom branch BR_V511_PR tag mergeto_trunk_03feb09
[modules/yacs.git] / src / hmi / browseCatalog.h
1 //  Copyright (C) 2006-2008  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.
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 #ifndef _BROWSECATALOG_H_
20 #define _BROWSECATALOG_H_
21
22 #include "catalog.h"
23
24 #include <qlistview.h>
25 #include <list>
26 #include <string>
27 #include <map>
28
29 #include <qlistview.h>
30
31 namespace YACS
32 {
33   namespace ENGINE
34   {
35     class Catalog;
36 /*     class ServiceNode; */
37   }
38
39   namespace HMI
40   {
41
42     typedef enum
43       {
44         CATALOGNODE,
45         CATALOGDATATYPE,
46         CATALOGINPUTPORT,
47         CATALOGOUTPUTPORT,
48         CATALOGIDSPORT,
49         CATALOGODSPORT,
50         CATALOGCOMPOSEDNODE
51       } TypeOfCatalogItem;
52
53     class editTree;
54     class Subject;
55
56     class BrowseCatalog: public catalog
57     {
58       Q_OBJECT
59
60     public:
61       BrowseCatalog(editTree* editTree,
62                     Subject* sub,
63                     int cataType,
64                     QWidget* parent = 0,
65                     const char* name = 0,
66                     bool modal = FALSE,
67                     WFlags fl = 0 );
68       virtual ~BrowseCatalog();
69       virtual void resetTree();
70     public slots:
71       virtual void addSelection();
72     protected:
73       YACS::ENGINE::Catalog* _currentCatalog;
74       std::map<QListViewItem*,std::pair<std::string,std::string> > _serviceMap;
75       std::map<QListViewItem*,std::string> _typeCodeMap;
76       editTree* _editTree;
77       Subject* _subject;
78       int _cataType;
79     };
80
81   }
82 }
83 #endif