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@421
|
55 virtual void enterEvent(QEvent *);
|
Chris@421
|
56 virtual void leaveEvent(QEvent *);
|
Chris@420
|
57 QString m_selectedText;
|
Chris@420
|
58 QString m_unselectedText;
|
Chris@420
|
59 bool m_selected;
|
Chris@419
|
60 };
|
Chris@419
|
61
|
Chris@416
|
62 class TransformFinder : public QDialog
|
Chris@416
|
63 {
|
Chris@416
|
64 Q_OBJECT
|
Chris@416
|
65
|
Chris@416
|
66 public:
|
Chris@416
|
67 TransformFinder(QWidget *parent = 0);
|
Chris@416
|
68 ~TransformFinder();
|
Chris@416
|
69
|
Chris@416
|
70 TransformId getTransform() const;
|
Chris@416
|
71
|
Chris@416
|
72 protected slots:
|
Chris@416
|
73 void searchTextChanged(const QString &);
|
Chris@420
|
74 void selectedLabelChanged();
|
Chris@420
|
75
|
Chris@416
|
76 protected:
|
Chris@416
|
77 QScrollArea *m_resultsScroll;
|
Chris@417
|
78 QWidget *m_resultsFrame;
|
Chris@421
|
79 QVBoxLayout *m_resultsLayout;
|
Chris@419
|
80 std::vector<SelectableLabel *> m_labels;
|
Chris@420
|
81 TransformId m_selectedTransform;
|
Chris@416
|
82 };
|
Chris@416
|
83
|
Chris@416
|
84 #endif
|
Chris@416
|
85
|