Mailcommon

snippetdialog.h
1 /*
2  snippet feature from kdevelop/plugins/snippet/
3 
4  SPDX-FileCopyrightText: 2007 Robert Gruber <[email protected]>
5  SPDX-FileCopyrightText: 2019-2022 Laurent Montel <[email protected]>
6 
7  SPDX-License-Identifier: GPL-2.0-or-later
8 */
9 
10 #pragma once
11 
12 #include <QDialog>
13 
14 class KActionCollection;
15 
16 class QAbstractItemModel;
17 class QModelIndex;
18 class QPushButton;
19 
20 namespace MailCommon
21 {
22 class SnippetWidget;
23 class SnippetDialog : public QDialog
24 {
25  Q_OBJECT
26 
27 public:
28  explicit SnippetDialog(KActionCollection *actionCollection, bool inGroupMode, QWidget *parent = nullptr);
29  ~SnippetDialog() override;
30 
31  void setName(const QString &name);
32  Q_REQUIRED_RESULT QString name() const;
33 
34  void setText(const QString &text);
35  Q_REQUIRED_RESULT QString text() const;
36 
37  void setSubject(const QString &text);
38  Q_REQUIRED_RESULT QString subject() const;
39 
40  void setKeySequence(const QKeySequence &sequence);
41  Q_REQUIRED_RESULT QKeySequence keySequence() const;
42 
43  void setKeyword(const QString &keyword);
44  Q_REQUIRED_RESULT QString keyword() const;
45 
46  void setTo(const QString &keyword);
47  Q_REQUIRED_RESULT QString to() const;
48 
49  void setCc(const QString &keyword);
50  Q_REQUIRED_RESULT QString cc() const;
51 
52  void setBcc(const QString &keyword);
53  Q_REQUIRED_RESULT QString bcc() const;
54 
55  void setGroupModel(QAbstractItemModel *model);
56 
57  void setGroupIndex(const QModelIndex &index);
58  Q_REQUIRED_RESULT QModelIndex groupIndex() const;
59 
60  void setAttachment(const QString &keyword);
61  Q_REQUIRED_RESULT QString attachment() const;
62 
63 private:
64  void slotTextChanged();
65  void slotGroupChanged();
66  bool snippetIsValid() const;
67  void writeConfig();
68  void readConfig();
69 
70  KActionCollection *mActionCollection = nullptr;
71  SnippetWidget *const mSnippetWidget;
72  QPushButton *mOkButton = nullptr;
73  bool mInGroupMode = false;
74 };
75 }
Q_OBJECTQ_OBJECT
void readConfig()
void keySequence(QWindow *window, const QKeySequence &keySequence)
QString name(StandardShortcut id)
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.