CaptureMoment 0.1.0
Free and open-source non-destructive photo editor
Loading...
Searching...
No Matches
serializer_controller.h
Go to the documentation of this file.
1
8#pragma once
9
12
13#include <QObject>
14#include <QString>
15#include <memory>
16#include <vector>
17
18namespace CaptureMoment::Core {
19 namespace Operations {
20 struct OperationDescriptor;
21 }
22 namespace Serializer {
23 class FileSerializerManager;
24 }
25}
26
27namespace CaptureMoment::UI {
28
29namespace Serializer {
30
40class SerializerController : public QObject
41{
42 Q_OBJECT
43
44public:
57 explicit SerializerController(std::unique_ptr<CaptureMoment::Core::Serializer::FileSerializerManager> file_serializer_manager, QObject* parent = nullptr);
58
62 ~SerializerController() override;
63
64 // Disable copy and move semantics for simplicity if the core dependency is unique_ptr
69
70signals:
75
80 void operationsSaveFailed(const QString& error_msg);
81
86 void operationsLoaded(const std::vector<CaptureMoment::Core::Operations::OperationDescriptor>& operations);
87
92
97 void operationsLoadFailed(const QString& error_msg);
98
99public slots:
109 void saveOperations(const QString& image_path, const std::vector<CaptureMoment::Core::Operations::OperationDescriptor>& operations);
110
120 void loadOperations(const QString& image_path);
121
122private:
127 std::unique_ptr<CaptureMoment::Core::Serializer::FileSerializerManager> m_file_serializer_manager;
128};
129
130} // namespace Serializer
131
132} // namespace CaptureMoment::UI
UI manager for handling file-based serialization and deserialization of image operations.
void saveOperations(const QString &image_path, const std::vector< CaptureMoment::Core::Operations::OperationDescriptor > &operations)
Saves the provided list of operations to a file associated with the given image path.
SerializerController(std::unique_ptr< CaptureMoment::Core::Serializer::FileSerializerManager > file_serializer_manager, QObject *parent=nullptr)
Constructs a UISerializerManager.
void operationsSaved()
Signal emitted when operations are successfully saved to a file.
void operationsSaveFailed(const QString &error_msg)
Signal emitted when the operation to save operations fails.
SerializerController(SerializerController &&)=delete
void operationsLoadFailed(const QString &error_msg)
Signal emitted when the operation to load operations fails.
void operationsNotFoundOnLoad()
Signal emitted when no operations were found in the file during load.
SerializerController & operator=(SerializerController &&)=delete
SerializerController & operator=(const SerializerController &)=delete
void operationsLoaded(const std::vector< CaptureMoment::Core::Operations::OperationDescriptor > &operations)
Signal emitted when operations are successfully loaded from a file.
SerializerController(const SerializerController &)=delete
void loadOperations(const QString &image_path)
Loads a list of operations from a file associated with the given image path.
Declaration of FileSerializerManager class.
Manages the lifecycle of a single IWorkingImage instance.
Descriptor of an operation with its parameters and unique identifier.
CaptureMoment — footer