Salome HOME
PR: merge from branch BR_UnitTests tag mergeto_trunk_17oct05
[modules/kernel.git] / src / SALOMEGUI / QAD_DirListDlg.h
1 //  SALOME SALOMEGUI : implementation of desktop and GUI kernel
2 //
3 //  Copyright (C) 2003  CEA/DEN, EDF R&D
4 //
5 //
6 //
7 //  File   : QAD_DirListDlg.h
8 //  Author : Vadim SANDLER
9 //  Module : SALOME
10 //  $Header$
11
12 #if !defined(QAD_DirListDlg_h)
13 #define QAD_DirListDlg_h
14
15 #include <qdialog.h>
16 #include <qtoolbutton.h>
17 #include <qlineedit.h>
18 #include <qlistbox.h>
19 #include <qcombobox.h>
20
21 class QAD_DirListDlg : public QDialog {
22
23   Q_OBJECT
24
25 public:
26 // constructor
27   QAD_DirListDlg(QWidget* parent, const char* name = 0);
28 // destructor
29   ~QAD_DirListDlg();
30
31 // gets list of paths
32   void          getPathList(QStringList& list);
33 // sets list of paths
34   void          setPathList(const QStringList& list);
35 // event filter
36   bool          eventFilter(QObject* object, QEvent* event);
37
38 protected:
39 // validates entered path, returns true if OK
40   bool          validate();
41 // appends/changes path
42   void          appendDir(QListBoxItem* item, const QString& dir);
43 // removes directory from list
44   void          removeDir(QListBoxItem* item);
45 // KeyPress event handler, processes <Enter> and <Escape> keys
46   void          keyPressEvent(QKeyEvent* event);
47 // Resize event
48   void          resizeEvent(QResizeEvent* event);
49
50 protected slots:
51 // called when user clicks inside directories list box
52   void          onMouseButtonClicked(int, QListBoxItem*, const QPoint&);
53 // called when user double-clicks on any item
54   void          onDblClicked(QListBoxItem*);
55 // <...> (Browse dir) button slot
56   void          onBtnClicked();
57 // called when user finises editing of path by pressing <Enter>
58   void          onEditFinished();
59 // <Insert> button slot
60   void          onInsert();
61 // <Delete> button slot
62   void          onDelete();
63 // <Move up> button slot
64   void          onUp();
65 // <Move down> button slot
66   void          onDown();
67 // <OK> button slot
68   void          onOk();
69
70 private:
71   QListBox*     myDirList;          // directory list
72   QLineEdit*    myEdit;             // path edit box
73   QToolButton*  myBtn;              // browse pah button
74   bool          myEdited;           // edit mode flag
75   QListBoxItem* myLastSelected;     // last selected row
76
77 };
78
79 #endif // !defined(QAD_DirListDlg_h)