Source

AncientDocumentEditor / documentImageCreator / src / framework / DocumentCreator / models / doc / doccharacter.h

Full commit
#ifndef DOCCHARACTER_H
#define DOCCHARACTER_H

#include <QObject>
#include <QRectF>
#include <DocumentCreator/framework_global.h>

#include <DocumentCreator/models/doc/leaf.h>

namespace Doc
{
    class FRAMEWORK_EXPORT DocCharacter : public Leaf
    {
    public:
        DocCharacter(QString display, QAtomicInt id, Document* document) 
			: Leaf(document) 
		{ 
			_display = display; 
			_id = id; 
			_rect.setRect(0,0,0,0);
			setLength(1); 
		}

        DocCharacter* clone() { DocCharacter* c = new DocCharacter(_display, _id, this->getDocument()); return c; }

        QString getDisplay() const { return _display; }
        QAtomicInt getId() const { return _id; }

		QAtomicInt x() const { return _rect.x(); }
		QAtomicInt y() const { return _rect.y(); }
		QAtomicInt width() const { return _rect.width(); }
		QAtomicInt height() const { return _rect.height(); }

		void setX(QAtomicInt x) { _rect.setX(x); }
		void setY(QAtomicInt y) { _rect.setY(y); }
        void setId(QAtomicInt id) { _id = id; }
		void setWidth(QAtomicInt width) { _rect.setWidth(width); }
		void setHeight(QAtomicInt height) { _rect.setHeight(height); }

    private:
        QString _display;
        QAtomicInt _id;

		QRectF _rect;
    };
}


#endif // DOCCHARACTER_H