8aaa4eeec0
Changes: - Implements #2061 - Introduce EventManager for user-specific Windows event publishing/listening - Add real-time notification and account-disabled event propagation - Register authentication events through Controller and AuthenticationManagementService - Trigger notification events from Inventory, Payment, and Service Management modules - Trigger account-disabled events when users are deactivated - Extract common menu event listener logic into Menu base class - Add notification popup handling for Admin, Customer, and Technician menus - Refactor shared memory components into core/sharedmemory - Update project structure and include paths for events and shared memory modules
37 lines
1.0 KiB
C++
37 lines
1.0 KiB
C++
/*
|
|
File: EventManager.h
|
|
Description: Header file declaring the EventManager class, which manages
|
|
user-specific interprocess events for user disable and
|
|
notification availability updates.
|
|
Author: Trenser
|
|
Date:15-Jun-2026
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <windows.h>
|
|
#include <atomic>
|
|
#include <functional>
|
|
#include <string>
|
|
#include <thread>
|
|
|
|
class EventManager
|
|
{
|
|
private:
|
|
HANDLE m_userDisabledEvent;
|
|
HANDLE m_notificationAvailableEvent;
|
|
HANDLE m_shutdownEvent;
|
|
std::atomic<bool> m_running;
|
|
std::thread m_listenerThread;
|
|
std::function<void()> m_userDisabledCallback;
|
|
std::function<void()> m_notificationCallback;
|
|
void run();
|
|
|
|
public:
|
|
EventManager();
|
|
~EventManager();
|
|
bool initialize(const std::string& userId, std::function<void()> userDisabledCallback, std::function<void()> notificationCallback);
|
|
void shutdown();
|
|
static void sendUserDisabledEvent(const std::string& userId);
|
|
static void sendNotificationAvailableEvent(const std::string& userId);
|
|
}; |