annotate widgets/TransformFinder.h @ 420:f8e04ad8e7b1

* More transform finder fiddling
author Chris Cannam
date Thu, 25 Sep 2008 13:47:40 +0000
parents b0c8e0def62e
children 7466402a32c5
rev   line source
Chris@416 1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
Chris@416 2
Chris@416 3 /*
Chris@416 4 Sonic Visualiser
Chris@416 5 An audio file viewer and annotation editor.
Chris@416 6 Centre for Digital Music, Queen Mary, University of London.
Chris@416 7 This file copyright 2008 QMUL.
Chris@416 8
Chris@416 9 This program is free software; you can redistribute it and/or
Chris@416 10 modify it under the terms of the GNU General Public License as
Chris@416 11 published by the Free Software Foundation; either version 2 of the
Chris@416 12 License, or (at your option) any later version. See the file
Chris@416 13 COPYING included with this distribution for more information.
Chris@416 14 */
Chris@416 15
Chris@416 16 #ifndef _TRANSFORM_FINDER_H_
Chris@416 17 #define _TRANSFORM_FINDER_H_
Chris@416 18
Chris@416 19 #include <QDialog>
Chris@416 20
Chris@417 21 #include <vector>
Chris@417 22
Chris@416 23 #include "transform/Transform.h"
Chris@416 24
Chris@419 25 class QGridLayout;
Chris@416 26 class QScrollArea;
Chris@417 27 class QLabel;
Chris@419 28 class SelectableLabel;
Chris@417 29 class QWidget;
Chris@416 30
Chris@419 31
Chris@419 32 #include <QLabel>
Chris@419 33 class SelectableLabel : public QLabel
Chris@419 34 {
Chris@419 35 Q_OBJECT
Chris@419 36
Chris@419 37 public:
Chris@420 38 SelectableLabel(QWidget *parent = 0);
Chris@419 39 virtual ~SelectableLabel() { }
Chris@419 40
Chris@419 41 void setSelectedText(QString);
Chris@419 42 void setUnselectedText(QString);
Chris@419 43
Chris@420 44 bool isSelected() const { return m_selected; }
Chris@420 45
Chris@420 46 signals:
Chris@420 47 void selectionChanged();
Chris@420 48
Chris@420 49 public slots:
Chris@420 50 void setSelected(bool);
Chris@420 51 void toggle();
Chris@420 52
Chris@419 53 protected:
Chris@419 54 virtual void mousePressEvent(QMouseEvent *e);
Chris@420 55 QString m_selectedText;
Chris@420 56 QString m_unselectedText;
Chris@420 57 bool m_selected;
Chris@419 58 };
Chris@419 59
Chris@416 60 class TransformFinder : public QDialog
Chris@416 61 {
Chris@416 62 Q_OBJECT
Chris@416 63
Chris@416 64 public:
Chris@416 65 TransformFinder(QWidget *parent = 0);
Chris@416 66 ~TransformFinder();
Chris@416 67
Chris@416 68 TransformId getTransform() const;
Chris@416 69
Chris@416 70 protected slots:
Chris@416 71 void searchTextChanged(const QString &);
Chris@420 72 void selectedLabelChanged();
Chris@420 73
Chris@416 74 protected:
Chris@416 75 QScrollArea *m_resultsScroll;
Chris@417 76 QWidget *m_resultsFrame;
Chris@419 77 QGridLayout *m_resultsLayout;
Chris@419 78 std::vector<SelectableLabel *> m_labels;
Chris@420 79 TransformId m_selectedTransform;
Chris@416 80 };
Chris@416 81
Chris@416 82 #endif
Chris@416 83