1/*
2 This file is part of KDE.
3
4 SPDX-FileCopyrightText: 2003 Cornelius Schumacher <schumacher@kde.org>
5 SPDX-FileCopyrightText: 2003 Waldo Bastian <bastian@kde.org>
6 SPDX-FileCopyrightText: 2003 Zack Rusin <zack@kde.org>
7 SPDX-FileCopyrightText: 2006 Michaƫl Larouche <michael.larouche@kdemail.net>
8 SPDX-FileCopyrightText: 2008 Allen Winter <winter@kde.org>
9 SPDX-FileCopyrightText: 2020 Tomaz Cananbrava <tcanabrava@kde.org>
10
11 SPDX-License-Identifier: LGPL-2.0-or-later
12*/
13
14#ifndef KCONFIGHEADERGENERATOR_H
15#define KCONFIGHEADERGENERATOR_H
16
17#include "KConfigCodeGeneratorBase.h"
18#include "KConfigCommonStructs.h"
19
20#include <QList>
21#include <QString>
22
23class KConfigParameters;
24class CfgEntry;
25class QTextStream;
26struct ParseResult;
27
28class KConfigHeaderGenerator : public KConfigCodeGeneratorBase
29{
30public:
31 KConfigHeaderGenerator(const QString &inputFile, const QString &baseDir, const KConfigParameters &parameters, ParseResult &parseResult);
32
33 void start() override;
34
35private:
36 void startHeaderGuards();
37 void endHeaderGuards();
38
39 void implementEnums();
40 void implementChoiceEnums(const CfgEntry *entry, const CfgEntry::Choices &choices);
41 void implementValueEnums(const CfgEntry *entry, const QStringList &values);
42
43 void doClassDefinition();
44 void createHeaders();
45 void createDPointer();
46 void createNonDPointerHelpers();
47
48 void createConstructor();
49 void createDestructor();
50 void createForwardDeclarations();
51 void createSingleton();
52 void createSignals();
53
54 void createSetters(const CfgEntry *entry);
55 void createItemAcessors(const CfgEntry *entry, const QString &returnType);
56 void createGetters(const CfgEntry *entry, const QString &returnType);
57 void createImmutableGetters(const CfgEntry *entry);
58 void createProperties(const CfgEntry *entry, const QString &returnType);
59 void createImmutableProperty(const CfgEntry *entry);
60 void createDefaultValueMember(const CfgEntry *entry);
61};
62
63#endif
64

source code of kconfig/src/kconfig_compiler/KConfigHeaderGenerator.h