2017-11-06 18:03:20 +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.
|
2017-11-06 18:03:20 +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
|
2017-11-06 18:03:20 +00:00
|
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
|
2020-08-03 09:02:41 +00:00
|
|
|
#include "api/api_common.h"
|
2020-11-20 17:04:50 +00:00
|
|
|
#include "chat_helpers/send_context_menu.h"
|
2020-01-15 13:30:29 +00:00
|
|
|
#include "data/data_poll.h"
|
|
|
|
|
2019-09-13 06:06:02 +00:00
|
|
|
class History;
|
2019-06-12 13:26:04 +00:00
|
|
|
|
2017-12-09 15:13:06 +00:00
|
|
|
namespace Ui {
|
|
|
|
class RpWidget;
|
2019-09-18 11:19:05 +00:00
|
|
|
class GenericBox;
|
2017-12-09 15:13:06 +00:00
|
|
|
} // namespace Ui
|
|
|
|
|
2018-01-05 15:57:18 +00:00
|
|
|
namespace Data {
|
2019-04-15 11:54:03 +00:00
|
|
|
class Folder;
|
2020-09-16 14:09:04 +00:00
|
|
|
class Session;
|
2021-08-31 16:47:38 +00:00
|
|
|
struct ForwardDraft;
|
2018-01-05 15:57:18 +00:00
|
|
|
} // namespace Data
|
|
|
|
|
2020-09-16 14:09:04 +00:00
|
|
|
namespace Dialogs {
|
|
|
|
class MainList;
|
2020-11-12 15:46:17 +00:00
|
|
|
struct EntryState;
|
2020-09-16 14:09:04 +00:00
|
|
|
} // namespace Dialogs
|
|
|
|
|
2017-11-06 18:03:20 +00:00
|
|
|
namespace Window {
|
|
|
|
|
2019-06-12 13:26:04 +00:00
|
|
|
class Controller;
|
2019-06-06 10:21:40 +00:00
|
|
|
class SessionController;
|
2019-07-25 18:55:11 +00:00
|
|
|
class SessionNavigation;
|
2017-11-07 11:53:05 +00:00
|
|
|
|
2018-06-04 15:35:11 +00:00
|
|
|
using PeerMenuCallback = Fn<QAction*(
|
2017-11-06 18:03:20 +00:00
|
|
|
const QString &text,
|
2018-06-04 15:35:11 +00:00
|
|
|
Fn<void()> handler)>;
|
2017-11-06 18:03:20 +00:00
|
|
|
|
2020-11-12 15:46:17 +00:00
|
|
|
void FillDialogsEntryMenu(
|
2019-06-06 10:21:40 +00:00
|
|
|
not_null<SessionController*> controller,
|
2020-11-12 15:46:17 +00:00
|
|
|
Dialogs::EntryState request,
|
2020-11-11 20:47:40 +00:00
|
|
|
const PeerMenuCallback &addAction);
|
2017-11-06 18:03:20 +00:00
|
|
|
|
2018-02-12 11:10:40 +00:00
|
|
|
void PeerMenuAddMuteAction(
|
|
|
|
not_null<PeerData*> peer,
|
|
|
|
const PeerMenuCallback &addAction);
|
|
|
|
|
2020-09-17 14:56:01 +00:00
|
|
|
void MenuAddMarkAsReadAllChatsAction(
|
2020-09-16 14:09:04 +00:00
|
|
|
not_null<Data::Session*> data,
|
2020-09-17 14:56:01 +00:00
|
|
|
const PeerMenuCallback &addAction);
|
|
|
|
|
|
|
|
void MenuAddMarkAsReadChatListAction(
|
|
|
|
Fn<not_null<Dialogs::MainList*>()> &&list,
|
2020-09-16 14:09:04 +00:00
|
|
|
const PeerMenuCallback &addAction);
|
|
|
|
|
2018-07-23 13:11:56 +00:00
|
|
|
void PeerMenuExportChat(not_null<PeerData*> peer);
|
2017-11-07 13:13:41 +00:00
|
|
|
void PeerMenuDeleteContact(not_null<UserData*> user);
|
2019-07-25 18:55:11 +00:00
|
|
|
void PeerMenuShareContactBox(
|
|
|
|
not_null<Window::SessionNavigation*> navigation,
|
|
|
|
not_null<UserData*> user);
|
|
|
|
void PeerMenuAddChannelMembers(
|
|
|
|
not_null<Window::SessionNavigation*> navigation,
|
|
|
|
not_null<ChannelData*> channel);
|
2020-01-15 13:30:29 +00:00
|
|
|
void PeerMenuCreatePoll(
|
2020-06-10 18:08:17 +00:00
|
|
|
not_null<Window::SessionController*> controller,
|
2020-01-15 13:30:29 +00:00
|
|
|
not_null<PeerData*> peer,
|
2020-11-11 20:47:40 +00:00
|
|
|
MsgId replyToId = 0,
|
2020-01-15 13:30:29 +00:00
|
|
|
PollData::Flags chosen = PollData::Flags(),
|
2020-08-03 09:02:41 +00:00
|
|
|
PollData::Flags disabled = PollData::Flags(),
|
2020-11-20 17:04:50 +00:00
|
|
|
Api::SendType sendType = Api::SendType::Normal,
|
|
|
|
SendMenu::Type sendMenuType = SendMenu::Type::Scheduled);
|
2020-09-17 13:26:53 +00:00
|
|
|
|
|
|
|
struct ClearChat {
|
|
|
|
};
|
2020-09-25 12:31:36 +00:00
|
|
|
struct ClearReply {
|
|
|
|
FullMsgId replyId;
|
|
|
|
};
|
2019-06-12 13:26:04 +00:00
|
|
|
void PeerMenuBlockUserBox(
|
2019-09-18 11:19:05 +00:00
|
|
|
not_null<Ui::GenericBox*> box,
|
2019-06-12 14:13:49 +00:00
|
|
|
not_null<Window::Controller*> window,
|
2020-09-17 13:26:53 +00:00
|
|
|
not_null<PeerData*> peer,
|
|
|
|
std::variant<v::null_t, bool> suggestReport,
|
2020-09-25 12:31:36 +00:00
|
|
|
std::variant<v::null_t, ClearChat, ClearReply> suggestClear);
|
2019-07-04 14:02:22 +00:00
|
|
|
void PeerMenuUnblockUserWithBotRestart(not_null<UserData*> user);
|
2017-11-07 13:13:41 +00:00
|
|
|
|
2021-02-15 17:37:22 +00:00
|
|
|
void BlockSenderFromRepliesBox(
|
|
|
|
not_null<Ui::GenericBox*> box,
|
|
|
|
not_null<Window::SessionController*> controller,
|
|
|
|
FullMsgId id);
|
|
|
|
|
2019-04-18 08:28:43 +00:00
|
|
|
void ToggleHistoryArchived(not_null<History*> history, bool archived);
|
2018-06-04 15:35:11 +00:00
|
|
|
Fn<void()> ClearHistoryHandler(not_null<PeerData*> peer);
|
|
|
|
Fn<void()> DeleteAndLeaveHandler(not_null<PeerData*> peer);
|
2017-12-06 14:39:27 +00:00
|
|
|
|
2021-08-31 16:47:38 +00:00
|
|
|
QPointer<Ui::RpWidget> ShowForwardMessagesBox(
|
|
|
|
not_null<Window::SessionNavigation*> navigation,
|
|
|
|
Data::ForwardDraft &&draft,
|
|
|
|
FnMut<void()> &&successCallback = nullptr);
|
2017-12-09 15:13:06 +00:00
|
|
|
QPointer<Ui::RpWidget> ShowForwardMessagesBox(
|
2019-07-25 18:55:11 +00:00
|
|
|
not_null<Window::SessionNavigation*> navigation,
|
2017-12-06 10:13:38 +00:00
|
|
|
MessageIdsList &&items,
|
2018-06-04 15:35:11 +00:00
|
|
|
FnMut<void()> &&successCallback = nullptr);
|
2017-12-06 10:13:38 +00:00
|
|
|
|
2019-08-09 17:58:58 +00:00
|
|
|
QPointer<Ui::RpWidget> ShowSendNowMessagesBox(
|
|
|
|
not_null<Window::SessionNavigation*> navigation,
|
|
|
|
not_null<History*> history,
|
|
|
|
MessageIdsList &&items,
|
|
|
|
FnMut<void()> &&successCallback = nullptr);
|
|
|
|
|
2020-10-21 14:41:13 +00:00
|
|
|
void ToggleMessagePinned(
|
|
|
|
not_null<Window::SessionNavigation*> navigation,
|
|
|
|
FullMsgId itemId,
|
|
|
|
bool pin);
|
2020-10-22 07:53:56 +00:00
|
|
|
void HidePinnedBar(
|
|
|
|
not_null<Window::SessionNavigation*> navigation,
|
|
|
|
not_null<PeerData*> peer,
|
|
|
|
Fn<void()> onHidden);
|
|
|
|
void UnpinAllMessages(
|
|
|
|
not_null<Window::SessionNavigation*> navigation,
|
|
|
|
not_null<History*> history);
|
2020-10-21 14:41:13 +00:00
|
|
|
|
2017-11-06 18:03:20 +00:00
|
|
|
} // namespace Window
|