MuseScore Plugins 3.3
Plugins API for MuseScore
Loading...
Searching...
No Matches
layoutbreak.h
1//=============================================================================
2// MuseScore
3// Music Composition & Notation
4//
5// Copyright (C) 2002-2011 Werner Schweer
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 LICENCE.GPL
11//=============================================================================
12
13#ifndef __LAYOUTBREAK_H__
14#define __LAYOUTBREAK_H__
15
16#include "element.h"
17
18namespace Ms {
19
20// layout break subtypes:
21
22//---------------------------------------------------------
23// @@ LayoutBreak
25//---------------------------------------------------------
26
27class LayoutBreak final : public Element {
28 Q_GADGET
29 public:
35 private:
36 Q_ENUM(Type);
37
38 qreal lw;
39 QPainterPath path;
40 QPainterPath path2;
41 qreal _pause;
42 bool _startWithLongNames;
43 bool _startWithMeasureOne;
44 bool _firstSystemIdentation;
45 Type _layoutBreakType;
46
47 void draw(QPainter*) const override;
48 void layout0();
49 void spatiumChanged(qreal oldValue, qreal newValue) override;
50
51 public:
52 LayoutBreak(Score* = 0);
54
55 LayoutBreak* clone() const override { return new LayoutBreak(*this); }
56 ElementType type() const override { return ElementType::LAYOUT_BREAK; }
57 int subtype() const override { return static_cast<int>(_layoutBreakType); }
58
59 void setLayoutBreakType(Type);
60 Type layoutBreakType() const { return _layoutBreakType; }
61
62 bool acceptDrop(EditData&) const override;
63 Element* drop(EditData&) override;
64 void write(XmlWriter&) const override;
65 void read(XmlReader&) override;
66
67 MeasureBase* measure() const { return (MeasureBase*)parent(); }
68 qreal pause() const { return _pause; }
69 void setPause(qreal v) { _pause = v; }
70 bool startWithLongNames() const { return _startWithLongNames; }
71 void setStartWithLongNames(bool v) { _startWithLongNames = v; }
72 bool startWithMeasureOne() const { return _startWithMeasureOne; }
73 void setStartWithMeasureOne(bool v) { _startWithMeasureOne = v; }
74 bool firstSystemIdentation() const { return _firstSystemIdentation; }
75 void setFirstSystemIdentation(bool v) { _firstSystemIdentation = v; }
76
77 bool isPageBreak() const { return _layoutBreakType == PAGE; }
78 bool isLineBreak() const { return _layoutBreakType == LINE; }
79 bool isSectionBreak() const { return _layoutBreakType == SECTION; }
80 bool isNoBreak() const { return _layoutBreakType == NOBREAK; }
81
82 QVariant getProperty(Pid propertyId) const override;
83 bool setProperty(Pid propertyId, const QVariant&) override;
84 QVariant propertyDefault(Pid) const override;
85 Pid propertyId(const QStringRef& xmlName) const override;
86 };
87
88
89} // namespace Ms
90
91#endif
symbols for line break, page break etc.
Definition layoutbreak.h:27
Type
Definition layoutbreak.h:30
@ LINE
Definition layoutbreak.h:32
@ PAGE
Definition layoutbreak.h:32
@ SECTION
Definition layoutbreak.h:32
@ NOBREAK
Definition layoutbreak.h:32
Definition cursor.cpp:30
ElementType
Definition types.h:34