Chris@416: /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*-  vi:set ts=8 sts=4 sw=4: */
Chris@416: 
Chris@416: /*
Chris@416:     Sonic Visualiser
Chris@416:     An audio file viewer and annotation editor.
Chris@416:     Centre for Digital Music, Queen Mary, University of London.
Chris@416:     This file copyright 2008 QMUL.
Chris@416:     
Chris@416:     This program is free software; you can redistribute it and/or
Chris@416:     modify it under the terms of the GNU General Public License as
Chris@416:     published by the Free Software Foundation; either version 2 of the
Chris@416:     License, or (at your option) any later version.  See the file
Chris@416:     COPYING included with this distribution for more information.
Chris@416: */
Chris@416: 
Chris@416: #ifndef _TRANSFORM_FINDER_H_
Chris@416: #define _TRANSFORM_FINDER_H_
Chris@416: 
Chris@416: #include <QDialog>
Chris@416: 
Chris@417: #include <vector>
Chris@417: 
Chris@416: #include "transform/Transform.h"
Chris@424: #include "transform/TransformFactory.h"
Chris@416: 
Chris@421: class QVBoxLayout;
Chris@416: class QScrollArea;
Chris@417: class QLabel;
Chris@419: class SelectableLabel;
Chris@417: class QWidget;
Chris@424: class QTimer;
Chris@419: 
Chris@416: class TransformFinder : public QDialog
Chris@416: {
Chris@416:     Q_OBJECT
Chris@416: 
Chris@416: public:
Chris@416:     TransformFinder(QWidget *parent = 0);
Chris@416:     ~TransformFinder();
Chris@416: 
Chris@416:     TransformId getTransform() const;
Chris@416: 
Chris@416: protected slots:
Chris@416:     void searchTextChanged(const QString &);
Chris@420:     void selectedLabelChanged();
Chris@448:     void labelDoubleClicked();
Chris@424:     void timeout();
Chris@426:     void up();
Chris@426:     void down();
Chris@420: 
Chris@416: protected:
Chris@448:     QLabel *m_infoLabel;
Chris@448:     QLabel *m_beforeSearchLabel;
Chris@448:     QLabel *m_noResultsLabel;
Chris@448: 
Chris@416:     QScrollArea *m_resultsScroll;
Chris@417:     QWidget *m_resultsFrame;
Chris@421:     QVBoxLayout *m_resultsLayout;
Chris@419:     std::vector<SelectableLabel *> m_labels;
Chris@420:     TransformId m_selectedTransform;
Chris@424:     QTimer *m_timer;
Chris@424: 
Chris@450:     void setupBeforeSearchLabel();
Chris@450: 
Chris@424:     QString m_newSearchText;
Chris@431:     typedef std::vector<TextMatcher::Match> SortedResults;
Chris@424:     SortedResults m_sortedResults;
Chris@424:     int m_upToDateCount;
Chris@416: };
Chris@416: 
Chris@416: #endif
Chris@416: