2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-23 18:57:12 +00:00
tdesktop/Telegram/SourceFiles/window/window_peer_menu.h

92 lines
2.4 KiB
C
Raw Normal View History

2017-11-06 22:03:20 +04:00
/*
This file is part of Telegram Desktop,
the official desktop application for the Telegram messaging service.
2017-11-06 22:03:20 +04:00
For license and copyright information please follow this link:
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
2017-11-06 22:03:20 +04:00
*/
#pragma once
#include "data/data_poll.h"
class History;
2019-06-12 15:26:04 +02:00
namespace Ui {
class RpWidget;
2019-09-18 14:19:05 +03:00
class GenericBox;
} // namespace Ui
namespace Data {
2019-04-15 15:54:03 +04:00
class Folder;
} // namespace Data
2017-11-06 22:03:20 +04:00
namespace Window {
2019-06-12 15:26:04 +02:00
class Controller;
class SessionController;
2019-07-25 20:55:11 +02:00
class SessionNavigation;
2017-11-07 15:53:05 +04:00
enum class PeerMenuSource {
ChatsList,
History,
Profile,
2017-11-06 22:03:20 +04:00
};
using PeerMenuCallback = Fn<QAction*(
2017-11-06 22:03:20 +04:00
const QString &text,
Fn<void()> handler)>;
2017-11-06 22:03:20 +04:00
void FillPeerMenu(
not_null<SessionController*> controller,
2017-11-06 22:03:20 +04:00
not_null<PeerData*> peer,
2020-03-17 17:04:30 +04:00
FilterId filterId,
const PeerMenuCallback &addAction,
PeerMenuSource source);
2019-04-15 15:54:03 +04:00
void FillFolderMenu(
not_null<SessionController*> controller,
2019-04-15 15:54:03 +04:00
not_null<Data::Folder*> folder,
const PeerMenuCallback &addAction,
PeerMenuSource source);
2017-11-06 22:03:20 +04:00
void PeerMenuAddMuteAction(
not_null<PeerData*> peer,
const PeerMenuCallback &addAction);
2018-07-23 16:11:56 +03:00
void PeerMenuExportChat(not_null<PeerData*> peer);
void PeerMenuDeleteContact(not_null<UserData*> user);
2019-07-25 20:55:11 +02:00
void PeerMenuShareContactBox(
not_null<Window::SessionNavigation*> navigation,
not_null<UserData*> user);
void PeerMenuAddChannelMembers(
not_null<Window::SessionNavigation*> navigation,
not_null<ChannelData*> channel);
2018-03-06 20:07:42 +03:00
//void PeerMenuUngroupFeed(not_null<Data::Feed*> feed); // #feed
void PeerMenuCreatePoll(
2020-06-10 22:08:17 +04:00
not_null<Window::SessionController*> controller,
not_null<PeerData*> peer,
PollData::Flags chosen = PollData::Flags(),
PollData::Flags disabled = PollData::Flags());
2019-06-12 15:26:04 +02:00
void PeerMenuBlockUserBox(
2019-09-18 14:19:05 +03:00
not_null<Ui::GenericBox*> box,
2019-06-12 16:13:49 +02:00
not_null<Window::Controller*> window,
not_null<UserData*> user,
bool suggestClearChat);
void PeerMenuUnblockUserWithBotRestart(not_null<UserData*> user);
void ToggleHistoryArchived(not_null<History*> history, bool archived);
Fn<void()> ClearHistoryHandler(not_null<PeerData*> peer);
Fn<void()> DeleteAndLeaveHandler(not_null<PeerData*> peer);
QPointer<Ui::RpWidget> ShowForwardMessagesBox(
2019-07-25 20:55:11 +02:00
not_null<Window::SessionNavigation*> navigation,
MessageIdsList &&items,
FnMut<void()> &&successCallback = nullptr);
QPointer<Ui::RpWidget> ShowSendNowMessagesBox(
not_null<Window::SessionNavigation*> navigation,
not_null<History*> history,
MessageIdsList &&items,
FnMut<void()> &&successCallback = nullptr);
2017-11-06 22:03:20 +04:00
} // namespace Window