File indexing completed on 2024-04-14 03:54:12

0001 /*
0002     This file is part of the KDE Frameworks
0003     SPDX-FileCopyrightText: 2021 Kai Uwe Broulik <kde@broulik.de>
0004 
0005     SPDX-License-Identifier: LGPL-2.0-or-later
0006 */
0007 
0008 #include "knotificationreplyaction.h"
0009 
0010 #include <QString>
0011 
0012 class KNotificationReplyActionPrivate
0013 {
0014 public:
0015     QString label;
0016     QString placeholderText;
0017     QString submitButtonText;
0018     QString submitButtonIconName;
0019     KNotificationReplyAction::FallbackBehavior fallbackBehavior = KNotificationReplyAction::FallbackBehavior::HideAction;
0020 };
0021 
0022 KNotificationReplyAction::KNotificationReplyAction(const QString &label)
0023     : QObject()
0024     , d(new KNotificationReplyActionPrivate)
0025 {
0026     d->label = label;
0027 }
0028 
0029 KNotificationReplyAction::~KNotificationReplyAction() = default;
0030 
0031 QString KNotificationReplyAction::label() const
0032 {
0033     return d->label;
0034 }
0035 
0036 void KNotificationReplyAction::setLabel(const QString &label)
0037 {
0038     if (d->label != label) {
0039         d->label = label;
0040         Q_EMIT labelChanged();
0041     }
0042 }
0043 
0044 QString KNotificationReplyAction::placeholderText() const
0045 {
0046     return d->placeholderText;
0047 }
0048 
0049 void KNotificationReplyAction::setPlaceholderText(const QString &placeholderText)
0050 {
0051     if (d->placeholderText != placeholderText) {
0052         d->placeholderText = placeholderText;
0053         Q_EMIT placeholderTextChanged();
0054     }
0055 }
0056 
0057 QString KNotificationReplyAction::submitButtonText() const
0058 {
0059     return d->submitButtonText;
0060 }
0061 
0062 void KNotificationReplyAction::setSubmitButtonText(const QString &submitButtonText)
0063 {
0064     if (d->submitButtonText != submitButtonText) {
0065         d->submitButtonText = submitButtonText;
0066         Q_EMIT submitButtonTextChanged();
0067     }
0068 }
0069 
0070 QString KNotificationReplyAction::submitButtonIconName() const
0071 {
0072     return d->submitButtonIconName;
0073 }
0074 
0075 void KNotificationReplyAction::setSubmitButtonIconName(const QString &submitButtonIconName)
0076 {
0077     if (d->submitButtonIconName != submitButtonIconName) {
0078         d->submitButtonIconName = submitButtonIconName;
0079         Q_EMIT submitButtonIconNameChanged();
0080     }
0081 }
0082 
0083 KNotificationReplyAction::FallbackBehavior KNotificationReplyAction::fallbackBehavior() const
0084 {
0085     return d->fallbackBehavior;
0086 }
0087 
0088 void KNotificationReplyAction::setFallbackBehavior(FallbackBehavior fallbackBehavior)
0089 {
0090     if (d->fallbackBehavior != fallbackBehavior) {
0091         d->fallbackBehavior = fallbackBehavior;
0092         Q_EMIT fallbackBehaviorChanged();
0093     }
0094 }
0095 
0096 #include "moc_knotificationreplyaction.cpp"