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