@@ -107,6 +107,12 @@ class Notification
107107 // /
108108 // / This image is often something like a profile picture in instant messaging applications.
109109 Q_PROPERTY (QString image READ default NOTIFY imageChanged BINDABLE bindableImage);
110+ // / If true, the notification has an inline reply action.
111+ // /
112+ // / A quick reply text field should be displayed and the reply can be sent using @@sendInlineReply().
113+ Q_PROPERTY (bool hasInlineReply READ default NOTIFY hasInlineReplyChanged BINDABLE bindableHasInlineReply);
114+ // / The placeholder text/button caption for the inline reply.
115+ Q_PROPERTY (QString inlineReplyPlaceholder READ default NOTIFY inlineReplyPlaceholderChanged BINDABLE bindableInlineReplyPlaceholder);
110116 // / All hints sent by the client application as a javascript object.
111117 // / Many common hints are exposed via other properties.
112118 Q_PROPERTY (QVariantMap hints READ default NOTIFY hintsChanged BINDABLE bindableHints);
@@ -124,6 +130,12 @@ class Notification
124130 // / explicitly closed by the user.
125131 Q_INVOKABLE void dismiss ();
126132
133+ // / Send an inline reply to the notification with an inline reply action.
134+ // / > [!WARNING] This method can only be called if
135+ // / > @@hasInlineReply is true
136+ // / > and the server has @@NotificationServer.inlineReplySupported set to true.
137+ Q_INVOKABLE void sendInlineReply (const QString& replyText);
138+
127139 void updateProperties (
128140 const QString& appName,
129141 QString appIcon,
@@ -158,6 +170,8 @@ class Notification
158170 [[nodiscard]] QBindable<bool > bindableTransient () const { return &this ->bTransient ; };
159171 [[nodiscard]] QBindable<QString> bindableDesktopEntry () const { return &this ->bDesktopEntry ; };
160172 [[nodiscard]] QBindable<QString> bindableImage () const { return &this ->bImage ; };
173+ [[nodiscard]] QBindable<bool > bindableHasInlineReply () const { return &this ->bHasInlineReply ; };
174+ [[nodiscard]] QBindable<QString> bindableInlineReplyPlaceholder () const { return &this ->bInlineReplyPlaceholder ; };
161175 [[nodiscard]] QBindable<QVariantMap> bindableHints () const { return &this ->bHints ; };
162176
163177 [[nodiscard]] NotificationCloseReason::Enum closeReason () const ;
@@ -182,6 +196,8 @@ class Notification
182196 void transientChanged ();
183197 void desktopEntryChanged ();
184198 void imageChanged ();
199+ void hasInlineReplyChanged ();
200+ void inlineReplyPlaceholderChanged ();
185201 void hintsChanged ();
186202
187203private:
@@ -202,6 +218,8 @@ class Notification
202218 Q_OBJECT_BINDABLE_PROPERTY (Notification, bool , bTransient, &Notification::transientChanged);
203219 Q_OBJECT_BINDABLE_PROPERTY (Notification, QString, bDesktopEntry, &Notification::desktopEntryChanged);
204220 Q_OBJECT_BINDABLE_PROPERTY (Notification, QString, bImage, &Notification::imageChanged);
221+ Q_OBJECT_BINDABLE_PROPERTY (Notification, bool , bHasInlineReply, &Notification::hasInlineReplyChanged);
222+ Q_OBJECT_BINDABLE_PROPERTY (Notification, QString, bInlineReplyPlaceholder, &Notification::inlineReplyPlaceholderChanged);
205223 Q_OBJECT_BINDABLE_PROPERTY (Notification, QVariantMap, bHints, &Notification::hintsChanged);
206224 // clang-format on
207225
0 commit comments