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

KDE's Doxygen guidelines are available online.