/* This file is part of Telegram Desktop, the official desktop application for the Telegram messaging service. For license and copyright information please follow this link: https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL */ #pragma once #include "boxes/abstract_box.h" namespace Main { class Session; } // namespace Main namespace Ui { class Checkbox; class FlatLabel; class LinkButton; } // namespace Ui class DeleteMessagesBox final : public Ui::BoxContent { public: DeleteMessagesBox( QWidget*, not_null item, bool suggestModerateActions); DeleteMessagesBox( QWidget*, not_null session, MessageIdsList &&selected); DeleteMessagesBox( QWidget*, not_null peer, QDate firstDayToDelete, QDate lastDayToDelete); DeleteMessagesBox(QWidget*, not_null peer, bool justClear); void setDeleteConfirmedCallback(Fn callback) { _deleteConfirmedCallback = std::move(callback); } protected: void prepare() override; void resizeEvent(QResizeEvent *e) override; void keyPressEvent(QKeyEvent *e) override; private: struct RevokeConfig { QString checkbox; TextWithEntities description; }; void deleteAndClear(); [[nodiscard]] PeerData *checkFromSinglePeer() const; [[nodiscard]] bool hasScheduledMessages() const; [[nodiscard]] std::optional revokeText( not_null peer) const; const not_null _session; PeerData * const _wipeHistoryPeer = nullptr; const bool _wipeHistoryJustClear = false; const QDate _wipeHistoryFirstToDelete; const QDate _wipeHistoryLastToDelete; const MessageIdsList _ids; PeerData *_moderateFrom = nullptr; ChannelData *_moderateInChannel = nullptr; bool _moderateBan = false; bool _moderateDeleteAll = false; object_ptr _text = { nullptr }; object_ptr _revoke = { nullptr }; object_ptr _banUser = { nullptr }; object_ptr _reportSpam = { nullptr }; object_ptr _deleteAll = { nullptr }; object_ptr _autoDeleteSettings = { nullptr }; Fn _deleteConfirmedCallback; };