tdesktop/Telegram/SourceFiles/editor/photo_editor.h

63 lines
1.5 KiB
C
Raw Normal View History

/*
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 "ui/rp_widget.h"
#include "base/unique_qptr.h"
#include "editor/photo_editor_common.h"
#include "editor/photo_editor_inner_common.h"
#include "ui/image/image.h"
namespace Window {
class Controller;
} // namespace Window
namespace Editor {
2021-02-16 03:45:05 +00:00
class ColorPicker;
class PhotoEditorContent;
class PhotoEditorControls;
struct Controllers;
class PhotoEditor final : public Ui::RpWidget {
public:
PhotoEditor(
not_null<Ui::RpWidget*> parent,
not_null<Window::Controller*> controller,
std::shared_ptr<Image> photo,
PhotoModifications modifications,
EditorData data = EditorData());
2021-02-08 03:13:40 +00:00
void save();
rpl::producer<PhotoModifications> doneRequests() const;
rpl::producer<> cancelRequests() const;
2021-02-08 03:13:40 +00:00
void handleKeyPress(not_null<QKeyEvent*> e);
private:
PhotoModifications _modifications;
const std::shared_ptr<Controllers> _controllers;
base::unique_qptr<PhotoEditorContent> _content;
base::unique_qptr<PhotoEditorControls> _controls;
2021-02-16 03:45:05 +00:00
const std::unique_ptr<ColorPicker> _colorPicker;
rpl::variable<PhotoEditorMode> _mode = PhotoEditorMode{
.mode = PhotoEditorMode::Mode::Transform,
.action = PhotoEditorMode::Action::None,
};
2021-02-08 03:13:40 +00:00
rpl::event_stream<PhotoModifications> _done;
rpl::event_stream<> _cancel;
2021-02-08 03:13:40 +00:00
};
} // namespace Editor