SDFormat Editor
Loading...
Searching...
No Matches
command_interface.h
1/*
2* sdformat-editor
3* Copyright 2025 sdformat-editor
4*
5* Licensed under the Apache License, Version 2.0 (the "License");
6* you may not use this file except in compliance with the License.
7* You may obtain a copy of the License at
8*
9* http://www.apache.org/licenses/LICENSE-2.0
10*
11* Unless required by applicable law or agreed to in writing, software
12* distributed under the License is distributed on an "AS IS" BASIS,
13* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14* See the License for the specific language governing permissions and
15* limitations under the License.
16*
17* Developer: Zaid Duraid, Ean Wheeler, Evan Vokey
18*/
19
20#ifndef SDFORMAT_EDITOR_COMMAND_INTERFACE_HH_
21#define SDFORMAT_EDITOR_COMMAND_INTERFACE_HH_
22
23#include <iostream>
24
29{
33 public: virtual bool Execute() = 0;
34
38 public: virtual bool ExecuteUndo() = 0;
39
43 public: virtual bool ExecuteRedo() = 0;
44
48 public: virtual bool IsUndoable() = 0;
49
53 public: virtual bool IsRedoable() = 0;
54
60 public: virtual bool IsThreaded(bool& prevent_user_input) = 0;
61
65 public: virtual bool ChangesProgramStateIrreversibly() = 0;
66};;
67
68#endif
The command class encapsulates the interactions between the various interfaces of the SDFormat Editor...
Definition command_interface.h:29
virtual bool ExecuteRedo()=0
Execution of the redo command. Must be implemented as applicable by the derived class.
virtual bool IsThreaded(bool &prevent_user_input)=0
Indicates if this command should be run in a thread.
virtual bool ChangesProgramStateIrreversibly()=0
Indicates if this command is an irreversible state-changing command.
virtual bool ExecuteUndo()=0
Execution of the undo command. Must be implemented as applicable by the derived class.
virtual bool IsRedoable()=0
Redo functionality of the command.
virtual bool IsUndoable()=0
Undo functionality of the command.
virtual bool Execute()=0
Execution of the command. Must be implemented as applicable by the derived class.