File indexing completed on 2024-04-21 04:32:04

0001 /*
0002  * Copyright (C) 2010-2015 by Stephen Allewell
0003  * steve.allewell@gmail.com
0004  *
0005  * This program is free software; you can redistribute it and/or modify
0006  * it under the terms of the GNU General Public License as published by
0007  * the Free Software Foundation; either version 2 of the License, or
0008  * (at your option) any later version.
0009  */
0010 
0011 #ifndef DocumentFloss_H
0012 #define DocumentFloss_H
0013 
0014 #include <QChar>
0015 #include <QColor>
0016 #include <QDataStream>
0017 #include <QString>
0018 
0019 class DocumentFloss
0020 {
0021 public:
0022     DocumentFloss();
0023     DocumentFloss(const QString &, qint16, Qt::PenStyle, int, int);
0024     explicit DocumentFloss(const DocumentFloss *);
0025 
0026     QString flossName() const;
0027     QColor flossColor() const;
0028     qint16 stitchSymbol() const;
0029     Qt::PenStyle backstitchSymbol() const;
0030     int stitchStrands() const;
0031     int backstitchStrands() const;
0032 
0033     void setFlossName(const QString &);
0034     void setFlossColor(const QColor &);
0035     void setStitchSymbol(qint16);
0036     void setBackstitchSymbol(Qt::PenStyle);
0037     void setStitchStrands(int);
0038     void setBackstitchStrands(int);
0039 
0040     bool operator==(const DocumentFloss &) const;
0041     bool operator!=(const DocumentFloss &) const;
0042 
0043     friend QDataStream &operator<<(QDataStream &, const DocumentFloss &);
0044     friend QDataStream &operator>>(QDataStream &, DocumentFloss &);
0045 
0046 private:
0047     static const int version = 101;
0048 
0049     QString m_flossName;
0050     QColor m_flossColor;
0051     qint16 m_stitchSymbol;
0052     Qt::PenStyle m_backstitchSymbol;
0053     int m_stitchStrands;
0054     int m_backstitchStrands;
0055 };
0056 
0057 QDataStream &operator<<(QDataStream &, const DocumentFloss &);
0058 QDataStream &operator>>(QDataStream &, DocumentFloss &);
0059 
0060 #endif // DocumentFloss_H