tdesktop/Telegram/SourceFiles/boxes/background_box.h

50 lines
1.0 KiB
C
Raw Normal View History

2015-02-03 15:02:46 +00:00
/*
This file is part of Telegram Desktop,
the official desktop application for the Telegram messaging service.
2015-02-03 15:02:46 +00:00
For license and copyright information please follow this link:
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
2015-02-03 15:02:46 +00:00
*/
#pragma once
#include "ui/layers/box_content.h"
class PeerData;
2020-06-10 18:08:17 +00:00
namespace Window {
class SessionController;
} // namespace Window
2019-07-24 14:00:30 +00:00
2019-02-09 13:36:07 +00:00
namespace Data {
class WallPaper;
} // namespace Data
2019-09-18 11:19:05 +00:00
class BackgroundBox : public Ui::BoxContent {
2015-02-03 15:02:46 +00:00
public:
BackgroundBox(
QWidget*,
not_null<Window::SessionController*> controller,
PeerData *forPeer = nullptr);
2015-02-03 15:02:46 +00:00
protected:
void prepare() override;
2015-02-03 15:02:46 +00:00
private:
class Inner;
2019-02-09 13:36:07 +00:00
void chosen(const Data::WallPaper &paper);
[[nodiscard]] bool hasDefaultForPeer() const;
[[nodiscard]] bool chosenDefaultForPeer(
const Data::WallPaper &paper) const;
2019-02-09 13:36:07 +00:00
void removePaper(const Data::WallPaper &paper);
void resetForPeer();
2019-02-09 13:36:07 +00:00
void chooseFromFile();
2020-06-10 18:08:17 +00:00
const not_null<Window::SessionController*> _controller;
2019-07-24 14:00:30 +00:00
QPointer<Inner> _inner;
PeerData *_forPeer = nullptr;
2015-02-03 15:02:46 +00:00
};