KConfig

KConfigSourceGenerator.h
1 /*
2  This file is part of KDE.
3 
4  SPDX-FileCopyrightText: 2003 Cornelius Schumacher <[email protected]>
5  SPDX-FileCopyrightText: 2003 Waldo Bastian <[email protected]>
6  SPDX-FileCopyrightText: 2003 Zack Rusin <[email protected]>
7  SPDX-FileCopyrightText: 2006 MichaĆ«l Larouche <[email protected]>
8  SPDX-FileCopyrightText: 2008 Allen Winter <[email protected]>
9  SPDX-FileCopyrightText: 2020 Tomaz Cananbrava <[email protected]>
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 
23 class KConfigParameters;
24 class CfgEntry;
25 class QTextStream;
26 struct ParseResult;
27 
28 class KConfigSourceGenerator : public KConfigCodeGeneratorBase
29 {
30 public:
31  KConfigSourceGenerator(const QString &inputFile, const QString &baseDir, const KConfigParameters &parameters, ParseResult &parseResult);
32 
33  void start() override;
34 
35 private:
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  void includeMoc();
49 
50  // Constructor related methods
51  // the `do` methods have related helper functions that are only related
52  // to it. So we can break the function into many smaller ones and create
53  // logic inside of the `do` function.
54  void doConstructor();
55  void createEnums(const CfgEntry *entry);
56  void createNormalEntry(const CfgEntry *entry, const QString &key);
57  void createIndexedEntry(const CfgEntry *entry, const QString &key);
58  void handleCurrentGroupChange(const CfgEntry *entry);
59 
60  void doGetterSetterDPointerMode();
61  void createGetterDPointerMode(const CfgEntry *entry);
62  void createImmutableGetterDPointerMode(const CfgEntry *entry);
63  void createSetterDPointerMode(const CfgEntry *entry);
64  void createItemGetterDPointerMode(const CfgEntry *entry);
65 
66 private:
67  QString mCurrentGroup;
68  QStringList mConfigGroupList; // keeps track of generated KConfigGroup;
69 };
70 
71 #endif
Configuration Compiler Configuration.
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Thu Jun 24 2021 22:48:28 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.