#ifndef MODULE_H
#define MODULE_H
#include <QString>
#include <QList>

enum ModuleType
{
    TYPE_PM = 0,
    TYPE_DM = 1
};

class Module
{
public:
    Module();
    ~Module();

    int getID(){ return ID; };
    ModuleType getType(){ return type; };
    void setParentModule(Module* parentModule){ this->parentModule = parentModule; };
    Module* getModuleByID(int id);

protected:
    ModuleType type;
    Module* parentModule;
    int ID;
    static int lastID;
};


class PM : public Module
{
public:
    struct pmLangStruct
    {
        QString title;
    };

public:
    PM();
    ~PM();

public:
    void initialize(QString modelIdentCode, QString pmIssuer, QString pmNumber, QString pmVolume);
    void setLangStructRus(QString title);
    pmLangStruct getLangStructRus();
    void setLangStructEng(QString title);
    void addChildModule(Module* childModule);
    QList<Module*> getListChildModules();
    QString pmCode();

private:
    QString modelIdentCode;
    QString pmIssuer;
    QString pmNumber;
    QString pmVolume;

    pmLangStruct langRus;
    pmLangStruct langEng;

    QList<Module*> listChildModules;
};


class DM : public Module
{
public:
    struct dmLangStruct
    {
        QString techName;
        QString infoName;
        QString pdf;
        QString bookmark;
        QString xml;
    };

public:
    DM();
    ~DM();

public:
    void initialize(QString modelIdentCode,
    QString systemDiffCode,
    QString systemCode,
    QString subSystemCode,
    QString subSubSystemCode,
    QString assyCode,
    QString disassyCode,
    QString disassyCodeVariant,
    QString infoCode,
    QString infoCodeVariant,
    QString itemLocationCode);
    void setLangStructRus(QString techName, QString infoName, QString pdf, QString bookmark, QString xml);
    dmLangStruct getLangStructRus();
    void setLangStructEng(QString techName, QString infoName, QString pdf, QString bookmark, QString xml);
    QString dmCode();

private:
    QString modelIdentCode;
    QString systemDiffCode;
    QString systemCode;
    QString subSystemCode;
    QString subSubSystemCode;
    QString assyCode;
    QString disassyCode;
    QString disassyCodeVariant;
    QString infoCode;
    QString infoCodeVariant;
    QString itemLocationCode;

    dmLangStruct langRus;
    dmLangStruct langEng;
};

#endif // MODULE_H
