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  static Q_REQUIRED_RESULT QString configIdString(uint id);
40 
41 public Q_SLOTS:
42  void slotInsertCommand(const QString &cmd, int adjustCursor = 0);
43  void slotTextChanged();
44 
45 private Q_SLOTS:
46  void slotHelpLinkClicked(const QString &);
47 
48 Q_SIGNALS:
49  void changed();
50 
51 private:
52  Q_REQUIRED_RESULT QPlainTextEdit *currentTextEdit() const;
53  Q_REQUIRED_RESULT QString strOrBlank(const QString &str);
54  std::unique_ptr<TemplatesConfigurationPrivate> const d;
55 };
56 }
57 
const QLatin1String name
The TemplatesConfiguration class.
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Tue Nov 30 2021 23:05:48 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.