ImagingTools Core SDK
CQmlCodeGeneratorComp.h
1// SPDX-License-Identifier: LGPL-2.1-or-later OR GPL-2.0-or-later OR GPL-3.0-or-later OR LicenseRef-ImtCore-Commercial
2#pragma once
3
4
5//Qt includes
6#include <QtCore/QFile>
7
8// ACF includes
9#include <istd/TDelPtr.h>
10#include <iproc/TSyncProcessorCompBase.h>
11
12// ImtCore includes
13#include <imtsdl/ISdlProcessArgumentsParser.h>
14#include <imtsdl/ISdlTypeListProvider.h>
15#include <imtsdl/CSdlTools.h>
16
17
18namespace imtsdlgenqml
19{
20
26 public iproc::CSyncProcessorCompBase,
27 private imtsdl::CSdlTools
28{
29
30public:
31 typedef iproc::CSyncProcessorCompBase BaseClass;
32
33 I_BEGIN_COMPONENT(CQmlCodeGeneratorComp)
34 I_ASSIGN(m_argumentParserCompPtr, "ArgumentParser", "Command line process argument parser", true, "ArgumentParser")
35 I_ASSIGN(m_sdlTypeListCompPtr, "SdlTypeListProvider", "SDL types used to create a code", true, "SdlTypeListProvider")
36 I_ASSIGN_MULTI_0(m_codeGeneratorExtenderListCompPtr, "CodeGeneratorExtenderList", "Extenders, used to generate an additional code", false)
37 I_ASSIGN(m_customSchemaParamsCompPtr, "CustomSchemaParams", "Custom schema parameters, that contains additional options", false, "CustomSchemaParams")
38 I_ASSIGN(m_sdlEnumListCompPtr, "SdlEnumListProvider", "SDL enums used to create a code", true, "SdlEnumListProvider")
39 I_ASSIGN(m_sdlUnionListCompPtr, "SdlUnionListProvider", "SDL unions used to create a code", true, "SdlUnionListProvider")
40 I_ASSIGN(m_dependentSchemaListCompPtr, "DependentSchemaList", "The list of dependent schemas, used to generate dependencies of output file", true, "DependentSchemaList");
41
42 I_END_COMPONENT;
43
44 //reimplemented(iproc::IProcessor)
45 virtual TaskState DoProcessing(
46 const iprm::IParamsSet* paramsPtr,
47 const istd::IPolymorphic* inputPtr,
48 istd::IChangeable* outputPtr,
49 ibase::IProgressManager* progressManagerPtr) override;
50
51private:
52 bool ReOpenFiles();
53 bool CloseFiles();
54 bool BeginQmlFile(const imtsdl::CSdlType& sdlType);
55 bool EndQmlFile(const imtsdl::CSdlType& sdlType);
56 void AbortCurrentProcessing();
57
58private:
59 I_REF(imtsdl::ISdlProcessArgumentsParser, m_argumentParserCompPtr);
60 I_REF(imtsdl::ISdlTypeListProvider, m_sdlTypeListCompPtr);
61 I_MULTIREF(iproc::IProcessor, m_codeGeneratorExtenderListCompPtr);
62 I_REF(iprm::IParamsSet, m_customSchemaParamsCompPtr);
63 I_REF(imtsdl::ISdlEnumListProvider, m_sdlEnumListCompPtr);
64 I_REF(iprm::IOptionsManager, m_dependentSchemaListCompPtr);
65 I_REF(imtsdl::ISdlUnionListProvider, m_sdlUnionListCompPtr);
66
67 istd::TDelPtr<QFile> m_qmlFilePtr;
68};
69
70
71} // namespace imtsdlgenqml
72