pushNotification.h 731 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. #pragma once
  2. #include <string>
  3. #include <chrono>
  4. #include <deque>
  5. namespace pika
  6. {
  7. enum: int
  8. {
  9. logNormal = 0,
  10. logWarning,
  11. logError
  12. };
  13. struct Notification
  14. {
  15. std::string content = "";
  16. std::chrono::steady_clock::time_point startTime = {};
  17. int notificationType = pika::logNormal;
  18. Notification(std::string content, std::chrono::steady_clock::time_point startTime, int notificationType):
  19. content(content), startTime(startTime), notificationType(notificationType)
  20. {
  21. };
  22. Notification() {};
  23. };
  24. struct PushNotificationManager
  25. {
  26. void init();
  27. void update(bool &open);
  28. void pushNotification(const char *content, int logType = pika::logNormal);
  29. std::deque<Notification> notificationQue;
  30. };
  31. };