KConfig

KConfigSourceGenerator.h
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 KCONFIGSOURCEGENERATOR_H
15#define KCONFIGSOURCEGENERATOR_H
16
17#include "KConfigCodeGeneratorBase.h"
18#include "KConfigCommonStructs.h"
19
20#include <QList>
21#include <QString>
22
24class CfgEntry;
25class QTextStream;
26struct ParseResult;
27
28class KConfigSourceGenerator : public KConfigCodeGeneratorBase
29{
30public:
31 KConfigSourceGenerator(const QString &inputFile, const QString &baseDir, const KConfigParameters &parameters, ParseResult &parseResult);
32
33 void start() override;
34
35private:
36 // Those are fairly self contained functions.
37 void createHeaders();
38 void createPrivateDPointerImplementation();
39 void createSingletonImplementation();
40 void createPreamble();
41 void createDestructor();
42 void createConstructorParameterList();
43 void createParentConstructorCall();
44 void createInitializerList();
45 void createDefaultValueGetterSetter();
46 void createNonModifyingSignalsHelper();
47 void createSignalFlagsHandler();
48
49 // Constructor related methods
50 // the `do` methods have related helper functions that are only related
51 // to it. So we can break the function into many smaller ones and create
52 // logic inside of the `do` function.
53 void doConstructor();
54 void createEnums(const CfgEntry *entry);
55 void createNormalEntry(const CfgEntry *entry, const QString &key);
56 void createIndexedEntry(const CfgEntry *entry, const QString &key);
57 void handleCurrentGroupChange(const CfgEntry *entry);
58
59 void doGetterSetterDPointerMode();
60 void createGetterDPointerMode(const CfgEntry *entry);
61 void createImmutableGetterDPointerMode(const CfgEntry *entry);
62 void createSetterDPointerMode(const CfgEntry *entry);
63 void createItemGetterDPointerMode(const CfgEntry *entry);
64
65private:
66 QString mCurrentGroup;
67 QStringList mConfigGroupList; // keeps track of generated KConfigGroup;
68};
69
70#endif
Configuration Compiler Configuration.
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Oct 11 2024 12:17:22 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.