Code_TYMPAN  4.4.0
Industrial site acoustic simulation
TYOpenElementDialog.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) <2012> <EDF-R&D> <FRANCE>
3  * This program is free software; you can redistribute it and/or modify
4  * it under the terms of the GNU General Public License as published by
5  * the Free Software Foundation; either version 2 of the License, or
6  * (at your option) any later version.
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
10  * See the GNU General Public License for more details.
11  * You should have received a copy of the GNU General Public License along
12  * with this program; if not, write to the Free Software Foundation, Inc.,
13  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
14  */
15 
27 #ifndef __TY_OPEN_ELEMENT_DIALOG__
28 #define __TY_OPEN_ELEMENT_DIALOG__
29 
30 #include "TYAppDefines.h"
32 
33 #include <qdialog.h>
34 #include <qlist.h>
35 
37 
38 class QListWidget;
39 class QPushButton;
40 
47 class TYOpenElementDialog : public QDialog
48 {
49  Q_OBJECT
50 
51 public:
55  TYOpenElementDialog(QWidget* parent = 0, const char* name = 0, Qt::WindowFlags f = QFlag(0));
59  virtual ~TYOpenElementDialog();
60 
65  {
66  return _isReadOnly;
67  }
68 
72  QString getFileName()
73  {
74  return _fileName;
75  }
76  const QString getFileName() const
77  {
78  return _fileName;
79  }
80 
82  QString getDirName()
83  {
84  return _dirName;
85  }
86  const QString getDirName() const
87  {
88  return _dirName;
89  }
90 
92  void setDirName(const QString& value)
93  {
94  _dirName = value;
95  }
96 
100  void setMultiSelect(const bool& b);
101 
105  std::vector<LPTYElement> getTabElem()
106  {
107  return _tabElem;
108  }
109 
114  {
115  return _elements;
116  }
117 
118 public slots:
122  void open();
123 
129  void openElement(LPTYElement pElt);
133  virtual void accept();
137  virtual void reject();
138 
139 protected slots:
140  void updateFrame();
141 
143  void openSelected();
144 
146  void openSelectedElement();
147 
149  void openSelectedElements();
150 
151  void save(LPTYElement pElt);
152 
153 protected:
156 
158  QList<int> _selectedElts;
159 
160  // Nom du fichier lu
161  QString _fileName;
162 
163  // Nom du repertoire de travail
164  QString _dirName;
165 
167  QPushButton* _pOpenBtn;
168 
169  // Tableau des elements lus
170  std::vector<LPTYElement> _tabElem;
171 
174 };
175 
176 #endif //__TY_OPEN_ELEMENT_DIALOG__
std::vector< LPTYElement > LPTYElementArray
Definition: TYElement.h:345
const char * name
Boite de dialogue pour le chargement d'un element metier. L'element peut etre ouvert dans un modeleur...
void openSelected()
Lit la selection.
void openSelectedElement()
Lit le premier element selectionne.
TYOpenElementDialog(QWidget *parent=0, const char *name=0, Qt::WindowFlags f=QFlag(0))
void openElement(LPTYElement pElt)
void setDirName(const QString &value)
Set du nom du repertoire de travail.
QList< int > _selectedElts
La liste des indices des elements selectionnes.
void setMultiSelect(const bool &b)
void save(LPTYElement pElt)
QListWidget * _pElementChoiceListBox
QString getDirName()
Get du nom du repertoire de travail.
void openSelectedElements()
Lit l'ensemble des elements selectionnes.
std::vector< LPTYElement > _tabElem
const QString getFileName() const
LPTYElementArray _elements
La collection d'elements dans la liste.
std::vector< LPTYElement > getTabElem()
const QString getDirName() const
LPTYElementArray getAvailableElements()