Messagelib

templatesconfiguration.h
1/*
2 * SPDX-FileCopyrightText: 2006 Dmitry Morozhnikov <dmiceman@mail.ru>
3 *
4 * SPDX-License-Identifier: GPL-2.0-or-later
5 */
6
7#pragma once
8
9#include "templateparser_export.h"
10#include "ui_templatesconfiguration_base.h"
11class QPlainTextEdit;
12namespace TemplateParser
13{
14class TemplatesConfigurationPrivate;
15/**
16 * @brief The TemplatesConfiguration class
17 */
18class TEMPLATEPARSER_EXPORT TemplatesConfiguration : public QWidget, Ui::TemplatesConfigurationBase
19{
20 Q_OBJECT
21
22public:
23 explicit TemplatesConfiguration(QWidget *parent = nullptr, const QString &name = QString());
24 ~TemplatesConfiguration() override;
25
26 void loadFromGlobal();
27 void saveToGlobal();
28 void loadFromIdentity(uint id);
29 void saveToIdentity(uint id);
30 void loadFromFolder(const QString &id, uint identity = 0);
31 void saveToFolder(const QString &id);
32 void resetToDefault();
33
34 QLabel *helpLabel() const;
35
36 /**
37 * Returns the template configuration identifier string for a given identity.
38 */
39 [[nodiscard]] static QString configIdString(uint id);
40
41public Q_SLOTS:
42 void slotInsertCommand(const QString &cmd, int adjustCursor = 0);
43 void slotTextChanged();
44
45Q_SIGNALS:
46 void changed();
47
48private:
49 TEMPLATEPARSER_NO_EXPORT void slotHelpLinkClicked(const QString &);
50 [[nodiscard]] TEMPLATEPARSER_NO_EXPORT QPlainTextEdit *currentTextEdit() const;
51 [[nodiscard]] TEMPLATEPARSER_NO_EXPORT QString strOrBlank(const QString &str);
52 std::unique_ptr<TemplatesConfigurationPrivate> const d;
53};
54}
The TemplatesConfiguration class.
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sun Feb 25 2024 18:37:31 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.