Pimcommon

templatemanager.h
1/*
2 SPDX-FileCopyrightText: 2013-2024 Laurent Montel <montel@kde.org>
3
4 SPDX-License-Identifier: GPL-2.0-or-later
5*/
6
7#pragma once
8
9#include "pimcommon_export.h"
10#include <QObject>
11#include <memory>
12
13namespace PimCommon
14{
15class TemplateListWidget;
16struct TemplateInfo {
17 QString name;
18 QString script;
19 [[nodiscard]] bool isValid() const
20 {
21 return !name.isEmpty() && !script.isEmpty();
22 }
23
24 void debug() const;
25};
26class TemplateManagerPrivate;
27/**
28 * @brief The TemplateManager class
29 * @author Laurent Montel <montel@kde.org>
30 */
31class PIMCOMMON_EXPORT TemplateManager : public QObject
32{
33 Q_OBJECT
34public:
35 explicit TemplateManager(const QString &relativeTemplateDir, PimCommon::TemplateListWidget *sieveTemplateWidget);
36 ~TemplateManager() override;
37
38private:
39 PIMCOMMON_NO_EXPORT void slotDirectoryChanged();
40 PIMCOMMON_NO_EXPORT void loadTemplates(bool init = false);
41 PIMCOMMON_NO_EXPORT void initTemplatesDirectories(const QString &templatesRelativePath);
42 [[nodiscard]] PIMCOMMON_NO_EXPORT TemplateInfo loadTemplate(const QString &themePath, const QString &defaultDesktopFileName);
43
44 std::unique_ptr<TemplateManagerPrivate> const d;
45};
46}
The TemplateListWidget class.
The TemplateManager class.
QString name(StandardAction id)
folderdialogacltab.h
bool isEmpty() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 17:02:55 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.