#ifndef TITAN_PCBCAM_DRILLPARSER_H
#define TITAN_PCBCAM_DRILLPARSER_H
#include "../titanpcbcamglobal.h"
#include "odbfeatureparser.h"


class PcbCamDrillParserPrivate;
class TITAN_PCBCAM_EXPORT PcbCamDrillParser
{
public:
    enum DrillFormat {
        DrillFormat_Unknow,
        DrillFormat_Excellon1,
        DrillFormat_Excellon2,
        DrillFormat_Posalux,
    };

    struct DrillStatement {
        explicit DrillStatement(){}
        explicit DrillStatement(const QVariantMap &iData);
        DrillFormat format {DrillFormat_Unknow};
        PcbCam::UnitsType units {PcbCam::Units_Unknow};
        PcbCam::ZerosOmit zerosOmit {PcbCam::ZerosOmit_Unknow};
        PcbCam::CoordNotation coordMode {PcbCam::CoordUnknow};
        PcbCam::UnitsType toolUnits {PcbCam::Units_Unknow};
        int integerDigits {0};
        int decimalDigits {0};
        QPointF offsetPos {0.0, 0.0};
        QVariantMap toMap() const;
    };

    explicit PcbCamDrillParser();
    explicit PcbCamDrillParser(const QString &iFilePath, const DrillStatement &iStatement);
    ~PcbCamDrillParser();

    void setFilePath(const QString &iFilePath);
    QString filePath() const;

    void setStatement(const DrillStatement &iStatement);
    DrillStatement statement() const;

    bool parser();
    QStringList errors() const;

    QStringList symbols() const;

    QList<PcbCamOdbFeatureInfo> features() const;

protected:
    const QScopedPointer<PcbCamDrillParserPrivate> d_ptr;

private:
    Q_DECLARE_PRIVATE(PcbCamDrillParser)
    Q_DISABLE_COPY(PcbCamDrillParser)

};


#endif // TITAN_PCBCAM_DRILLPARSER_H
