2016-09-27 13:37:18 +00:00
|
|
|
/*
|
|
|
|
This file is part of Telegram Desktop,
|
2018-01-03 10:23:14 +00:00
|
|
|
the official desktop application for the Telegram messaging service.
|
2016-09-27 13:37:18 +00:00
|
|
|
|
2018-01-03 10:23:14 +00:00
|
|
|
For license and copyright information please follow this link:
|
|
|
|
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
2016-09-27 13:37:18 +00:00
|
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
|
2019-06-21 12:27:46 +00:00
|
|
|
#include "data/data_location.h"
|
2016-09-27 13:37:18 +00:00
|
|
|
|
|
|
|
class LocationClickHandler : public ClickHandler {
|
|
|
|
public:
|
2019-06-21 12:27:46 +00:00
|
|
|
LocationClickHandler(const Data::LocationPoint &point)
|
|
|
|
: _point(point) {
|
2016-09-27 13:37:18 +00:00
|
|
|
setup();
|
|
|
|
}
|
|
|
|
|
2019-06-21 12:27:46 +00:00
|
|
|
static QString Url(const Data::LocationPoint &coords);
|
2019-06-14 16:04:45 +00:00
|
|
|
|
2018-07-09 18:13:48 +00:00
|
|
|
void onClick(ClickContext context) const override;
|
2016-09-27 13:37:18 +00:00
|
|
|
|
|
|
|
QString tooltip() const override {
|
|
|
|
return QString();
|
|
|
|
}
|
|
|
|
|
2023-01-12 07:24:25 +00:00
|
|
|
QString url() const override {
|
|
|
|
return _text;
|
|
|
|
}
|
|
|
|
|
2016-09-27 13:37:18 +00:00
|
|
|
QString dragText() const override {
|
|
|
|
return _text;
|
|
|
|
}
|
|
|
|
|
2018-01-25 10:10:52 +00:00
|
|
|
QString copyToClipboardText() const override;
|
2016-09-27 13:37:18 +00:00
|
|
|
QString copyToClipboardContextItemText() const override;
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
|
|
|
void setup();
|
2019-06-21 12:27:46 +00:00
|
|
|
Data::LocationPoint _point;
|
2016-09-27 13:37:18 +00:00
|
|
|
QString _text;
|
|
|
|
|
|
|
|
};
|