aboutsummaryrefslogtreecommitdiffstats
path: root/commands/command_filter.h
blob: e09753edf4bf01cb67b5d2dc0943447d60595c37 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
// SPDX-License-Identifier: GPL-2.0
// Note: this header file is used by the undo-machinery and should not be included elsewhere.

#ifndef COMMAND_FILTER_H
#define COMMAND_FILTER_H

#include "command_base.h"
#include "core/divefilter.h"

struct FilterData;

// We put everything in a namespace, so that we can shorten names without polluting the global namespace
namespace Command {

class CreateFilterPreset final : public Base {
public:
	CreateFilterPreset(const QString &name, const FilterData &data);
private:
	// for redo
	QString name;
	FilterData data;

	// for undo
	int index;

	void undo() override;
	void redo() override;
	bool workToBeDone() override;
};

class RemoveFilterPreset final : public Base {
public:
	RemoveFilterPreset(int index);
private:
	// for undo
	QString name;
	FilterData data;

	// for redo
	int index;

	void undo() override;
	void redo() override;
	bool workToBeDone() override;
};

class EditFilterPreset final : public Base {
public:
	EditFilterPreset(int index, const FilterData &data);
private:
	// for redo and undo
	int index;
	FilterData data;

	void undo() override;
	void redo() override;
	bool workToBeDone() override;
};

} // namespace Command
#endif