Loading...
Searching...
No Matches
Remove.hpp
1#pragma once
2#include <Device/Node/DeviceNode.hpp>
3
4#include <Explorer/Commands/DeviceExplorerCommandFactory.hpp>
5
6#include <score/command/Command.hpp>
7#include <score/model/path/Path.hpp>
8
9#include <score_plugin_deviceexplorer_export.h>
10
11struct DataStreamInput;
12struct DataStreamOutput;
13
14namespace Explorer
15{
16class DeviceDocumentPlugin;
17namespace Command
18{
19// TODO split this command.
20class SCORE_PLUGIN_DEVICEEXPLORER_EXPORT Remove final : public score::Command
21{
22 SCORE_COMMAND_DECL(
23 DeviceExplorerCommandFactoryName(), Remove, "Remove an Explorer node")
24public:
25 // For addresses
26 Remove(const DeviceDocumentPlugin& devplug, Device::NodePath&& path);
27
28 // For devices
29 Remove(const DeviceDocumentPlugin& devplug, const Device::Node& node);
30
31 ~Remove();
32
33 void undo(const score::DocumentContext& ctx) const override;
34 void redo(const score::DocumentContext& ctx) const override;
35
36protected:
37 void serializeImpl(DataStreamInput&) const override;
38 void deserializeImpl(DataStreamOutput&) override;
39
40protected:
41 bool m_device{};
42 score::Command* m_cmd{};
43};
44}
45}
Definition Remove.hpp:21
Path in a tree of QAbstractItemModel objects.
Definition TreePath.hpp:34
The Command class.
Definition Command.hpp:34
Definition DataStreamHelpers.hpp:99
Definition DataStreamHelpers.hpp:103
Definition DocumentContext.hpp:18