CCIMXDesktop
 
Loading...
Searching...
No Matches
ToastReceiver.h
Go to the documentation of this file.
1
6#ifndef TOASTRECEIVER_H
7#define TOASTRECEIVER_H
8
9#include "ToastMetaProtocol.h" // Includes the data structure for toast messages
10#include <QObject> // Base class for ToastReceiver, enabling signals/slots
11#include <optional> // For std::optional in fromExternalJsonString
12
13// Forward declaration to avoid heavy includes
14class FileMonitor;
15
26class ToastReceiver : public QObject {
27 Q_OBJECT
28
29public:
35 explicit ToastReceiver(FileMonitor* parent = nullptr);
36
46 std::optional<ToastMetaProtocol> fromExternalJsonString(const QString& json_file) const;
47
48signals:
55 void postToast(const ToastMetaProtocol& protocolMeta);
56
57private slots:
66 void process_newToast(const QStringList& toasts_metas);
67
68private:
74 FileMonitor* monitor;
75};
76
77#endif // TOASTRECEIVER_H
Defines the ToastMetaProtocol struct, used for encapsulating data for toast notifications.
Monitors a specified directory for file additions or deletions at regular intervals.
Definition FileMonitor.h:28
Receives toast notification data, often from external sources, and emits it for processing.
Definition ToastReceiver.h:26
void postToast(const ToastMetaProtocol &protocolMeta)
Signal emitted when a new toast notification is ready to be posted.
std::optional< ToastMetaProtocol > fromExternalJsonString(const QString &json_file) const
Parses a JSON string from an external source into a ToastMetaProtocol object.
Definition ToastReceiver.cpp:13
Represents the metadata and content for a toast notification.
Definition ToastMetaProtocol.h:22