annotate widgets/TransformFinder.h @ 422:ea9e41027b93

...
author Chris Cannam
date Fri, 26 Sep 2008 16:34:31 +0000
parents 7466402a32c5
children 5a55d0683ee5
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@421 25 class QVBoxLayout;
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@422 55 virtual void mouseDoubleClickEvent(QMouseEvent *e);
Chris@421 56 virtual void enterEvent(QEvent *);
Chris@421 57 virtual void leaveEvent(QEvent *);
Chris@420 58 QString m_selectedText;
Chris@420 59 QString m_unselectedText;
Chris@420 60 bool m_selected;
Chris@419 61 };
Chris@419 62
Chris@416 63 class TransformFinder : public QDialog
Chris@416 64 {
Chris@416 65 Q_OBJECT
Chris@416 66
Chris@416 67 public:
Chris@416 68 TransformFinder(QWidget *parent = 0);
Chris@416 69 ~TransformFinder();
Chris@416 70
Chris@416 71 TransformId getTransform() const;
Chris@416 72
Chris@416 73 protected slots:
Chris@416 74 void searchTextChanged(const QString &);
Chris@420 75 void selectedLabelChanged();
Chris@420 76
Chris@416 77 protected:
Chris@416 78 QScrollArea *m_resultsScroll;
Chris@417 79 QWidget *m_resultsFrame;
Chris@421 80 QVBoxLayout *m_resultsLayout;
Chris@419 81 std::vector<SelectableLabel *> m_labels;
Chris@420 82 TransformId m_selectedTransform;
Chris@416 83 };
Chris@416 84
Chris@416 85 #endif
Chris@416 86