Warning, file /pim/mailcommon/src/snippets/snippetwidget.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001 /* 0002 SPDX-FileCopyrightText: 2019-2024 Laurent Montel <montel@kde.org> 0003 0004 SPDX-License-Identifier: LGPL-2.0-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL 0005 */ 0006 0007 #pragma once 0008 0009 #include "mailcommon_export.h" 0010 #include <QAbstractItemModel> 0011 #include <QWidget> 0012 class KActionCollection; 0013 class SnippetWidgetPrivate; 0014 namespace MailCommon 0015 { 0016 /** 0017 * @brief The SnippetWidget class 0018 * @author Laurent Montel <montel@kde.org> 0019 */ 0020 class MAILCOMMON_EXPORT SnippetWidget : public QWidget 0021 { 0022 Q_OBJECT 0023 public: 0024 explicit SnippetWidget(QWidget *parent = nullptr); 0025 ~SnippetWidget() override; 0026 0027 void setName(const QString &name); 0028 [[nodiscard]] QString name() const; 0029 0030 void setText(const QString &text); 0031 [[nodiscard]] QString text() const; 0032 0033 void setKeySequence(const QKeySequence &sequence); 0034 [[nodiscard]] QKeySequence keySequence() const; 0035 0036 void setKeyword(const QString &keyword); 0037 [[nodiscard]] QString keyword() const; 0038 0039 void setTo(const QString &keyword); 0040 [[nodiscard]] QString to() const; 0041 0042 void setCc(const QString &keyword); 0043 [[nodiscard]] QString cc() const; 0044 0045 void setBcc(const QString &keyword); 0046 [[nodiscard]] QString bcc() const; 0047 0048 void setGroupModel(QAbstractItemModel *model); 0049 void setGroupIndex(const QModelIndex &index); 0050 0051 [[nodiscard]] QModelIndex groupIndex() const; 0052 [[nodiscard]] bool snippetIsValid() const; 0053 0054 void setCheckActionCollections(const QList<KActionCollection *> &lst); 0055 0056 void setGroupSelected(bool b); 0057 0058 [[nodiscard]] bool isGroupSelected() const; 0059 void clear(); 0060 0061 [[nodiscard]] bool wasChanged() const; 0062 void setWasChanged(bool b); 0063 0064 void setSubject(const QString &text); 0065 [[nodiscard]] QString subject() const; 0066 0067 void setAttachment(const QString &keyword); 0068 [[nodiscard]] QString attachment() const; 0069 0070 Q_SIGNALS: 0071 void textChanged(const QString &str); 0072 void groupChanged(int index); 0073 0074 private: 0075 std::unique_ptr<SnippetWidgetPrivate> const d; 0076 }; 0077 }