MuseScore  3.4
Music composition and notation
bsymbol.h
Go to the documentation of this file.
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 __BSYMBOL_H__
14 #define __BSYMBOL_H__
15 
16 #include "element.h"
17 
18 namespace Ms {
19 
20 //---------------------------------------------------------
21 // @@ BSymbol
23 //---------------------------------------------------------
24 
25 class BSymbol : public Element {
26  QList<Element*> _leafs;
28 
29  public:
31  BSymbol(const BSymbol&);
32 
33  BSymbol &operator=(const BSymbol&) = delete;
34 
35  virtual void add(Element*) override;
36  virtual void remove(Element*) override;
37  virtual void scanElements(void* data, void (*func)(void*, Element*), bool all=true) override;
38  virtual bool acceptDrop(EditData&) const override;
39  virtual Element* drop(EditData&) override;
40  virtual void layout() override;
41  virtual QRectF drag(EditData&) override;
42 
43  void writeProperties(XmlWriter& xml) const;
45 
46  Align align() const { return _align; }
47  void setAlign(Align a) { _align = a; }
48 
49  const QList<Element*>& leafs() const { return _leafs; }
50  QList<Element*>& leafs() { return _leafs; }
51  virtual QPointF pagePos() const override;
52  virtual QPointF canvasPos() const override;
53  virtual QLineF dragAnchor() const override;
54  Segment* segment() const { return (Segment*)parent(); }
55  };
56 
57 } // namespace Ms
58 #endif
59 
BSymbol & operator=(const BSymbol &)=delete
Definition: xml.h:67
void writeProperties(XmlWriter &xml) const
Definition: bsymbol.cpp:49
QFlags< ElementFlag > ElementFlags
Definition: element.h:101
virtual void layout() override
Definition: bsymbol.cpp:160
BSymbol(Score *s, ElementFlags f=ElementFlag::NOTHING)
Definition: bsymbol.cpp:28
Base class of score layout elements.
Definition: element.h:158
Element * parent() const
Definition: element.h:192
Definition: score.h:391
base class for Symbol and Image
Definition: bsymbol.h:25
virtual QPointF canvasPos() const override
position in canvas coordinates
Definition: bsymbol.cpp:245
bool readProperties(XmlReader &)
Definition: bsymbol.cpp:60
Segment * segment() const
Definition: bsymbol.h:54
virtual void add(Element *) override
Definition: bsymbol.cpp:91
Definition: segment.h:50
Definition: aeolus.cpp:26
virtual QPointF pagePos() const override
position in page coordinates
Definition: bsymbol.cpp:226
Definition: xml.h:218
QList< Element * > & leafs()
Definition: bsymbol.h:50
QList< Element * > _leafs
Definition: bsymbol.h:26
virtual QRectF drag(EditData &) override
Return update Rect relative to canvas.
Definition: bsymbol.cpp:176
virtual QLineF dragAnchor() const override
Definition: bsymbol.cpp:209
virtual bool acceptDrop(EditData &) const override
Return true if this element accepts a drop at canvas relative pos of given element type and subtype...
Definition: bsymbol.cpp:132
void setAlign(Align a)
Definition: bsymbol.h:47
virtual void scanElements(void *data, void(*func)(void *, Element *), bool all=true) override
Definition: bsymbol.cpp:121
Align align() const
Definition: bsymbol.h:46
Definition: element.h:111
virtual Element * drop(EditData &) override
Handle a dropped element at canvas relative pos of given element type and subtype.
Definition: bsymbol.cpp:141
Align _align
Definition: bsymbol.h:27
Align
Definition: types.h:439
const QList< Element * > & leafs() const
Definition: bsymbol.h:49