SpeedCrunch  0.11
/usr/src/RPM/BUILD/speedcrunch-0.11/src/gui/variablelistwidget.h
Go to the documentation of this file.
00001 // This file is part of the SpeedCrunch project
00002 // Copyright (C) 2009 Andreas Scherer <andreas_coder@freenet.de>
00003 // Copyright (C) 2009, 2011, 2013 Helder Correia <helder.pereira.correia@gmail.com>
00004 //
00005 // This program is free software; you can redistribute it and/or
00006 // modify it under the terms of the GNU General Public License
00007 // as published by the Free Software Foundation; either version 2
00008 // of the License, or (at your option) any later version.
00009 //
00010 // This program is distributed in the hope that it will be useful,
00011 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00012 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013 // GNU General Public License for more details.
00014 //
00015 // You should have received a copy of the GNU General Public License
00016 // along with this program; see the file COPYING.  If not, write to
00017 // the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00018 // Boston, MA 02110-1301, USA.
00019 
00020 #ifndef GUI_VARIABLELISTWIDGET_H
00021 #define GUI_VARIABLELISTWIDGET_H
00022 
00023 #include <QList>
00024 #include <QWidget>
00025 
00026 class QEvent;
00027 class QKeyEvent;
00028 class QLabel;
00029 class QLineEdit;
00030 class QTimer;
00031 class QTreeWidget;
00032 class QTreeWidgetItem;
00033 
00034 class VariableListWidget : public QWidget
00035 {
00036     Q_OBJECT
00037 
00038 public:
00039     explicit VariableListWidget(QWidget* parent = 0);
00040     ~VariableListWidget();
00041 
00042     QTreeWidgetItem* currentItem() const;
00043 
00044 signals:
00045     void itemActivated(const QString&);
00046     void itemDeleted(const QString&);
00047 
00048 public slots:
00049     void fillTable();
00050     void retranslateText();
00051 
00052 protected slots:
00053     void activateItem();
00054     void deleteItem();
00055     void deleteAllItems();
00056     void triggerFilter();
00057 
00058 protected:
00059     void changeEvent(QEvent*);
00060     void keyPressEvent(QKeyEvent*);
00061 
00062 private:
00063     Q_DISABLE_COPY(VariableListWidget)
00064 
00065     QTimer* m_filterTimer;
00066     QTreeWidget* m_variables;
00067     QAction* m_insertAction;
00068     QAction* m_deleteAction;
00069     QAction* m_deleteAllAction;
00070     QLabel* m_noMatchLabel;
00071     QLineEdit* m_searchFilter;
00072     QLabel* m_searchLabel;
00073 };
00074 
00075 #endif