tdesktop/Telegram/SourceFiles/export/export_settings.h

79 lines
1.7 KiB
C
Raw Normal View History

2018-06-02 16:29:21 +02: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/flags.h"
#include "base/flat_map.h"
namespace Export {
namespace Output {
enum class Format;
} // namespace Output
2018-06-02 16:29:21 +02:00
struct MediaSettings {
enum class Type {
Photo = 0x01,
Video = 0x02,
Sticker = 0x04,
GIF = 0x08,
File = 0x10,
2018-06-02 16:29:21 +02:00
};
using Types = base::flags<Type>;
friend inline constexpr auto is_flag_type(Type) { return true; };
Types types = DefaultTypes();
int sizeLimit = 8 * 1024 * 1024;
static inline Types DefaultTypes() {
return Type::Photo;
}
};
struct Settings {
enum class Type {
PersonalInfo = 0x001,
Userpics = 0x002,
Contacts = 0x004,
Sessions = 0x008,
PersonalChats = 0x010,
BotChats = 0x020,
PrivateGroups = 0x040,
PublicGroups = 0x080,
PrivateChannels = 0x100,
PublicChannels = 0x200,
2018-06-02 16:29:21 +02:00
};
using Types = base::flags<Type>;
friend inline constexpr auto is_flag_type(Type) { return true; };
QString path;
QString internalLinksDomain;
Output::Format format = Output::Format();
2018-06-02 16:29:21 +02:00
Types types = DefaultTypes();
2018-06-13 15:12:36 +02:00
Types fullChats = DefaultFullChats();
2018-06-02 16:29:21 +02:00
MediaSettings defaultMedia;
base::flat_map<Type, MediaSettings> customMedia;
static inline Types DefaultTypes() {
return Type::PersonalInfo
| Type::Userpics
2018-06-02 16:29:21 +02:00
| Type::Contacts
| Type::Sessions
| Type::PersonalChats
| Type::PrivateGroups;
2018-06-02 16:29:21 +02:00
}
2018-06-13 15:12:36 +02:00
static inline Types DefaultFullChats() {
return Type::PersonalChats;
}
2018-06-02 16:29:21 +02:00
};
} // namespace Export