LogViewer
A modern log viewer with AI-assisted analysis (Qt 6)
Loading...
Searching...
No Matches
NotificationManager.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <QString>
4#include <QObject>
5#include <vector>
6#include <functional>
7#include <chrono>
8#include <memory>
9
10namespace ui::qt {
11class NotificationWidget;
12}
13
14namespace ui::qt::utils {
15
29{
30 Q_OBJECT
31
32 public:
34 {
35 Info,
36 Warning,
37 Error,
38 Success,
40 };
41
43 {
44 None,
48 };
49
51 {
52 QString id;
53 QString title;
54 QString message;
56 int64_t timestamp;
57 int eventRow {-1};
58 bool read {false};
59 };
60
62
64 void notify(const QString& title, const QString& message,
65 NotificationType type = NotificationType::Info, int eventRow = -1);
66
68 void setNotificationsEnabled(const QString& logLevel, bool enabled);
69 bool areNotificationsEnabled(const QString& logLevel) const;
70
72 void setDisplayDuration(int milliseconds);
73 void setMaxNotifications(int count);
74 void setGroupDuplicates(bool group);
75
77 const std::vector<Notification>& notificationHistory() const { return m_history; }
78
80 void clearHistory();
81
83 int unreadCount() const;
84
86 void playSound(NotificationType type);
87
88 signals:
89 void NotificationReceived(const Notification& notification);
91
92 private slots:
94
95 private:
97
98 void AddToHistory(const Notification& notification);
100
101 std::vector<Notification> m_history;
102 std::map<QString, bool> m_enabledLevels;
105 bool m_groupDuplicates {true};
106};
107
108} // namespace ui::qt::utils
Smart notification system for v1.10.0 Phase 9.
Definition NotificationManager.hpp:29
int unreadCount() const
Get unread notification count.
Definition NotificationManager.cpp:102
NotificationManager()
Definition NotificationManager.cpp:17
const std::vector< Notification > & notificationHistory() const
Get notification history.
Definition NotificationManager.hpp:77
void setNotificationsEnabled(const QString &logLevel, bool enabled)
Enable/disable notifications for a log level.
Definition NotificationManager.cpp:64
void setMaxNotifications(int count)
Definition NotificationManager.cpp:83
NotificationType
Definition NotificationManager.hpp:34
void setDisplayDuration(int milliseconds)
Configure notification behavior.
Definition NotificationManager.cpp:77
void NotificationReceived(const Notification &notification)
NotificationAction
Definition NotificationManager.hpp:43
std::vector< Notification > m_history
Definition NotificationManager.hpp:101
void AddToHistory(const Notification &notification)
Definition NotificationManager.cpp:143
bool m_groupDuplicates
Definition NotificationManager.hpp:105
void notify(const QString &title, const QString &message, NotificationType type=NotificationType::Info, int eventRow=-1)
Show a notification.
Definition NotificationManager.cpp:27
void playSound(NotificationType type)
Play sound alert (placeholder for audio system integration)
Definition NotificationManager.cpp:108
void setGroupDuplicates(bool group)
Definition NotificationManager.cpp:89
int m_maxNotifications
Definition NotificationManager.hpp:104
std::map< QString, bool > m_enabledLevels
Definition NotificationManager.hpp:102
bool areNotificationsEnabled(const QString &logLevel) const
Definition NotificationManager.cpp:71
bool ShouldShowNotification(NotificationType type) const
Definition NotificationManager.cpp:156
void clearHistory()
Clear notification history.
Definition NotificationManager.cpp:95
int m_displayDurationMs
Definition NotificationManager.hpp:103
static NotificationManager & getInstance()
Definition NotificationManager.cpp:11
void OnNotificationTimeout()
Definition NotificationManager.cpp:138
Definition AppDataDir.hpp:14
Definition ConfigEditorDialog.cpp:19
Definition NotificationManager.hpp:51
int eventRow
Definition NotificationManager.hpp:57
bool read
Definition NotificationManager.hpp:58
int64_t timestamp
Definition NotificationManager.hpp:56
QString message
Definition NotificationManager.hpp:54
QString id
Definition NotificationManager.hpp:52
QString title
Definition NotificationManager.hpp:53
NotificationType type
Definition NotificationManager.hpp:55