tdesktop/Telegram/SourceFiles/window/window_peer_menu.h

170 lines
5.0 KiB
C
Raw Normal View History

2017-11-06 18:03:20 +00:00
/*
This file is part of Telegram Desktop,
the official desktop application for the Telegram messaging service.
2017-11-06 18:03:20 +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
#include "api/api_common.h"
2022-03-27 10:01:34 +00:00
#include "menu/menu_send.h"
#include "data/data_poll.h"
#include "ui/widgets/menu/menu_add_action_callback.h"
class History;
2019-06-12 13:26:04 +00:00
namespace Ui {
class RpWidget;
class BoxContent;
2019-09-18 11:19:05 +00:00
class GenericBox;
} // namespace Ui
namespace Data {
2022-11-01 04:46:31 +00:00
class Forum;
2019-04-15 11:54:03 +00:00
class Folder;
class Session;
struct ForwardDraft;
2022-10-19 10:59:37 +00:00
class ForumTopic;
2022-10-28 05:19:27 +00:00
class Thread;
} // namespace Data
namespace Dialogs {
class MainList;
struct EntryState;
} // namespace Dialogs
2017-11-06 18:03:20 +00:00
namespace Window {
2019-06-12 13:26:04 +00:00
class Controller;
class SessionController;
2019-07-25 18:55:11 +00:00
class SessionNavigation;
2017-11-07 11:53:05 +00:00
extern const char kOptionViewProfileInChatsListContextMenu[];
using PeerMenuCallback = Ui::Menu::MenuCallback;
2017-11-06 18:03:20 +00:00
void FillDialogsEntryMenu(
not_null<SessionController*> controller,
Dialogs::EntryState request,
const PeerMenuCallback &addAction);
bool FillVideoChatMenu(
not_null<SessionController*> controller,
Dialogs::EntryState request,
2020-11-11 20:47:40 +00:00
const PeerMenuCallback &addAction);
2017-11-06 18:03:20 +00:00
void MenuAddMarkAsReadAllChatsAction(
not_null<Window::SessionController*> controller,
const PeerMenuCallback &addAction);
void MenuAddMarkAsReadChatListAction(
not_null<Window::SessionController*> controller,
Fn<not_null<Dialogs::MainList*>()> &&list,
const PeerMenuCallback &addAction);
2018-07-23 13:11:56 +00:00
void PeerMenuExportChat(not_null<PeerData*> peer);
void PeerMenuDeleteContact(
not_null<Window::SessionController*> controller,
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);
void PeerMenuCreatePoll(
2020-06-10 18:08:17 +00:00
not_null<Window::SessionController*> controller,
not_null<PeerData*> peer,
2020-11-11 20:47:40 +00:00
MsgId replyToId = 0,
MsgId topicRootId = 0,
PollData::Flags chosen = PollData::Flags(),
PollData::Flags disabled = PollData::Flags(),
Api::SendType sendType = Api::SendType::Normal,
SendMenu::Type sendMenuType = SendMenu::Type::Scheduled);
2022-10-19 10:59:37 +00:00
void PeerMenuDeleteTopicWithConfirmation(
not_null<Window::SessionNavigation*> navigation,
not_null<Data::ForumTopic*> topic);
void PeerMenuDeleteTopic(
not_null<Window::SessionNavigation*> navigation,
not_null<Data::ForumTopic*> topic);
struct ClearChat {
};
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,
not_null<PeerData*> peer,
std::variant<v::null_t, bool> suggestReport,
std::variant<v::null_t, ClearChat, ClearReply> suggestClear);
void PeerMenuUnblockUserWithBotRestart(not_null<UserData*> user);
void BlockSenderFromRepliesBox(
not_null<Ui::GenericBox*> box,
not_null<Window::SessionController*> controller,
FullMsgId id);
void ToggleHistoryArchived(not_null<History*> history, bool archived);
Fn<void()> ClearHistoryHandler(
not_null<Window::SessionController*> controller,
not_null<PeerData*> peer);
Fn<void()> DeleteAndLeaveHandler(
not_null<Window::SessionController*> controller,
not_null<PeerData*> peer);
QPointer<Ui::BoxContent> ShowChooseRecipientBox(
not_null<Window::SessionNavigation*> navigation,
FnMut<bool(not_null<Data::Thread*>)> &&chosen,
rpl::producer<QString> titleOverride = nullptr,
FnMut<void()> &&successCallback = nullptr);
QPointer<Ui::BoxContent> ShowForwardMessagesBox(
not_null<Window::SessionNavigation*> navigation,
Data::ForwardDraft &&draft,
Fn<void()> &&successCallback = nullptr);
QPointer<Ui::BoxContent> ShowForwardMessagesBox(
2019-07-25 18:55:11 +00:00
not_null<Window::SessionNavigation*> navigation,
MessageIdsList &&items,
Fn<void()> &&successCallback = nullptr);
QPointer<Ui::BoxContent> ShowShareUrlBox(
not_null<Window::SessionNavigation*> navigation,
const QString &url,
const QString &text,
FnMut<void()> &&successCallback = nullptr);
QPointer<Ui::BoxContent> ShowShareGameBox(
not_null<Window::SessionNavigation*> navigation,
not_null<UserData*> bot,
QString shortName);
2022-11-01 07:18:56 +00:00
QPointer<Ui::BoxContent> ShowDropMediaBox(
2022-11-01 04:46:31 +00:00
not_null<Window::SessionNavigation*> navigation,
2022-11-01 07:18:56 +00:00
std::shared_ptr<QMimeData> data,
2022-11-01 04:46:31 +00:00
not_null<Data::Forum*> forum,
FnMut<void()> &&successCallback = nullptr);
QPointer<Ui::BoxContent> ShowSendNowMessagesBox(
not_null<Window::SessionNavigation*> navigation,
not_null<History*> history,
MessageIdsList &&items,
Fn<void()> &&successCallback = nullptr);
void ToggleMessagePinned(
not_null<Window::SessionNavigation*> navigation,
FullMsgId itemId,
bool pin);
void HidePinnedBar(
not_null<Window::SessionNavigation*> navigation,
not_null<PeerData*> peer,
2022-10-28 05:19:27 +00:00
MsgId topicRootId,
Fn<void()> onHidden);
void UnpinAllMessages(
not_null<Window::SessionNavigation*> navigation,
2022-10-28 05:19:27 +00:00
not_null<Data::Thread*> thread);
[[nodiscard]] bool IsUnreadThread(not_null<Data::Thread*> thread);
void MarkAsReadThread(not_null<Data::Thread*> thread);
void AddSeparatorAndShiftUp(const PeerMenuCallback &addAction);
2017-11-06 18:03:20 +00:00
} // namespace Window