fw4spl
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
SCommandHistory.hpp
1
/* ***** BEGIN LICENSE BLOCK *****
2
* FW4SPL - Copyright (C) IRCAD, 2017.
3
* Distributed under the terms of the GNU Lesser General Public License (LGPL) as
4
* published by the Free Software Foundation.
5
* ****** END LICENSE BLOCK ****** */
6
7
#ifndef __CTRLHISTORY_SCOMMANDHISTORY_HPP__
8
#define __CTRLHISTORY_SCOMMANDHISTORY_HPP__
9
10
#include "ctrlHistory/config.hpp"
11
12
#include <fwCommand/ICommand.hpp>
13
#include <fwCommand/UndoRedoManager.hpp>
14
15
#include <fwCore/base.hpp>
16
17
#include <fwServices/IService.hpp>
18
#include <fwServices/macros.hpp>
19
20
namespace
ctrlHistory
21
{
22
51
class
CTRLHISTORY_CLASS_API
SCommandHistory
:
public
::fwServices::IService
52
{
53
public
:
54
55
fwCoreServiceClassDefinitionsMacro
( (
SCommandHistory
)(::
fwServices::IService
) );
56
58
CTRLHISTORY_API
SCommandHistory
();
59
61
CTRLHISTORY_API
virtual
~
SCommandHistory
();
62
63
protected
:
64
66
CTRLHISTORY_API
virtual
void
configuring()
override
;
67
69
CTRLHISTORY_API
virtual
void
starting()
override
;
70
72
CTRLHISTORY_API
virtual
void
updating()
override
;
73
75
CTRLHISTORY_API
virtual
void
stopping()
override
;
76
77
private
:
78
79
typedef ::fwCom::Signal<void (bool)>
CanDoSignalType
;
80
82
void
enqueue(::fwCommand::ICommand::sptr command);
83
85
void
undo();
86
88
void
redo();
89
91
void
clear();
92
94
void
emitModifSig()
const
;
95
96
CanDoSignalType::sptr m_canUndoSig;
97
98
CanDoSignalType::sptr m_canRedoSig;
99
100
::fwCommand::UndoRedoManager
m_undoRedoManager;
101
};
102
103
}
// namespace ctrlHistory
104
105
#endif
/* __CTRLHISTORY_SCOMMANDHISTORY_HPP__ */
fwServices::IService
Base class for all services.
Definition:
IService.hpp:61
fwCommand::UndoRedoManager
Keep track of commands, undo/redo them.
Definition:
UndoRedoManager.hpp:22
fwCom::Signal
Definition:
Signal.hpp:27
ctrlHistory
The namespace ctrlHistory contains services handling command histories.
Definition:
Bundles/ctrl/ctrlHistory/include/ctrlHistory/namespace.hpp:13
ctrlHistory::SCommandHistory
This service manages a command history. The history is modified when receiving "undo", "redo", "enqueue" or "clear" signal.
Definition:
SCommandHistory.hpp:51
fwCoreServiceClassDefinitionsMacro
#define fwCoreServiceClassDefinitionsMacro(_classinfo_)
Generate common code for services classes.
Definition:
core/fwCore/include/fwCore/macros.hpp:496
Bundles
ctrl
ctrlHistory
include
ctrlHistory
SCommandHistory.hpp
Generated on Wed Sep 5 2018 12:47:56 for fw4spl by
1.8.11