2012-05-26 14:26:10 +02:00
|
|
|
//=============================================================================
|
|
|
|
// MuseScore
|
|
|
|
// Music Composition & Notation
|
|
|
|
//
|
|
|
|
// Copyright (C) 2002-2011 Werner Schweer
|
|
|
|
//
|
|
|
|
// This program is free software; you can redistribute it and/or modify
|
|
|
|
// it under the terms of the GNU General Public License version 2
|
|
|
|
// as published by the Free Software Foundation and appearing in
|
|
|
|
// the file LICENCE.GPL
|
|
|
|
//=============================================================================
|
|
|
|
|
|
|
|
#ifndef __BRACKET_H__
|
|
|
|
#define __BRACKET_H__
|
|
|
|
|
|
|
|
#include "element.h"
|
|
|
|
|
2013-05-13 18:49:17 +02:00
|
|
|
class QPainter;
|
|
|
|
|
|
|
|
namespace Ms {
|
|
|
|
|
2012-05-26 14:26:10 +02:00
|
|
|
class MuseScoreView;
|
|
|
|
class System;
|
|
|
|
|
|
|
|
//---------------------------------------------------------
|
2012-07-25 11:49:34 +02:00
|
|
|
// @@ Bracket
|
2012-05-26 14:26:10 +02:00
|
|
|
//---------------------------------------------------------
|
|
|
|
|
|
|
|
class Bracket : public Element {
|
2012-05-28 11:29:21 +02:00
|
|
|
Q_OBJECT
|
|
|
|
|
2013-03-05 20:23:59 +01:00
|
|
|
BracketType _bracketType;
|
2012-05-26 14:26:10 +02:00
|
|
|
|
|
|
|
qreal h2;
|
|
|
|
|
2012-10-12 15:36:57 +02:00
|
|
|
int _column;
|
|
|
|
int _span;
|
|
|
|
int _firstStaff;
|
|
|
|
int _lastStaff;
|
2012-05-26 14:26:10 +02:00
|
|
|
|
|
|
|
QPainterPath path;
|
|
|
|
|
|
|
|
public:
|
|
|
|
Bracket(Score*);
|
2015-01-19 12:37:17 +01:00
|
|
|
virtual Bracket* clone() const override { return new Bracket(*this); }
|
|
|
|
virtual Element::Type type() const override { return Element::Type::BRACKET; }
|
2012-05-26 14:26:10 +02:00
|
|
|
|
2013-03-05 20:23:59 +01:00
|
|
|
BracketType bracketType() const { return _bracketType; }
|
|
|
|
void setBracketType(BracketType t) { _bracketType = t; }
|
2012-05-26 14:26:10 +02:00
|
|
|
|
2012-10-12 15:36:57 +02:00
|
|
|
int firstStaff() const { return _firstStaff; }
|
|
|
|
void setFirstStaff(int val) { _firstStaff = val; }
|
|
|
|
|
|
|
|
int lastStaff() const { return _lastStaff; }
|
|
|
|
void setLastStaff(int val) { _lastStaff = val; }
|
|
|
|
|
|
|
|
int level() const { return _column; }
|
|
|
|
void setLevel(int v) { _column = v; }
|
|
|
|
int span() const { return _span; }
|
|
|
|
void setSpan(int v) { _span = v; }
|
|
|
|
System* system() const { return (System*)parent(); }
|
2012-05-26 14:26:10 +02:00
|
|
|
|
2015-01-19 12:37:17 +01:00
|
|
|
virtual void setHeight(qreal) override;
|
|
|
|
virtual qreal width() const override;
|
2012-05-26 14:26:10 +02:00
|
|
|
|
2015-01-19 12:37:17 +01:00
|
|
|
virtual void draw(QPainter*) const override;
|
|
|
|
virtual void write(Xml& xml) const override;
|
|
|
|
virtual void read(XmlReader&) override;
|
|
|
|
virtual void layout() override;
|
2012-05-26 14:26:10 +02:00
|
|
|
|
2015-01-19 12:37:17 +01:00
|
|
|
virtual bool isEditable() const override { return true; }
|
|
|
|
virtual void startEdit(MuseScoreView*, const QPointF&) override;
|
|
|
|
virtual bool edit(MuseScoreView*, Grip, int, Qt::KeyboardModifiers, const QString&) override;
|
|
|
|
virtual void endEdit() override;
|
|
|
|
virtual void editDrag(const EditData&) override;
|
|
|
|
virtual void endEditDrag() override;
|
|
|
|
virtual void updateGrips(Grip*, QVector<QRectF>&) const override;
|
|
|
|
virtual int grips() const override { return 1; }
|
|
|
|
virtual QPointF gripAnchor(Grip) const override;
|
2012-05-26 14:26:10 +02:00
|
|
|
|
2014-08-13 21:01:21 +02:00
|
|
|
virtual bool acceptDrop(const DropData&) const override;
|
2015-01-19 12:37:17 +01:00
|
|
|
virtual Element* drop(const DropData&) override;
|
2012-05-26 14:26:10 +02:00
|
|
|
};
|
|
|
|
|
2013-05-13 18:49:17 +02:00
|
|
|
|
|
|
|
} // namespace Ms
|
2012-05-26 14:26:10 +02:00
|
|
|
#endif
|
|
|
|
|