1 // Copyright (C) 2005 OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
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.
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.
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
17 // See http://www.salome-platform.org/
19 #ifndef QTX_DIRLISTEDITOR_H
20 #define QTX_DIRLISTEDITOR_H
25 #include <qtoolbutton.h>
26 #include <qlineedit.h>
28 #include <qcombobox.h>
31 #pragma warning( disable:4251 )
35 * \brief The GUI implementation of the directory list
37 class QTX_EXPORT QtxDirListEditor : public QWidget {
45 * \param parent - the parent of the widget
47 QtxDirListEditor(QWidget* parent);
55 * \brief Gets list of paths
56 * \param list - the returned reference to the list of paths
58 void getPathList(QStringList& list);
61 * \brief Sets list of paths
62 * \param list - the list of paths to set
64 void setPathList(const QStringList& list);
67 * \brief Event filter, redefined from QObject class
69 bool eventFilter(QObject* object, QEvent* event);
74 * \brief Validates entered path
75 * \retval bool - returns status (true if OK)
77 bool validate( const bool quietMode = false );
80 * \brief Appends/changes path
81 * \param item - the item in QListBox
82 * \param dir - the path
84 void appendDir(QListBoxItem* item, const QString& dir);
87 * \brief Removes directory from list
88 * \param item - the item in QListBox
90 void removeDir(QListBoxItem* item);
93 * \brief Resize event handler, reimplemented from QWidget
94 * \param event - the resize event
96 void resizeEvent(QResizeEvent* event);
101 * \brief Called when user clicks inside directories list box
103 void onMouseButtonClicked(int, QListBoxItem*, const QPoint&);
106 * \brief Called when user double-clicks on any item
108 void onDblClicked(QListBoxItem*);
111 * \brief <...> (Browse dir) button slot
116 * \brief Ccalled when user finises editing of path by pressing <Enter>
118 void onEditFinished();
121 * \brief <Insert> button slot
126 * \brief <Delete> button slot
131 * \brief <Move up> button slot
136 * \brief <Move down> button slot
141 QListBox* myDirList; //!< directory list
142 QLineEdit* myEdit; //!< path edit box
143 QToolButton* myBtn; //!< browse pah button
144 bool myEdited; //!< edit mode flag
145 QListBoxItem* myLastSelected; //!< last selected row