#ifndef TITAN_PCBCAM_ATTRDEFINE_H
#define TITAN_PCBCAM_ATTRDEFINE_H
#include "../titanpcbcamglobal.h"
#include <QSharedDataPointer>
#include <QStringList>
#include <QVariant>


class PcbCamAttrDefineData;
class TITAN_PCBCAM_EXPORT PcbCamAttrDefine
{
public:
    enum DataType {
        Boolean,
        Text,
        Option,
        Integer,
        Float
    };

    enum EntityFlag {
        Job = 0x0001,
        Step = 0x0002,
        Symbol = 0x0004,
        Layer = 0x0008,
        Stackup = 0x0010,
        Wheel = 0x0020,
        Feature = 0x0040,
        Component = 0x0080,
        All = Job | Step | Symbol | Layer | Stackup | Wheel | Feature | Component
    };
    Q_DECLARE_FLAGS(Entity, EntityFlag)

    enum Units {
        NoUnits,
        InchMm,
        MilMicrons
    };


    PcbCamAttrDefine();
    PcbCamAttrDefine(const PcbCamAttrDefine &);
    PcbCamAttrDefine &operator=(const PcbCamAttrDefine &);
    ~PcbCamAttrDefine();

    PcbCamAttrDefine::DataType dataType() const;
    void setDataType(DataType iDataType);

    QString name() const;
    void setName(const QString &iName);

    QString prompt() const;
    void setPrompt(const QString &iPrompt);

    PcbCamAttrDefine::Entity entity() const;
    void setEntity(Entity iEntity);

    QVariant defaultValue() const;
    void setDefaultValue(const QVariant &iValue);

    uint minLength() const;
    void setMinLength(uint iLen);

    uint maxLength() const;
    void setMaxLength(uint iLen);

    QStringList options() const;
    void setOptions(const QStringList &iOptions);

    QStringList deleted() const;
    void setDeleted(const QStringList &iList);

    Units units() const;
    void setUnits(Units iUnits);

    int index() const;
    void setIndex(int iIndex);

    static PcbCamAttrDefine::DataType dataTypeFromString(const QString &iStr);
    static PcbCamAttrDefine::Entity entityFromString(const QString &iStr);

private:
    QSharedDataPointer<PcbCamAttrDefineData> d;
};

Q_DECLARE_OPERATORS_FOR_FLAGS(PcbCamAttrDefine::Entity)

#endif // TITAN_PCBCAM_ATTRDEFINE_H

