windows_toast_activator.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /*
  2. This file is part of Telegram Desktop,
  3. the official desktop application for the Telegram messaging service.
  4. For license and copyright information please follow this link:
  5. https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
  6. */
  7. #pragma once
  8. #include "base/platform/win/base_windows_rpcndr_h.h"
  9. #include "windows_toastactivator_h.h"
  10. #include "base/platform/win/wrl/wrl_implements_h.h"
  11. // {F11932D3-6110-4BBC-9B02-B2EC07A1BD19}
  12. class DECLSPEC_UUID("F11932D3-6110-4BBC-9B02-B2EC07A1BD19") ToastActivator
  13. : public ::Microsoft::WRL::RuntimeClass<
  14. ::Microsoft::WRL::RuntimeClassFlags<::Microsoft::WRL::ClassicCom>,
  15. INotificationActivationCallback,
  16. ::Microsoft::WRL::FtmBase> {
  17. public:
  18. ToastActivator() = default;
  19. ~ToastActivator() = default;
  20. HRESULT STDMETHODCALLTYPE Activate(
  21. _In_ LPCWSTR appUserModelId,
  22. _In_ LPCWSTR invokedArgs,
  23. _In_reads_(dataCount) const NOTIFICATION_USER_INPUT_DATA *data,
  24. ULONG dataCount) override;
  25. HRESULT STDMETHODCALLTYPE QueryInterface(
  26. REFIID riid,
  27. void **ppObj);
  28. ULONG STDMETHODCALLTYPE AddRef();
  29. ULONG STDMETHODCALLTYPE Release();
  30. private:
  31. long _ref = 1;
  32. };
  33. struct ToastActivation {
  34. struct UserInput {
  35. QString key;
  36. QString value;
  37. };
  38. QString args;
  39. std::vector<UserInput> input;
  40. [[nodiscard]] static QString String(LPCWSTR value);
  41. };
  42. [[nodiscard]] rpl::producer<ToastActivation> ToastActivations();