valentina_old/tools/vabstracttool.h

46 lines
1.4 KiB
C
Raw Normal View History

2013-07-25 20:39:51 +02:00
#ifndef VABSTRACTTOOL_H
#define VABSTRACTTOOL_H
#include <QObject>
#include "../container/vcontainer.h"
#include "../xml/vdomdocument.h"
namespace Tool{
enum Enum
{
FromGui,
FromFile
};
}
class VAbstractTool:public QObject
{
Q_OBJECT
public:
VAbstractTool(VDomDocument *doc, VContainer *data, qint64 id);
virtual ~VAbstractTool();
public slots:
virtual void FullUpdateFromFile()=0;
void ChangedNameDraw(const QString oldName, const QString newName);
virtual void ChangedActivDraw(const QString newName);
2013-07-28 00:18:06 +02:00
virtual void FullUpdateFromGui(int result)=0;
2013-07-25 20:39:51 +02:00
signals:
void haveLiteChange();
2013-08-05 10:37:56 +02:00
void ChoosedTool(qint64 id, Scene::Type type);
2013-07-25 20:39:51 +02:00
void FullUpdateTree();
protected:
VDomDocument *doc;
VContainer *data;
qint64 id;
bool ignoreContextMenuEvent;
QString nameActivDraw;
virtual void AddToFile()=0;
void AddAttribute(QDomElement &domElement, const QString &name, const qint64 &value);
void AddAttribute(QDomElement &domElement, const QString &name, const qint32 &value);
void AddAttribute(QDomElement &domElement, const QString &name, const qreal &value);
void AddAttribute(QDomElement &domElement, const QString &name, const QString &value);
2013-07-29 14:55:40 +02:00
void AddToCalculation(const QDomElement &domElement);
2013-07-25 20:39:51 +02:00
};
#endif // VABSTRACTTOOL_H