history_location_manager.h 895 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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 "data/data_location.h"
  9. class LocationClickHandler : public ClickHandler {
  10. public:
  11. LocationClickHandler(const Data::LocationPoint &point)
  12. : _point(point) {
  13. setup();
  14. }
  15. static QString Url(const Data::LocationPoint &coords);
  16. void onClick(ClickContext context) const override;
  17. QString tooltip() const override {
  18. return QString();
  19. }
  20. QString url() const override {
  21. return _text;
  22. }
  23. QString dragText() const override {
  24. return _text;
  25. }
  26. QString copyToClipboardText() const override;
  27. QString copyToClipboardContextItemText() const override;
  28. private:
  29. void setup();
  30. Data::LocationPoint _point;
  31. QString _text;
  32. };