2016-09-09 18:52:46 +03:00
|
|
|
/*
|
|
|
|
This file is part of Telegram Desktop,
|
|
|
|
the official desktop version of Telegram messaging app, see https://telegram.org
|
|
|
|
|
|
|
|
Telegram Desktop is free software: you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation, either version 3 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
It is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
In addition, as a special exception, the copyright holders give permission
|
|
|
|
to link the code of portions of this program with the OpenSSL library.
|
|
|
|
|
|
|
|
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
|
2017-01-11 22:31:31 +04:00
|
|
|
Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
|
2016-09-09 18:52:46 +03:00
|
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
|
2017-03-27 16:13:02 +03:00
|
|
|
#include "mtproto/sender.h"
|
|
|
|
|
2016-09-09 18:52:46 +03:00
|
|
|
namespace Stickers {
|
|
|
|
|
2017-03-29 14:50:09 +03:00
|
|
|
constexpr auto kPanelPerRow = 5;
|
2017-03-28 15:30:38 +03:00
|
|
|
|
2017-08-02 22:57:49 +02:00
|
|
|
void ApplyArchivedResult(const MTPDmessages_stickerSetInstallResultArchive &d);
|
|
|
|
bool ApplyArchivedResultFake(); // For testing.
|
|
|
|
void InstallLocally(uint64 setId);
|
|
|
|
void UndoInstallLocally(uint64 setId);
|
|
|
|
void MarkFeaturedAsRead(uint64 setId);
|
2017-08-03 13:15:57 +02:00
|
|
|
bool IsFaved(gsl::not_null<DocumentData*> document);
|
|
|
|
void SetFaved(gsl::not_null<DocumentData*> document, bool faved);
|
2017-08-02 22:57:49 +02:00
|
|
|
|
|
|
|
void SetsReceived(const QVector<MTPStickerSet> &data, int32 hash);
|
2017-08-03 13:15:57 +02:00
|
|
|
void SpecialSetReceived(uint64 setId, const QString &setTitle, const QVector<MTPDocument> &items, int32 hash, const QVector<MTPStickerPack> &packs = QVector<MTPStickerPack>());
|
2017-08-02 22:57:49 +02:00
|
|
|
void FeaturedSetsReceived(const QVector<MTPStickerSetCovered> &data, const QVector<MTPlong> &unread, int32 hash);
|
|
|
|
void GifsReceived(const QVector<MTPDocument> &items, int32 hash);
|
2016-09-09 18:52:46 +03:00
|
|
|
|
2017-08-03 13:15:57 +02:00
|
|
|
StickerPack GetListByEmoji(gsl::not_null<EmojiPtr> emoji);
|
|
|
|
std::vector<gsl::not_null<EmojiPtr>> GetEmojiListFromSet(gsl::not_null<DocumentData*> document);
|
|
|
|
|
2016-09-10 23:54:59 +03:00
|
|
|
namespace internal {
|
|
|
|
|
2017-03-27 16:13:02 +03:00
|
|
|
class FeaturedReader : public QObject, private MTP::Sender {
|
2016-09-10 23:54:59 +03:00
|
|
|
public:
|
|
|
|
FeaturedReader(QObject *parent);
|
|
|
|
void scheduleRead(uint64 setId);
|
|
|
|
|
|
|
|
private:
|
2017-03-27 16:13:02 +03:00
|
|
|
void readSets();
|
|
|
|
|
|
|
|
object_ptr<SingleTimer> _timer;
|
2016-09-10 23:54:59 +03:00
|
|
|
OrderedSet<uint64> _setIds;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace internal
|
2016-09-09 18:52:46 +03:00
|
|
|
} // namespace Stickers
|