-
Notifications
You must be signed in to change notification settings - Fork 7.3k
Expand file tree
/
Copy pathdata_document_resolver.h
More file actions
71 lines (55 loc) · 1.47 KB
/
Copy pathdata_document_resolver.h
File metadata and controls
71 lines (55 loc) · 1.47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
/*
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/binary_guard.h"
#include <gsl/util>
#include <optional>
class DocumentData;
class HistoryItem;
namespace Core {
class Settings;
enum class NameType : uchar;
} // namespace Core
namespace Window {
class SessionController;
} // namespace Window
namespace Data {
class DocumentMedia;
enum class ImageOpenSource : uchar {
None,
Location,
Bytes,
};
struct ImageOpenCheck {
QString mime;
ImageOpenSource source = ImageOpenSource::None;
bool sizeOverLimit = false;
bool readable = false;
bool openInApp = false;
std::optional<gsl::final_action<Fn<void()>>> accessGuard;
};
[[nodiscard]] ImageOpenCheck CheckImageOpenInApp(
not_null<DocumentData*> document,
const std::shared_ptr<DocumentMedia> &media);
[[nodiscard]] bool LauncherWouldWarn(
const Core::Settings &settings,
Core::NameType nameType,
bool isIpReveal,
const QString &extension,
HistoryItem *item);
base::binary_guard ReadBackgroundImageAsync(
not_null<Data::DocumentMedia*> media,
FnMut<QImage(QImage)> postprocess,
FnMut<void(QImage&&)> done);
void ResolveDocument(
Window::SessionController *controller,
not_null<DocumentData*> document,
HistoryItem *item,
MsgId topicRootId,
PeerId monoforumPeerId,
bool showDrawButton);
} // namespace Data