SpeedCrunch
0.11
|
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_USERFUNCTIONLISTWIDGET_H 00021 #define GUI_USERFUNCTIONLISTWIDGET_H 00022 00023 #include <QtCore/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 UserFunctionListWidget : public QWidget 00035 { 00036 Q_OBJECT 00037 00038 public: 00039 explicit UserFunctionListWidget(QWidget* parent = 0); 00040 ~UserFunctionListWidget(); 00041 00042 QTreeWidgetItem* currentItem() const; 00043 QString getUserFunctionName(const QTreeWidgetItem *); 00044 00045 signals: 00046 void itemActivated(const QString&); 00047 void itemEdited(const QString&); 00048 00049 public slots: 00050 void fillTable(); 00051 void retranslateText(); 00052 00053 protected slots: 00054 void activateItem(); 00055 void editItem(); 00056 void deleteItem(); 00057 void deleteAllItems(); 00058 void triggerFilter(); 00059 00060 protected: 00061 void changeEvent(QEvent*); 00062 void keyPressEvent(QKeyEvent*); 00063 00064 private: 00065 Q_DISABLE_COPY(UserFunctionListWidget) 00066 00067 QTimer* m_filterTimer; 00068 QTreeWidget* m_userFunctions; 00069 QAction* m_insertAction; 00070 QAction* m_editAction; 00071 QAction* m_deleteAction; 00072 QAction* m_deleteAllAction; 00073 QLabel* m_noMatchLabel; 00074 QLineEdit* m_searchFilter; 00075 QLabel* m_searchLabel; 00076 }; 00077 00078 #endif