MuseScore/libmscore/bsymbol.h

65 lines
2.3 KiB
C
Raw Normal View History

2012-05-26 14:26:10 +02:00
//=============================================================================
// MuseScore
// Music Composition & Notation
// $Id: bsymbol.h 5253 2012-01-25 20:40:25Z wschweer $
//
// 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 __BSYMBOL_H__
#define __BSYMBOL_H__
#include "element.h"
#include "elementlayout.h"
//---------------------------------------------------------
2012-07-25 11:49:34 +02:00
// @@ BSymbol
/// base class for Symbol and Image
2012-05-26 14:26:10 +02:00
//---------------------------------------------------------
class BSymbol : public Element, public ElementLayout {
Q_OBJECT
2012-05-26 14:26:10 +02:00
QList<Element*> _leafs;
int _z; ///< stacking order when drawing or selecting;
///< elements are drawn from high number to low number;
///< default is type() * 100;
2013-01-23 14:14:09 +01:00
bool _systemFlag;
2012-05-26 14:26:10 +02:00
public:
2012-09-24 17:14:32 +02:00
BSymbol(Score* s);
2012-05-26 14:26:10 +02:00
BSymbol(const BSymbol&);
BSymbol &operator=(const BSymbol&);
virtual void add(Element*);
virtual void remove(Element*);
virtual void scanElements(void* data, void (*func)(void*, Element*), bool all=true);
virtual bool acceptDrop(MuseScoreView*, const QPointF&, Element*) const;
virtual Element* drop(const DropData&);
virtual void layout();
virtual QRectF drag(const EditData& pos);
2013-01-23 14:14:09 +01:00
void writeProperties(Xml& xml) const;
bool readProperties(XmlReader&);
2012-05-26 14:26:10 +02:00
const QList<Element*>& leafs() const { return _leafs; }
QList<Element*>& leafs() { return _leafs; }
virtual QPointF pagePos() const;
virtual QPointF canvasPos() const;
virtual QLineF dragAnchor() const;
Segment* segment() const { return (Segment*)parent(); }
virtual int z() const { return _z; }
void setZ(int val) { _z = val; }
2013-01-23 14:14:09 +01:00
bool systemFlag() const { return _systemFlag; }
void setSystemFlag(bool val) { _systemFlag = val; }
2012-05-26 14:26:10 +02:00
};
#endif