Exteor/include/xtr/io/RSForm2DOCX.h

36 lines
863 B
C
Raw Permalink Normal View History

2024-06-07 20:30:06 +03:00
#pragma once
#include "xtr/io/OptionsIO.hpp"
namespace xtr::io {
//! Export RSForm as docx
class RSForm2DOCX {
MSO::Word::WApplication wordApplication{};
MSO::Word::WDocuments docs{};
MSO::Word::WDocument workingDocument{};
SchemaOptions params{};
const ccl::semantic::RSForm& source;
public:
explicit RSForm2DOCX(const ccl::semantic::RSForm& source)
: source{ source } {}
public:
BOOL Export(const SchemaOptions& exportParams, CString fileName);
private:
[[nodiscard]] static std::optional<CString> GetPathToTemplate();
BOOL LoadApplication();
BOOL CreateDocument();
BOOL WriteContent();
BOOL PutTextIntoBookmark(CString bookmarkName, CString text);
BOOL WriteHeaderFooter();
void WriteConstituenta(EntityUID target, MSO::Word::WTable& outTable, long nRow);
void SaveFile(CString fileName);
};
} // namespace xtr::io