Messagelib

optionseteditor.h
1 /******************************************************************************
2  *
3  * SPDX-FileCopyrightText: 2008 Szymon Tomasz Stefanek <[email protected]>
4  *
5  * SPDX-License-Identifier: GPL-2.0-or-later
6  *
7  *******************************************************************************/
8 
9 #pragma once
10 
11 #include <QTabWidget>
12 
13 class QLineEdit;
14 class KTextEdit;
15 
16 namespace MessageList
17 {
18 namespace Core
19 {
20 class OptionSet;
21 } // namespace Core
22 
23 namespace Utils
24 {
25 /**
26  * The base class for the OptionSet editors. Provides common functionality.
27  */
29 {
30  Q_OBJECT
31 
32 public:
33  explicit OptionSetEditor(QWidget *parent);
34  ~OptionSetEditor() override;
35  void setReadOnly(bool readOnly);
36 
37 protected:
38  /**
39  * Returns the editor for the name of the OptionSet.
40  * Derived classes are responsible of filling this UI element and reading back data from it.
41  */
42  QLineEdit *nameEdit() const;
43 
44  /**
45  * Returns the editor for the description of the OptionSet.
46  * Derived classes are responsible of filling this UI element and reading back data from it.
47  */
48  KTextEdit *descriptionEdit() const;
49 
50 protected Q_SLOTS:
51  /**
52  * Handles editing of the name field.
53  * Pure virtual slot. Derived classes must provide an implementation.
54  */
55  virtual void slotNameEditTextEdited(const QString &newName) = 0;
56 
57 private:
58  QLineEdit *mNameEdit = nullptr; ///< The editor for the OptionSet name
59  KTextEdit *mDescriptionEdit = nullptr; ///< The editor for the OptionSet description
60 };
61 } // namespace Utils
62 } // namespace MessageList
63 
The base class for the OptionSet editors.
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Tue Nov 30 2021 23:05:47 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.