MuseScore  3.4
Music composition and notation
mscoreview.h
Go to the documentation of this file.
1 //=============================================================================
2 // MuseScore
3 // Music Composition & Notation
4 //
5 // Copyright (C) 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 // as published by the Free Software Foundation and appearing in
10 // the file LICENSE.GPL
11 //=============================================================================
12 
13 #ifndef __MSCOREVIEW_H__
14 #define __MSCOREVIEW_H__
15 
16 namespace Ms {
17 
18 class Element;
19 class Score;
20 class Slur;
21 class Note;
22 class Page;
23 class ChordRest;
24 
25 enum class Grip : int;
26 enum class HairpinType : signed char;
27 
28 //---------------------------------------------------------
29 // MuseScoreView
30 //---------------------------------------------------------
31 
33 
34  protected:
36 
37  public:
39  Page* point2page(const QPointF&);
40  Element* elementAt(const QPointF& p);
41  const QList<Element*> elementsAt(const QPointF&);
42  virtual Element* elementNear(QPointF) { return 0; }
43 
44  virtual void layoutChanged() {}
45  virtual void dataChanged(const QRectF&) = 0;
46  virtual void updateAll() = 0;
47 
48  virtual void moveCursor() {}
49  virtual void showLoopCursors(bool) {}
50 
51  virtual void adjustCanvasPosition(const Element*, bool /*playBack*/, int /*staffIdx*/ = -1) {};
52  virtual void setScore(Score* s) { _score = s; }
53  Score* score() const { return _score; }
54  virtual void removeScore() {};
55 
56  virtual void changeEditElement(Element*) {};
57  virtual QCursor cursor() const { return QCursor(); }
58  virtual void setCursor(const QCursor&) {};
59  virtual void setDropRectangle(const QRectF&) {};
60  virtual void cmdAddSlur(ChordRest*, ChordRest*, const Slur* /* slurTemplate */) {};
61  virtual void startEdit(Element*, Grip /*startGrip*/) {};
62  virtual void startNoteEntryMode() {};
63  virtual void drawBackground(QPainter*, const QRectF&) const = 0;
64  virtual void setDropTarget(const Element*) {}
65 
66  virtual void textTab(bool /*back*/) {}
67  virtual void lyricsTab(bool /*back*/, bool /*end*/, bool /*moveOnly*/) {}
68  virtual void lyricsReturn() {}
69  virtual void lyricsEndEdit() {}
70  virtual void lyricsUpDown(bool /*up*/, bool /*end*/) {}
71  virtual void lyricsMinus() {}
72  virtual void lyricsUnderscore() {}
73 
74  virtual void onElementDestruction(Element*) {}
75 
76  virtual const QRect geometry() const = 0;
77  };
78 
79 
80 } // namespace Ms
81 
82 #endif
83 
HairpinType
Definition: hairpin.h:27
virtual void removeScore()
Definition: mscoreview.h:54
virtual void moveCursor()
Definition: mscoreview.h:48
virtual void lyricsUnderscore()
Definition: mscoreview.h:72
Definition: slur.h:55
Score * score() const
Definition: mscoreview.h:53
Base class of score layout elements.
Definition: element.h:158
virtual void cmdAddSlur(ChordRest *, ChordRest *, const Slur *)
Definition: mscoreview.h:60
Definition: score.h:391
virtual void adjustCanvasPosition(const Element *, bool, int=-1)
Definition: mscoreview.h:51
Score * _score
Definition: mscoreview.h:35
virtual void startEdit(Element *, Grip)
Definition: mscoreview.h:61
Grip
Definition: element.h:43
virtual void setCursor(const QCursor &)
Definition: mscoreview.h:58
Definition: aeolus.cpp:26
virtual void lyricsReturn()
Definition: mscoreview.h:68
virtual void textTab(bool)
Definition: mscoreview.h:66
virtual void startNoteEntryMode()
Definition: mscoreview.h:62
virtual void lyricsTab(bool, bool, bool)
Definition: mscoreview.h:67
virtual void layoutChanged()
Definition: mscoreview.h:44
virtual void onElementDestruction(Element *)
Definition: mscoreview.h:74
virtual void setDropRectangle(const QRectF &)
Definition: mscoreview.h:59
Definition: chordrest.h:48
virtual void setDropTarget(const Element *)
Definition: mscoreview.h:64
virtual void lyricsEndEdit()
Definition: mscoreview.h:69
virtual Element * elementNear(QPointF)
Definition: mscoreview.h:42
virtual QCursor cursor() const
Definition: mscoreview.h:57
virtual void setScore(Score *s)
Definition: mscoreview.h:52
virtual void changeEditElement(Element *)
Definition: mscoreview.h:56
MuseScoreView()
Definition: mscoreview.h:38
virtual void showLoopCursors(bool)
Definition: mscoreview.h:49
Definition: page.h:34
virtual void lyricsUpDown(bool, bool)
Definition: mscoreview.h:70
Definition: mscoreview.h:32
virtual void lyricsMinus()
Definition: mscoreview.h:71