1 //=========================================================
2 //  MusE
3 //  Linux Music Editor
4 //
5 //  raster_widgets.h
6 //  Copyright (C) 2020 Tim E. Real (terminator356 on users dot sourceforge dot net)
7 //
8 //  This program is free software; you can redistribute it and/or
9 //  modify it under the terms of the GNU General Public License
10 //  as published by the Free Software Foundation; version 2 of
11 //  the License, or (at your option) any later version.
12 //
13 //  This program is distributed in the hope that it will be useful,
14 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
15 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 //  GNU General Public License for more details.
17 //
18 //  You should have received a copy of the GNU General Public License
19 //  along with this program; if not, write to the Free Software
20 //  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
21 //
22 //=========================================================
23 
24 #ifndef __RASTER_WIDGETS_H__
25 #define __RASTER_WIDGETS_H__
26 
27 #include <QListView>
28 #include <QTableView>
29 #include <QTreeView>
30 
31 #include "lcombo.h"
32 #include "rasterizer.h"
33 
34 class QModelIndex;
35 
36 namespace MusEGui {
37 
38 class RasterizerListView : public QListView
39 {
40   public:
41     RasterizerListView(QWidget *parent = nullptr);
42 };
43 
44 
45 //===================================================
46 
47 
48 class RasterizerTableView : public QTableView
49 {
50   private:
51     Q_OBJECT
52 
53   public slots:
54     void reset() override;
55 
56   public:
57     RasterizerTableView(QWidget *parent = nullptr);
58 };
59 
60 
61 //===================================================
62 
63 
64 class RasterizerTreeView : public QTreeView
65 {
66   public:
67     RasterizerTreeView(QWidget *parent = nullptr);
68 };
69 
70 
71 //===================================================
72 
73 
74 class RasterLabelCombo : public LabelCombo
75 {
76   private:
77     Q_OBJECT
78 
79   public:
80     enum RasterComboType { ListView, TableView, TreeView };
81 
82   private slots:
83     void rasterActivated(const QModelIndex&);
84 
85   private:
86     QAbstractItemView *rlist;
87     RasterizerModel *_rlistModel;
88 
89   signals:
90     void rasterChanged(int raster);
91 
92   public:
93     RasterLabelCombo(RasterComboType type, RasterizerModel *model, QWidget* parent, const char* name=0);
94 
95     const Rasterizer *rasterizer() const;
96     RasterizerModel *rasterizerModel() const;
97     void setRasterizerModel(RasterizerModel *model);
98 };
99 
100 } // namespace MusEGui
101 
102 #endif
103