2012-05-26 14:26:10 +02:00
|
|
|
//=============================================================================
|
2013-04-02 20:46:07 +02:00
|
|
|
// MuseScore
|
|
|
|
// Music Composition & Notation
|
2012-05-26 14:26:10 +02:00
|
|
|
//
|
2013-04-02 20:46:07 +02:00
|
|
|
// Copyright (C) 2002-2011 Werner Schweer
|
2012-05-26 14:26:10 +02:00
|
|
|
//
|
|
|
|
// This program is free software; you can redistribute it and/or modify
|
2013-04-02 20:46:07 +02:00
|
|
|
// 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
|
2012-05-26 14:26:10 +02:00
|
|
|
//=============================================================================
|
|
|
|
|
|
|
|
#ifndef __ICON_H__
|
|
|
|
#define __ICON_H__
|
|
|
|
|
|
|
|
#include "element.h"
|
|
|
|
|
2013-05-13 18:49:17 +02:00
|
|
|
namespace Ms {
|
|
|
|
|
2012-05-26 14:26:10 +02:00
|
|
|
//---------------------------------------------------------
|
|
|
|
// Icon
|
|
|
|
// dummy element, used for drag&drop
|
|
|
|
//---------------------------------------------------------
|
|
|
|
|
|
|
|
class Icon : public Element {
|
2012-05-28 11:29:21 +02:00
|
|
|
Q_OBJECT
|
|
|
|
|
2013-03-05 20:23:59 +01:00
|
|
|
int _iconType;
|
2012-05-26 14:26:10 +02:00
|
|
|
const char* _action;
|
|
|
|
QIcon _icon;
|
|
|
|
|
|
|
|
public:
|
2013-03-05 20:23:59 +01:00
|
|
|
Icon(Score* s) : Element(s), _iconType(0), _action(0) { }
|
|
|
|
virtual Icon* clone() const { return new Icon(*this); }
|
|
|
|
virtual ElementType type() const { return ICON; }
|
|
|
|
int iconType() const { return _iconType; }
|
|
|
|
void setIconType(int val) { _iconType = val; }
|
2012-05-26 14:26:10 +02:00
|
|
|
void setAction(const char* s, const QIcon& i) { _action = s; _icon = i; }
|
|
|
|
const char* action() const { return _action; }
|
|
|
|
QIcon icon() const { return _icon; }
|
|
|
|
virtual void write(Xml&) const;
|
2013-01-11 18:10:18 +01:00
|
|
|
virtual void read(XmlReader&);
|
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
|
|
|
|
|