MauiKit Image Tools

command.h
1/*
2 * SPDX-FileCopyrightText: (C) 2020 Carl Schwan <carl@carlschwan.eu>
3 *
4 * SPDX-License-Identifier: LGPL-2.1-or-later
5 */
6
7#pragma once
8
9#include "qimage.h"
10#include <QObject>
11#include <QMap>
12#include <QVariant>
13
14class QImage;
15
16/**
17 * A class implementing the command pattern. This is used to implemented various filters.
18 */
20{
21public:
22 virtual ~Command() = 0;
23
24 /**
25 * Applies the change to the document.
26 */
27 virtual QImage redo(QImage image) = 0;
28
29 /**
30 * Revert a change to the document.
31 */
32 virtual QImage undo(QImage image = {}) = 0;
33
34 void addProperty(const QString &key, const QVariant &value );
35 bool hasProperty(const QString &key);
36 QVariant getPropertyValue(const QString &key);
37
38private:
39 QMap<QString, QVariant> m_properties;
40};
A class implementing the command pattern.
Definition command.h:20
virtual QImage redo(QImage image)=0
Applies the change to the document.
virtual QImage undo(QImage image={})=0
Revert a change to the document.
This file is part of the KDE documentation.
Documentation copyright © 1996-2025 The KDE developers.
Generated on Fri Apr 11 2025 11:57:09 by doxygen 1.13.2 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.