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
12class KNotificationReplyActionPrivate
13{
14public:
15 QString label;
16 QString placeholderText;
17 QString submitButtonText;
18 QString submitButtonIconName;
19 KNotificationReplyAction::FallbackBehavior fallbackBehavior = KNotificationReplyAction::FallbackBehavior::HideAction;
20};
21
22KNotificationReplyAction::KNotificationReplyAction(const QString &label)
23 : QObject()
24 , d(new KNotificationReplyActionPrivate)
25{
26 d->label = label;
27}
28
29KNotificationReplyAction::~KNotificationReplyAction() = default;
30
31QString KNotificationReplyAction::label() const
32{
33 return d->label;
34}
35
36void KNotificationReplyAction::setLabel(const QString &label)
37{
38 if (d->label != label) {
39 d->label = label;
40 Q_EMIT labelChanged();
41 }
42}
43
44QString KNotificationReplyAction::placeholderText() const
45{
46 return d->placeholderText;
47}
48
49void KNotificationReplyAction::setPlaceholderText(const QString &placeholderText)
50{
51 if (d->placeholderText != placeholderText) {
52 d->placeholderText = placeholderText;
53 Q_EMIT placeholderTextChanged();
54 }
55}
56
57QString KNotificationReplyAction::submitButtonText() const
58{
59 return d->submitButtonText;
60}
61
62void KNotificationReplyAction::setSubmitButtonText(const QString &submitButtonText)
63{
64 if (d->submitButtonText != submitButtonText) {
65 d->submitButtonText = submitButtonText;
66 Q_EMIT submitButtonTextChanged();
67 }
68}
69
70QString KNotificationReplyAction::submitButtonIconName() const
71{
72 return d->submitButtonIconName;
73}
74
75void KNotificationReplyAction::setSubmitButtonIconName(const QString &submitButtonIconName)
76{
77 if (d->submitButtonIconName != submitButtonIconName) {
78 d->submitButtonIconName = submitButtonIconName;
79 Q_EMIT submitButtonIconNameChanged();
80 }
81}
82
83KNotificationReplyAction::FallbackBehavior KNotificationReplyAction::fallbackBehavior() const
84{
85 return d->fallbackBehavior;
86}
87
88void 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

source code of knotifications/src/knotificationreplyaction.cpp