integration_win.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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_shlobj_h.h"
  9. #include "base/platform/win/base_windows_winrt.h"
  10. #include "platform/platform_integration.h"
  11. #include <QAbstractNativeEventFilter>
  12. namespace Platform {
  13. class WindowsIntegration final
  14. : public Integration
  15. , public QAbstractNativeEventFilter {
  16. public:
  17. void init() override;
  18. [[nodiscard]] ITaskbarList3 *taskbarList() const;
  19. [[nodiscard]] static WindowsIntegration &Instance();
  20. private:
  21. bool nativeEventFilter(
  22. const QByteArray &eventType,
  23. void *message,
  24. native_event_filter_result *result) override;
  25. bool processEvent(
  26. HWND hWnd,
  27. UINT msg,
  28. WPARAM wParam,
  29. LPARAM lParam,
  30. LRESULT *result);
  31. void createCustomJumpList();
  32. void refreshCustomJumpList();
  33. uint32 _taskbarCreatedMsgId = 0;
  34. winrt::com_ptr<ITaskbarList3> _taskbarList;
  35. winrt::com_ptr<ICustomDestinationList> _jumpList;
  36. };
  37. [[nodiscard]] std::unique_ptr<Integration> CreateIntegration();
  38. } // namespace Platform