2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 06:26:18 +00:00

forward-by-drag-n-drop done for images, documents, stickers and messages-by-date

This commit is contained in:
John Preston
2015-06-27 16:02:00 +03:00
parent d81d6bbeaa
commit 8e82b8894d
24 changed files with 339 additions and 172 deletions

View File

@@ -106,6 +106,8 @@ struct PeerData {
static const uint64 UserNoAccess = 0xFFFFFFFFFFFFFFFFULL;
class PeerLink : public ITextLink {
TEXT_LINK_CLASS(PeerLink)
public:
PeerLink(PeerData *peer) : _peer(peer) {
}
@@ -234,6 +236,8 @@ struct PhotoData {
};
class PhotoLink : public ITextLink {
TEXT_LINK_CLASS(PhotoLink)
public:
PhotoLink(PhotoData *photo) : _photo(photo), _peer(0) {
}
@@ -313,6 +317,8 @@ struct VideoData {
};
class VideoLink : public ITextLink {
TEXT_LINK_CLASS(VideoLink)
public:
VideoLink(VideoData *video) : _video(video) {
}
@@ -325,6 +331,8 @@ private:
};
class VideoSaveLink : public VideoLink {
TEXT_LINK_CLASS(VideoSaveLink)
public:
VideoSaveLink(VideoData *video) : VideoLink(video) {
}
@@ -333,6 +341,8 @@ public:
};
class VideoOpenLink : public VideoLink {
TEXT_LINK_CLASS(VideoOpenLink)
public:
VideoOpenLink(VideoData *video) : VideoLink(video) {
}
@@ -340,6 +350,8 @@ public:
};
class VideoCancelLink : public VideoLink {
TEXT_LINK_CLASS(VideoCancelLink)
public:
VideoCancelLink(VideoData *video) : VideoLink(video) {
}
@@ -400,6 +412,8 @@ struct AudioData {
};
class AudioLink : public ITextLink {
TEXT_LINK_CLASS(AudioLink)
public:
AudioLink(AudioData *audio) : _audio(audio) {
}
@@ -412,6 +426,8 @@ private:
};
class AudioSaveLink : public AudioLink {
TEXT_LINK_CLASS(AudioSaveLink)
public:
AudioSaveLink(AudioData *audio) : AudioLink(audio) {
}
@@ -420,6 +436,8 @@ public:
};
class AudioOpenLink : public AudioLink {
TEXT_LINK_CLASS(AudioOpenLink)
public:
AudioOpenLink(AudioData *audio) : AudioLink(audio) {
}
@@ -427,6 +445,8 @@ public:
};
class AudioCancelLink : public AudioLink {
TEXT_LINK_CLASS(AudioCancelLink)
public:
AudioCancelLink(AudioData *audio) : AudioLink(audio) {
}
@@ -518,6 +538,8 @@ struct DocumentData {
};
class DocumentLink : public ITextLink {
TEXT_LINK_CLASS(DocumentLink)
public:
DocumentLink(DocumentData *document) : _document(document) {
}
@@ -530,6 +552,8 @@ private:
};
class DocumentSaveLink : public DocumentLink {
TEXT_LINK_CLASS(DocumentSaveLink)
public:
DocumentSaveLink(DocumentData *document) : DocumentLink(document) {
}
@@ -538,6 +562,8 @@ public:
};
class DocumentOpenLink : public DocumentLink {
TEXT_LINK_CLASS(DocumentOpenLink)
public:
DocumentOpenLink(DocumentData *document) : DocumentLink(document) {
}
@@ -545,6 +571,8 @@ public:
};
class DocumentCancelLink : public DocumentLink {
TEXT_LINK_CLASS(DocumentCancelLink)
public:
DocumentCancelLink(DocumentData *document) : DocumentLink(document) {
}
@@ -558,9 +586,9 @@ enum WebPageType {
WebPageArticle
};
inline WebPageType toWebPageType(const QString &type) {
if (type == QLatin1String("photo")) return WebPagePhoto;
if (type == QLatin1String("video")) return WebPageVideo;
if (type == QLatin1String("profile")) return WebPageProfile;
if (type == qstr("photo")) return WebPagePhoto;
if (type == qstr("video")) return WebPageVideo;
if (type == qstr("profile")) return WebPageProfile;
return WebPageArticle;
}