Mailcommon

snippetwidget.h
1 /*
2  SPDX-FileCopyrightText: 2019-2022 Laurent Montel <[email protected]>
3 
4  SPDX-License-Identifier: LGPL-2.0-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
5 */
6 
7 #pragma once
8 
9 #include "mailcommon_export.h"
10 #include <QAbstractItemModel>
11 #include <QWidget>
12 class KActionCollection;
13 class SnippetWidgetPrivate;
14 namespace MailCommon
15 {
16 /**
17  * @brief The SnippetWidget class
18  * @author Laurent Montel <[email protected]>
19  */
20 class MAILCOMMON_EXPORT SnippetWidget : public QWidget
21 {
22  Q_OBJECT
23 public:
24  explicit SnippetWidget(QWidget *parent = nullptr);
25  ~SnippetWidget() override;
26 
27  void setName(const QString &name);
28  Q_REQUIRED_RESULT QString name() const;
29 
30  void setText(const QString &text);
31  Q_REQUIRED_RESULT QString text() const;
32 
33  void setKeySequence(const QKeySequence &sequence);
34  Q_REQUIRED_RESULT QKeySequence keySequence() const;
35 
36  void setKeyword(const QString &keyword);
37  Q_REQUIRED_RESULT QString keyword() const;
38 
39  void setTo(const QString &keyword);
40  Q_REQUIRED_RESULT QString to() const;
41 
42  void setCc(const QString &keyword);
43  Q_REQUIRED_RESULT QString cc() const;
44 
45  void setBcc(const QString &keyword);
46  Q_REQUIRED_RESULT QString bcc() const;
47 
48  void setGroupModel(QAbstractItemModel *model);
49  void setGroupIndex(const QModelIndex &index);
50 
51  Q_REQUIRED_RESULT QModelIndex groupIndex() const;
52  Q_REQUIRED_RESULT bool snippetIsValid() const;
53 
54  void setCheckActionCollections(const QList<KActionCollection *> &lst);
55 
56  void setGroupSelected(bool b);
57 
58  Q_REQUIRED_RESULT bool isGroupSelected() const;
59  void clear();
60 
61  Q_REQUIRED_RESULT bool wasChanged() const;
62  void setWasChanged(bool b);
63 
64  void setSubject(const QString &text);
65  Q_REQUIRED_RESULT QString subject() const;
66 
67  void setAttachment(const QString &keyword);
68  Q_REQUIRED_RESULT QString attachment() const;
69 
70 Q_SIGNALS:
71  void textChanged(const QString &str);
72  void groupChanged(int index);
73 
74 private:
75  std::unique_ptr<SnippetWidgetPrivate> const d;
76 };
77 }
The SnippetWidget class.
Definition: snippetwidget.h:20
The filter dialog.
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Sat Sep 24 2022 03:58:15 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.