Messagelib

templatesconfiguration.h
1 /*
2  * SPDX-FileCopyrightText: 2006 Dmitry Morozhnikov <[email protected]>
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"
11 class QPlainTextEdit;
12 namespace TemplateParser
13 {
14 class TemplatesConfigurationPrivate;
15 /**
16  * @brief The TemplatesConfiguration class
17  */
18 class TEMPLATEPARSER_EXPORT TemplatesConfiguration : public QWidget, Ui::TemplatesConfigurationBase
19 {
20  Q_OBJECT
21 
22 public:
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  Q_REQUIRED_RESULT static QString configIdString(uint id);
40 
41 public Q_SLOTS:
42  void slotInsertCommand(const QString &cmd, int adjustCursor = 0);
43  void slotTextChanged();
44 
45 Q_SIGNALS:
46  void changed();
47 
48 private:
49  void slotHelpLinkClicked(const QString &);
50  Q_REQUIRED_RESULT QPlainTextEdit *currentTextEdit() const;
51  Q_REQUIRED_RESULT 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-2023 The KDE developers.
Generated on Wed Mar 22 2023 04:07:15 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.