2018-01-25 10:10:52 +00:00
|
|
|
/*
|
|
|
|
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 "base/unique_qptr.h"
|
|
|
|
|
2021-08-31 11:50:49 +00:00
|
|
|
namespace Main {
|
|
|
|
class Session;
|
|
|
|
} // namespace Main
|
|
|
|
|
2018-01-25 10:10:52 +00:00
|
|
|
namespace Ui {
|
|
|
|
class PopupMenu;
|
2021-02-15 17:37:22 +00:00
|
|
|
enum class ReportReason;
|
2018-01-25 10:10:52 +00:00
|
|
|
} // namespace Ui
|
|
|
|
|
2019-07-25 18:55:11 +00:00
|
|
|
namespace Window {
|
|
|
|
class SessionNavigation;
|
2021-02-15 17:37:22 +00:00
|
|
|
class SessionController;
|
2019-07-24 14:00:30 +00:00
|
|
|
} // namespace Main
|
|
|
|
|
2018-01-25 10:10:52 +00:00
|
|
|
namespace HistoryView {
|
|
|
|
|
2020-09-22 15:28:49 +00:00
|
|
|
enum class Context : char;
|
2018-01-28 15:08:34 +00:00
|
|
|
enum class PointState : char;
|
2018-01-25 10:10:52 +00:00
|
|
|
class ListWidget;
|
|
|
|
class Element;
|
2018-01-28 15:08:34 +00:00
|
|
|
struct SelectedItem;
|
|
|
|
using SelectedItems = std::vector<SelectedItem>;
|
2018-01-25 10:10:52 +00:00
|
|
|
|
|
|
|
struct ContextMenuRequest {
|
2019-07-25 18:55:11 +00:00
|
|
|
explicit ContextMenuRequest(
|
|
|
|
not_null<Window::SessionNavigation*> navigation);
|
2019-07-24 14:00:30 +00:00
|
|
|
|
2019-07-25 18:55:11 +00:00
|
|
|
const not_null<Window::SessionNavigation*> navigation;
|
2018-01-25 10:10:52 +00:00
|
|
|
ClickHandlerPtr link;
|
|
|
|
Element *view = nullptr;
|
2018-01-28 15:08:34 +00:00
|
|
|
HistoryItem *item = nullptr;
|
|
|
|
SelectedItems selectedItems;
|
2019-04-08 15:10:06 +00:00
|
|
|
TextForMimeData selectedText;
|
2018-01-25 10:10:52 +00:00
|
|
|
bool overSelection = false;
|
2018-01-28 15:08:34 +00:00
|
|
|
PointState pointState = PointState();
|
2018-01-25 10:10:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
base::unique_qptr<Ui::PopupMenu> FillContextMenu(
|
|
|
|
not_null<ListWidget*> list,
|
|
|
|
const ContextMenuRequest &request);
|
|
|
|
|
2020-09-22 15:28:49 +00:00
|
|
|
void CopyPostLink(
|
|
|
|
not_null<Main::Session*> session,
|
|
|
|
FullMsgId itemId,
|
|
|
|
Context context);
|
2020-06-09 09:36:40 +00:00
|
|
|
void StopPoll(not_null<Main::Session*> session, FullMsgId itemId);
|
2021-01-02 14:36:14 +00:00
|
|
|
void AddPollActions(
|
|
|
|
not_null<Ui::PopupMenu*> menu,
|
|
|
|
not_null<PollData*> poll,
|
|
|
|
not_null<HistoryItem*> item,
|
|
|
|
Context context);
|
2018-12-19 11:20:04 +00:00
|
|
|
|
2021-02-15 17:37:22 +00:00
|
|
|
void ShowReportItemsBox(not_null<PeerData*> peer, MessageIdsList ids);
|
|
|
|
void ShowReportPeerBox(
|
|
|
|
not_null<Window::SessionController*> window,
|
|
|
|
not_null<PeerData*> peer);
|
|
|
|
void SendReport(
|
|
|
|
not_null<PeerData*> peer,
|
|
|
|
Ui::ReportReason reason,
|
|
|
|
const QString &comment,
|
|
|
|
MessageIdsList ids = {});
|
|
|
|
|
|
|
|
} // namespace HistoryView
|