mirror of
https://gitea.msk.dinamika-avia.ru/Constanta-Design/MI-38.git
synced 2026-01-23 23:55:38 +03:00
103 lines
3.0 KiB
C++
103 lines
3.0 KiB
C++
#ifndef LYX_H
|
|
#define LYX_H
|
|
|
|
#include <QWidget>
|
|
#include <QMainWindow>
|
|
#include "s1000d_manager.h"
|
|
#include "splashform.h"
|
|
|
|
class LyX {
|
|
public:
|
|
struct tableOfContentsStruct {
|
|
QString id, title;
|
|
QList<tableOfContentsStruct> childs;
|
|
} tableOfContentsRoot;
|
|
|
|
LyX();
|
|
bool Import(S1000D_Manager* SM, QString fileName, SplashForm* splash);
|
|
bool readLyXFile(QString fileName, bool isMainFile=false);
|
|
void checkForOldIdent();
|
|
void parseBlock(int _beg, int _end, QDomNode domCurLevelNode);
|
|
void parseInset(int _beg, int _end);
|
|
int findTagEnd(int _beg);
|
|
int findTag(int _beg, int _end, QString startsWithName);
|
|
void pushFlags();
|
|
void popFlags();
|
|
void pushLyXFileData();
|
|
void popLyXFileData();
|
|
void appendChapter(QString title);
|
|
void appendSection(QString title);
|
|
void appendSubsection(QString title);
|
|
void fillTableOfContents(tableOfContentsStruct tocNode, QDomNode domToCNode, QString deepSpaces);
|
|
void fillAcronymList(QDomNode domAcronymListNode);
|
|
int parseLearningModule(QDomNode domLearnNode, int _learnBeg, int _learnMaxEnd);
|
|
// QString questLyXtoHTML(QString answer);
|
|
void addQuestInteraction(QDomNode domLearnNode, QString question, QStringList answers);
|
|
QDomNode searchSVGNodeForSpanNode(QDomNode node);
|
|
void connectRefsWithLabels();
|
|
|
|
QStringList lyxList;
|
|
QStringList lyxLog;
|
|
QString curLyXFileName; //, domContentPath;
|
|
//QString curXmlFileName;
|
|
QString projPath;
|
|
QDomNode domRootNode, domTableOfContentsNode, domAcronymListNode;
|
|
int tocItemNum, acrListItemNum;
|
|
QString tableTitle, tableID, figureTitle, figureID;
|
|
|
|
S1000D_Manager* SM;
|
|
SplashForm* splash;
|
|
bool DBG = true;
|
|
struct flagsStruct {
|
|
QString align;
|
|
bool bold, italic, underlined;
|
|
} flags;
|
|
QList<flagsStruct> flagsStack;
|
|
struct acronymStruct {
|
|
QString lyxFootnoteName, id, term, definition;
|
|
};
|
|
QList<acronymStruct> acronymList;
|
|
struct labelStruct {
|
|
int itemInd;
|
|
QString lyxLabel, id;
|
|
bool defined = false;
|
|
bool used = false;
|
|
QString nodeXPath;
|
|
int lineNum;
|
|
};
|
|
QList<labelStruct> labelList;
|
|
struct refStruct {
|
|
int itemInd;
|
|
QString lyxRef;
|
|
bool labelFound;
|
|
QString nodeXPath;
|
|
int lineNum;
|
|
};
|
|
QList<refStruct> refList;
|
|
int cntTable, cntFigure, cntPar, globalTable, globalFigure, globalPar;
|
|
|
|
struct cellStruct {
|
|
int _cellBeg, _cellEnd;
|
|
QString colname, spanname, multiCol, multiRow;
|
|
bool topline, bottomline, leftline, rightline, checkPassed;
|
|
bool createS1000D_entry;
|
|
QString alignment, rotate;
|
|
};
|
|
|
|
struct fileStruct {
|
|
QString fileName;
|
|
QStringList lyxList;
|
|
};
|
|
QList<fileStruct> lyxFileStack;
|
|
QStringList internalRefList;
|
|
|
|
RU_Const* ru_const;
|
|
|
|
|
|
int docChapter, docSection, docSubsection;//, docSubsubsection;
|
|
int curChapterItem, curSectionItem, curSubsectionItem;
|
|
|
|
QList<int> lyxEmptyCnt;
|
|
};
|
|
#endif // LYX_H
|