svgui
1.9
|
00001 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */ 00002 00003 /* 00004 Sonic Visualiser 00005 An audio file viewer and annotation editor. 00006 Centre for Digital Music, Queen Mary, University of London. 00007 This file copyright 2008 QMUL. 00008 00009 This program is free software; you can redistribute it and/or 00010 modify it under the terms of the GNU General Public License as 00011 published by the Free Software Foundation; either version 2 of the 00012 License, or (at your option) any later version. See the file 00013 COPYING included with this distribution for more information. 00014 */ 00015 00016 #ifndef _TRANSFORM_FINDER_H_ 00017 #define _TRANSFORM_FINDER_H_ 00018 00019 #include <QDialog> 00020 00021 #include <vector> 00022 00023 #include "transform/Transform.h" 00024 #include "transform/TransformFactory.h" 00025 00026 class QVBoxLayout; 00027 class QScrollArea; 00028 class QLabel; 00029 class SelectableLabel; 00030 class QWidget; 00031 class QTimer; 00032 00033 class TransformFinder : public QDialog 00034 { 00035 Q_OBJECT 00036 00037 public: 00038 TransformFinder(QWidget *parent = 0); 00039 ~TransformFinder(); 00040 00041 TransformId getTransform() const; 00042 00043 protected slots: 00044 void searchTextChanged(const QString &); 00045 void selectedLabelChanged(); 00046 void labelDoubleClicked(); 00047 void timeout(); 00048 void up(); 00049 void down(); 00050 00051 protected: 00052 QLabel *m_infoLabel; 00053 QLabel *m_beforeSearchLabel; 00054 QLabel *m_noResultsLabel; 00055 00056 QScrollArea *m_resultsScroll; 00057 QWidget *m_resultsFrame; 00058 QVBoxLayout *m_resultsLayout; 00059 std::vector<SelectableLabel *> m_labels; 00060 TransformId m_selectedTransform; 00061 QTimer *m_timer; 00062 00063 void setupBeforeSearchLabel(); 00064 00065 QString m_newSearchText; 00066 typedef std::vector<TextMatcher::Match> SortedResults; 00067 SortedResults m_sortedResults; 00068 int m_upToDateCount; 00069 }; 00070 00071 #endif 00072