2017-09-04 11:40:02 +00:00
|
|
|
/*
|
|
|
|
This file is part of Telegram Desktop,
|
|
|
|
the official desktop version of Telegram messaging app, see https://telegram.org
|
|
|
|
|
|
|
|
Telegram Desktop is free software: you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation, either version 3 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
It is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
In addition, as a special exception, the copyright holders give permission
|
|
|
|
to link the code of portions of this program with the OpenSSL library.
|
|
|
|
|
|
|
|
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
|
|
|
|
Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
|
|
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
|
2017-09-13 16:57:44 +00:00
|
|
|
#include <rpl/producer.h>
|
2017-09-04 11:40:02 +00:00
|
|
|
#include "base/enum_mask.h"
|
|
|
|
|
|
|
|
namespace Storage {
|
|
|
|
|
2017-10-29 15:32:01 +00:00
|
|
|
struct SparseIdsListResult;
|
|
|
|
|
2017-09-04 11:40:02 +00:00
|
|
|
struct SharedMediaAddNew;
|
|
|
|
struct SharedMediaAddExisting;
|
|
|
|
struct SharedMediaAddSlice;
|
|
|
|
struct SharedMediaRemoveOne;
|
|
|
|
struct SharedMediaRemoveAll;
|
|
|
|
struct SharedMediaQuery;
|
2017-10-29 15:32:01 +00:00
|
|
|
using SharedMediaResult = SparseIdsListResult;
|
2017-08-18 19:14:31 +00:00
|
|
|
struct SharedMediaSliceUpdate;
|
2017-09-04 11:40:02 +00:00
|
|
|
|
2017-08-29 19:52:52 +00:00
|
|
|
struct UserPhotosAddNew;
|
|
|
|
struct UserPhotosAddSlice;
|
|
|
|
struct UserPhotosRemoveOne;
|
|
|
|
struct UserPhotosRemoveAfter;
|
|
|
|
struct UserPhotosQuery;
|
|
|
|
struct UserPhotosResult;
|
|
|
|
struct UserPhotosSliceUpdate;
|
|
|
|
|
2017-09-04 11:40:02 +00:00
|
|
|
class Facade {
|
|
|
|
public:
|
|
|
|
Facade();
|
|
|
|
|
|
|
|
void add(SharedMediaAddNew &&query);
|
|
|
|
void add(SharedMediaAddExisting &&query);
|
|
|
|
void add(SharedMediaAddSlice &&query);
|
|
|
|
void remove(SharedMediaRemoveOne &&query);
|
|
|
|
void remove(SharedMediaRemoveAll &&query);
|
|
|
|
|
2017-09-04 19:14:44 +00:00
|
|
|
rpl::producer<SharedMediaResult> query(SharedMediaQuery &&query) const;
|
|
|
|
rpl::producer<SharedMediaSliceUpdate> sharedMediaSliceUpdated() const;
|
|
|
|
rpl::producer<SharedMediaRemoveOne> sharedMediaOneRemoved() const;
|
|
|
|
rpl::producer<SharedMediaRemoveAll> sharedMediaAllRemoved() const;
|
2017-08-18 19:14:31 +00:00
|
|
|
|
2017-08-29 19:52:52 +00:00
|
|
|
void add(UserPhotosAddNew &&query);
|
|
|
|
void add(UserPhotosAddSlice &&query);
|
|
|
|
void remove(UserPhotosRemoveOne &&query);
|
|
|
|
void remove(UserPhotosRemoveAfter &&query);
|
|
|
|
|
2017-09-06 14:50:11 +00:00
|
|
|
rpl::producer<UserPhotosResult> query(UserPhotosQuery &&query) const;
|
|
|
|
rpl::producer<UserPhotosSliceUpdate> userPhotosSliceUpdated() const;
|
2017-08-29 19:52:52 +00:00
|
|
|
|
2017-09-04 11:40:02 +00:00
|
|
|
~Facade();
|
|
|
|
|
|
|
|
private:
|
|
|
|
class Impl;
|
|
|
|
const std::unique_ptr<Impl> _impl;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace Storage
|