1 //=============================================================================
2 //  MuseScore
3 //  Linux Music Score Editor
4 //
5 //  Copyright (C) 2009-2011 Werner Schweer and others
6 //
7 //  This program is free software; you can redistribute it and/or modify
8 //  it under the terms of the GNU General Public License version 2.
9 //
10 //  This program is distributed in the hope that it will be useful,
11 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
12 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 //  GNU General Public License for more details.
14 //
15 //  You should have received a copy of the GNU General Public License
16 //  along with this program; if not, write to the Free Software
17 //  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18 //=============================================================================
19 
20 #ifndef __HARMONYCANVAS_H__
21 #define __HARMONYCANVAS_H__
22 
23 #include "libmscore/harmony.h"
24 
25 namespace Ms {
26 
27 struct TextSegment;
28 struct ChordDescription;
29 class ChordList;
30 
31 //---------------------------------------------------------
32 //   HarmonyCanvas
33 //---------------------------------------------------------
34 
35 class HarmonyCanvas : public QFrame {
36       Q_OBJECT
37 
38       QList<TextSegment*> textList;       // rendered chord
39       ChordDescription* chordDescription;
40       ChordList* chordList;
41       QTransform _matrix, imatrix;
42       double extraMag;
43       QPointF startMove;
44       TextSegment* moveElement;
45 
46       Element* dragElement;
47 
48       virtual void paintEvent(QPaintEvent*);
49       virtual void mousePressEvent(QMouseEvent*);
50       virtual void mouseMoveEvent(QMouseEvent*);
51       virtual void mouseReleaseEvent(QMouseEvent*);
52       virtual void dropEvent(QDropEvent*);
53       virtual void dragEnterEvent(QDragEnterEvent*);
54       virtual void dragLeaveEvent(QDragLeaveEvent*);
55       virtual void dragMoveEvent(QDragMoveEvent*);
56 
57       void render(const QList<RenderAction>&, double&, double&, int, NoteSpellingType, NoteCaseType);
58 
59    private slots:
60       void deleteAction();
61 
62    public:
63       HarmonyCanvas(QWidget* parent = 0);
64       void setChordDescription(ChordDescription* sd, ChordList* cl);
getTextList()65       const QList<TextSegment*>& getTextList() const { return textList; }
66       void updateChordDescription();
67       };
68 
69 
70 } // namespace Ms
71 #endif
72 
73