Changeset View
Changeset View
Standalone View
Standalone View
src/kconfig_compiler/KConfigHeaderGenerator.h
- This file was added.
1 | /* | ||||
---|---|---|---|---|---|
2 | This file is part of KDE. | ||||
3 | | ||||
4 | Copyright (C) 2020 Tomaz Cananbrava (tcanabrava@kde.org) | ||||
5 | Copyright (c) 2003 Cornelius Schumacher <schumacher@kde.org> | ||||
6 | Copyright (c) 2003 Waldo Bastian <bastian@kde.org> | ||||
7 | Copyright (c) 2003 Zack Rusin <zack@kde.org> | ||||
8 | Copyright (c) 2006 Michaël Larouche <michael.larouche@kdemail.net> | ||||
9 | Copyright (c) 2008 Allen Winter <winter@kde.org> | ||||
10 | Copyright (C) 2020 Tomaz Cananbrava (tcanabrava@kde.org) | ||||
11 | | ||||
12 | This library is free software; you can redistribute it and/or | ||||
13 | modify it under the terms of the GNU Library General Public | ||||
14 | License as published by the Free Software Foundation; either | ||||
15 | version 2 of the License, or (at your option) any later version. | ||||
16 | | ||||
17 | This library is distributed in the hope that it will be useful, | ||||
18 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||||
19 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||||
20 | Library General Public License for more details. | ||||
21 | | ||||
22 | You should have received a copy of the GNU Library General Public License | ||||
23 | along with this library; see the file COPYING.LIB. If not, write to | ||||
24 | the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | ||||
25 | Boston, MA 02110-1301, USA. | ||||
26 | */ | ||||
27 | | ||||
28 | #ifndef KCONFIGHEADERGENERATOR_H | ||||
29 | #define KCONFIGHEADERGENERATOR_H | ||||
30 | | ||||
31 | #include "KConfigCodeGeneratorBase.h" | ||||
32 | #include "KConfigCommonStructs.h" | ||||
33 | | ||||
34 | #include <QString> | ||||
35 | #include <QList> | ||||
36 | | ||||
37 | class KConfigXTParameters; | ||||
38 | class CfgEntry; | ||||
39 | class QTextStream; | ||||
40 | struct ParseResult; | ||||
41 | | ||||
42 | class KConfigHeaderGenerator : public KConfigCodeGeneratorBase { | ||||
43 | public: | ||||
44 | KConfigHeaderGenerator( | ||||
45 | const QString& inputFile, | ||||
46 | const QString& baseDir, | ||||
47 | const KConfigXTParameters ¶meters, | ||||
48 | ParseResult &parseResult); | ||||
49 | | ||||
50 | void start() override; | ||||
51 | | ||||
52 | private: | ||||
53 | void startHeaderGuards(); | ||||
54 | void endHeaderGuards(); | ||||
55 | | ||||
56 | void implementEnums(); | ||||
57 | void implementChoiceEnums(const CfgEntry *entry, const CfgEntry::Choices &choices); | ||||
58 | void implementValueEnums(const CfgEntry *entry, const QStringList &values); | ||||
59 | | ||||
60 | void doClassDefinition(); | ||||
61 | void createHeaders(); | ||||
62 | void createDPointer(); | ||||
63 | void createNonDPointerHelpers(); | ||||
64 | | ||||
65 | void createConstructor(); | ||||
66 | void createDestructor(); | ||||
67 | void createForwardDeclarations(); | ||||
68 | void createSingleton(); | ||||
69 | void createSignals(); | ||||
70 | | ||||
71 | void createSetters(const CfgEntry *entry); | ||||
72 | void createItemAcessors(const CfgEntry *entry, const QString& returnType); | ||||
73 | void createGetters(const CfgEntry *entry, const QString& returnType); | ||||
74 | void createProperties(const CfgEntry *entry, const QString& returnType); | ||||
75 | void createDefaultValueMember(const CfgEntry *entry); | ||||
76 | }; | ||||
77 | | ||||
78 | #endif |