26#include "units/Timespan.h"
28using namespace Qt::Literals::StringLiterals;
30namespace Notifications {
69 Q_ENUM(TextBodyAction);
91 QObject* parent =
nullptr);
172 [[nodiscard]] QString
button1Text()
const {
return m_button1Text; }
178 [[nodiscard]] QString
button2Text()
const {
return m_button2Text; }
202 [[nodiscard]] QString
text()
const {
return m_text; }
214 [[nodiscard]] QString
title()
const {
return m_title; }
305 QString m_button1Text {tr(
"Dismiss")};
306 QString m_button2Text;
309 QString m_spokenText;
310 QString m_title {u
"Placeholder title"_s};
void setButton1Text(const QString &newButton1Text)
Setter function for property of the same name.
QString button2Text() const
Getter function for property of the same name.
void button2TextChanged()
Notification signal.
Notification(QString _title, Notifications::Notification::Importance _importance=Notifications::Notification::Info, QObject *parent=nullptr)
Standard constructor.
void setButton2Text(const QString &newButton2Text)
Setter function for property of the same name.
TextBodyAction
Text body action.
@ OpenMapsAndDataPage
Open the page 'maps and data'.
@ OpenTrafficReceiverPage
Open the page 'traffic receiver'.
void setSpokenText(const QString &newSpokenText)
Setter function for property of the same name.
void setReactionTime(Units::Timespan newReactionTime)
Setter function for property of the same name.
Notifications::Notification::Importance importance
Importance of the notification.
void spokenTextChanged()
Notification signal.
Importance
Importance classification.
@ Warning_Navigation
Serious warning, "Prohibited Airspace 1 minutes ahead".
@ Info
Generic information, "Map updates available".
@ Info_Navigation
Information pertaining to navigation, "Top of descent reached".
@ Alert
Alert. Immediate action is required to avoid accident or serious rule infringion.
@ Warning
Generic warning, "Traffic data receiver inop".
QString text
Text body of the notification.
Units::Timespan reactionTime() const
Getter function for property of the same name.
QString title() const
Getter function for property of the same name.
QString spokenText() const
Getter function for property of the same name.
Notifications::Notification::Importance importance() const
Getter function for property of the same name.
QString text() const
Getter function for property of the same name.
virtual Q_INVOKABLE void onButton2Clicked()
Mouse click handler.
void reactionTimeChanged()
Notification signal.
void button1TextChanged()
Notification signal.
QString button2Text
Text for second button.
QString title
Title of the notification.
virtual Q_INVOKABLE void onButton1Clicked()
Mouse click handler.
Units::Timespan reactionTime
Time left to avert negative consequences.
void textBodyActionChanged()
Notification signal.
QString spokenText
Spoken text message for the notification.
Notifications::Notification::TextBodyAction textBodyAction
Text body action.
~Notification() override=default
Standard destructor.
QString button1Text
Text for first button.
Notifications::Notification::TextBodyAction textBodyAction() const
Getter function for property of the same name.
void setTextBodyAction(Notifications::Notification::TextBodyAction newTextBodyAction)
Setter function for property of the same name.
void textChanged()
Notification signal.
void setText(const QString &newText)
Setter function for property of the same name.
Convenience class for time computations.
Conversion between units used in aviation.