| 1 | /* |
|---|---|
| 2 | This file is part of the KDE Frameworks |
| 3 | SPDX-FileCopyrightText: 2021 Kai Uwe Broulik <kde@broulik.de> |
| 4 | |
| 5 | SPDX-License-Identifier: LGPL-2.0-or-later |
| 6 | */ |
| 7 | |
| 8 | #include "knotificationreplyaction.h" |
| 9 | |
| 10 | #include <QString> |
| 11 | |
| 12 | class KNotificationReplyActionPrivate |
| 13 | { |
| 14 | public: |
| 15 | QString label; |
| 16 | QString placeholderText; |
| 17 | QString submitButtonText; |
| 18 | QString submitButtonIconName; |
| 19 | KNotificationReplyAction::FallbackBehavior fallbackBehavior = KNotificationReplyAction::FallbackBehavior::HideAction; |
| 20 | }; |
| 21 | |
| 22 | KNotificationReplyAction::KNotificationReplyAction(const QString &label) |
| 23 | : QObject() |
| 24 | , d(new KNotificationReplyActionPrivate) |
| 25 | { |
| 26 | d->label = label; |
| 27 | } |
| 28 | |
| 29 | KNotificationReplyAction::~KNotificationReplyAction() = default; |
| 30 | |
| 31 | QString KNotificationReplyAction::label() const |
| 32 | { |
| 33 | return d->label; |
| 34 | } |
| 35 | |
| 36 | void KNotificationReplyAction::setLabel(const QString &label) |
| 37 | { |
| 38 | if (d->label != label) { |
| 39 | d->label = label; |
| 40 | Q_EMIT labelChanged(); |
| 41 | } |
| 42 | } |
| 43 | |
| 44 | QString KNotificationReplyAction::placeholderText() const |
| 45 | { |
| 46 | return d->placeholderText; |
| 47 | } |
| 48 | |
| 49 | void KNotificationReplyAction::setPlaceholderText(const QString &placeholderText) |
| 50 | { |
| 51 | if (d->placeholderText != placeholderText) { |
| 52 | d->placeholderText = placeholderText; |
| 53 | Q_EMIT placeholderTextChanged(); |
| 54 | } |
| 55 | } |
| 56 | |
| 57 | QString KNotificationReplyAction::submitButtonText() const |
| 58 | { |
| 59 | return d->submitButtonText; |
| 60 | } |
| 61 | |
| 62 | void KNotificationReplyAction::setSubmitButtonText(const QString &submitButtonText) |
| 63 | { |
| 64 | if (d->submitButtonText != submitButtonText) { |
| 65 | d->submitButtonText = submitButtonText; |
| 66 | Q_EMIT submitButtonTextChanged(); |
| 67 | } |
| 68 | } |
| 69 | |
| 70 | QString KNotificationReplyAction::submitButtonIconName() const |
| 71 | { |
| 72 | return d->submitButtonIconName; |
| 73 | } |
| 74 | |
| 75 | void KNotificationReplyAction::setSubmitButtonIconName(const QString &submitButtonIconName) |
| 76 | { |
| 77 | if (d->submitButtonIconName != submitButtonIconName) { |
| 78 | d->submitButtonIconName = submitButtonIconName; |
| 79 | Q_EMIT submitButtonIconNameChanged(); |
| 80 | } |
| 81 | } |
| 82 | |
| 83 | KNotificationReplyAction::FallbackBehavior KNotificationReplyAction::fallbackBehavior() const |
| 84 | { |
| 85 | return d->fallbackBehavior; |
| 86 | } |
| 87 | |
| 88 | void KNotificationReplyAction::setFallbackBehavior(FallbackBehavior fallbackBehavior) |
| 89 | { |
| 90 | if (d->fallbackBehavior != fallbackBehavior) { |
| 91 | d->fallbackBehavior = fallbackBehavior; |
| 92 | Q_EMIT fallbackBehaviorChanged(); |
| 93 | } |
| 94 | } |
| 95 | |
| 96 | #include "moc_knotificationreplyaction.cpp" |
| 97 |
