6#ifndef SWIFT_GUI_OVERLAYMESSAGES_H
7#define SWIFT_GUI_OVERLAYMESSAGES_H
15#include <QScopedPointer>
34 class COverlayMessages;
36namespace swift::misc::network
97 bool appendOldMessages,
const QString &confirmationMessage,
98 std::function<
void()> okLambda,
100 std::chrono::milliseconds timeout = std::chrono::milliseconds(0));
107 std::chrono::milliseconds timeout = std::chrono::milliseconds(0));
111 bool appendOldMessages =
false,
112 std::chrono::milliseconds timeout = std::chrono::milliseconds(0));
116 bool appendOldMessages =
false,
117 std::chrono::milliseconds timeout = std::chrono::milliseconds(0));
129 std::chrono::milliseconds timeout = std::chrono::milliseconds(0));
133 std::chrono::milliseconds timeout = std::chrono::milliseconds(0));
143 std::chrono::milliseconds timeout = std::chrono::milliseconds(0));
150 std::chrono::milliseconds timeout = std::chrono::milliseconds(0));
154 std::chrono::milliseconds timeout = std::chrono::milliseconds(0));
158 std::chrono::milliseconds timeout = std::chrono::milliseconds(0));
162 std::chrono::milliseconds timeout = std::chrono::milliseconds(0));
166 std::chrono::milliseconds timeout = std::chrono::milliseconds(0));
189 void display(std::chrono::milliseconds timeout = std::chrono::milliseconds(0));
199 bool m_awaitingConfirmation =
false;
200 bool m_hasKillButton =
false;
201 bool m_forceSmall =
false;
202 QTimer m_autoCloseTimer {
this };
203 std::function<void()> m_okLambda;
204 QList<std::function<void()>> m_pendingMessageCalls;
207 void onStyleSheetsChanged();
213 void onCancelClicked();
216 void init(
int w,
int h);
219 void setHeader(
const QString &header);
222 bool useSmall()
const;
void setDefaultConfirmationButton(int button=QMessageBox::Cancel)
Set the default confirmation button.
void setModeToProgressBar()
Progress bar.
void setModeToOverlayTextMessage()
Inline text message.
void sortOverlayMessages(const swift::misc::CPropertyIndex &propertyIndex, Qt::SortOrder order=Qt::AscendingOrder)
Sort of overlay messages.
void showOverlayMessagesOrSingleMessage(const swift::misc::CStatusMessageList &messages, bool appendOldMessages=false, std::chrono::milliseconds timeout=std::chrono::milliseconds(0))
Show multiple messages or a single message.
COverlayMessages(int w, int h, QWidget *parent)
Constructor.
void showProgressBar(int percentage, const QString &message, std::chrono::milliseconds timeout=std::chrono::milliseconds(0))
Progress bar.
void setModeToMessage()
Single Message mode.
void setModeToHTMLMessage()
HTML message mode.
void activateTextMessages(bool activate)
Active send/receive of text messages.
void keyPressEvent(QKeyEvent *event)
bool isTextMessagesActivated() const
Are text messages.
void display(std::chrono::milliseconds timeout=std::chrono::milliseconds(0))
Show message.
void showOverlayVariant(const swift::misc::CVariant &variant, std::chrono::milliseconds timeout=std::chrono::milliseconds(0))
Display one of the supported types.
void showDownloadProgress(int progress, qint64 current, qint64 max, const QUrl &url, std::chrono::milliseconds timeout=std::chrono::milliseconds(0))
Download progress.
void setOverlayMessagesSorting(const swift::misc::CPropertyIndex &propertyIndex, Qt::SortOrder order=Qt::AscendingOrder)
Set sorting of overlay messages.
void clearOverlayMessages()
Clear the overlay messages.
~COverlayMessages()
Destructor.
void close()
Close button clicked.
void showOverlayTextMessage(const swift::misc::network::CTextMessage &textMessage, std::chrono::milliseconds timeout=std::chrono::milliseconds(0))
Info message, based on text message.
void showOverlayMessages(const swift::misc::CStatusMessageList &messages, bool appendOldMessages=false, std::chrono::milliseconds timeout=std::chrono::milliseconds(0))
Show multiple messages.
void showOverlayMessage(const swift::misc::CStatusMessage &message, std::chrono::milliseconds timeout=std::chrono::milliseconds(0))
Show single message.
void setForceSmall(bool force)
Force small (smaller layout).
void setModeToTextMessage()
Single text message mode.
void showOverlayMessagesOrHTMLMessage(const swift::misc::CStatusMessageList &messages, bool appendOldMessages=false, std::chrono::milliseconds timeout=std::chrono::milliseconds(0))
Show multiple messages or a single message (HTML).
void showOverlayInlineTextMessage(components::TextMessageTab tab)
Inline text message.
void setReducedInfo(bool reduced)
Display reduced information.
void showOverlayMessagesWithConfirmation(const swift::misc::CStatusMessageList &messages, bool appendOldMessages, const QString &confirmationMessage, std::function< void()> okLambda, QMessageBox::StandardButton defaultButton=QMessageBox::Cancel, std::chrono::milliseconds timeout=std::chrono::milliseconds(0))
Show multiple messages with confirmation bar.
void setModeToImage()
Display image.
void showHTMLMessage(const swift::misc::CStatusMessage &message, std::chrono::milliseconds timeout=std::chrono::milliseconds(0))
HTML message.
void setHeaderText(const QString &header)
Set header text.
void setConfirmationMessage(const QString &message)
Set the message and show the confirmation frame.
void setModeToMessageSmall()
Single Message mode.
void confirmationCompleted()
Confirmation completed.
void showOverlayImage(const swift::misc::CPixmap &image, std::chrono::milliseconds timeout=std::chrono::milliseconds(0))
Image.
void setModeToMessages()
Messages mode.
bool hasPendingConfirmation() const
Is awaiting a conformation.
void addShadow(QColor color=Qt::gray)
Add a shadow.
Pixmap which can be transferred via DBus.
Class template for accessing a specific value in the CSettingsCache.
Streamable status message, e.g.
Status messages, e.g. from Core -> GUI.
Wrapper around QVariant which provides transparent access to CValueObject methods of the contained ob...
Value object encapsulating information of a callsign.
Value object encapsulating information of a text message.
QFrame(QWidget *parent, Qt::WindowFlags f)
virtual bool event(QEvent *e) override
QObject * parent() const const
#define SWIFT_GUI_EXPORT
Export a class or function from the library.