File indexing completed on 2024-05-12 03:54:30

0001 /*
0002     This file is part of KDE.
0003 
0004     SPDX-FileCopyrightText: 2003 Cornelius Schumacher <schumacher@kde.org>
0005     SPDX-FileCopyrightText: 2003 Waldo Bastian <bastian@kde.org>
0006     SPDX-FileCopyrightText: 2003 Zack Rusin <zack@kde.org>
0007     SPDX-FileCopyrightText: 2006 Michaƫl Larouche <michael.larouche@kdemail.net>
0008     SPDX-FileCopyrightText: 2008 Allen Winter <winter@kde.org>
0009     SPDX-FileCopyrightText: 2020 Tomaz Cananbrava <tcanabrava@kde.org>
0010 
0011     SPDX-License-Identifier: LGPL-2.0-or-later
0012 */
0013 
0014 #ifndef KCONFIGHEADERGENERATOR_H
0015 #define KCONFIGHEADERGENERATOR_H
0016 
0017 #include "KConfigCodeGeneratorBase.h"
0018 #include "KConfigCommonStructs.h"
0019 
0020 #include <QList>
0021 #include <QString>
0022 
0023 class KConfigParameters;
0024 class CfgEntry;
0025 class QTextStream;
0026 struct ParseResult;
0027 
0028 class KConfigHeaderGenerator : public KConfigCodeGeneratorBase
0029 {
0030 public:
0031     KConfigHeaderGenerator(const QString &inputFile, const QString &baseDir, const KConfigParameters &parameters, ParseResult &parseResult);
0032 
0033     void start() override;
0034 
0035 private:
0036     void startHeaderGuards();
0037     void endHeaderGuards();
0038 
0039     void implementEnums();
0040     void implementChoiceEnums(const CfgEntry *entry, const CfgEntry::Choices &choices);
0041     void implementValueEnums(const CfgEntry *entry, const QStringList &values);
0042 
0043     void doClassDefinition();
0044     void createHeaders();
0045     void createDPointer();
0046     void createNonDPointerHelpers();
0047 
0048     void createConstructor();
0049     void createDestructor();
0050     void createForwardDeclarations();
0051     void createSingleton();
0052     void createSignals();
0053 
0054     void createSetters(const CfgEntry *entry);
0055     void createItemAcessors(const CfgEntry *entry, const QString &returnType);
0056     void createGetters(const CfgEntry *entry, const QString &returnType);
0057     void createImmutableGetters(const CfgEntry *entry);
0058     void createProperties(const CfgEntry *entry, const QString &returnType);
0059     void createImmutableProperty(const CfgEntry *entry);
0060     void createDefaultValueMember(const CfgEntry *entry);
0061 };
0062 
0063 #endif