SpeedCrunch  0.11
/usr/src/RPM/BUILD/speedcrunch-0.11/src/gui/functionswidget.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_FUNCTIONSWIDGET_H
00021 #define GUI_FUNCTIONSWIDGET_H
00022 
00023 #include <QList>
00024 #include <QWidget>
00025 
00026 class QEvent;
00027 class QLabel;
00028 class QLineEdit;
00029 class QTreeWidget;
00030 class QTreeWidgetItem;
00031 
00032 class FunctionsWidget : public QWidget {
00033     Q_OBJECT
00034 
00035 public:
00036     explicit FunctionsWidget(QWidget* parent = 0);
00037     ~FunctionsWidget();
00038 
00039     const QTreeWidgetItem* currentItem() const;
00040     QList<QTreeWidgetItem*> selectedItems() const;
00041 
00042 signals:
00043     void functionSelected(const QString&);
00044 
00045 protected slots:
00046     void handleItemActivated(QTreeWidgetItem*, int);
00047     virtual void changeEvent(QEvent*);
00048     void clearSelection(QTreeWidgetItem*);
00049     void fillTable();
00050     void retranslateText();
00051     void triggerFilter();
00052 
00053 private:
00054     Q_DISABLE_COPY(FunctionsWidget)
00055 
00056     QTimer* m_filterTimer;
00057     QTreeWidget* m_functions;
00058     bool m_insertAllItems;
00059     QLabel* m_noMatchLabel;
00060     QLineEdit* m_searchFilter;
00061     QLabel* m_searchLabel;
00062 };
00063 
00064 #endif // GUI_FUNCTIONSWIDGET_H