BornAgain
1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
undostack.h
Go to the documentation of this file.
1
// ************************************************************************************************
2
//
3
// qt-mvvm: Model-view-view-model framework for large GUI applications
4
//
5
//! @file mvvm/model/mvvm/commands/undostack.h
6
//! @brief Defines class CLASS?
7
//!
8
//! @homepage http://www.bornagainproject.org
9
//! @license GNU General Public License v3 or higher (see COPYING)
10
//! @copyright Forschungszentrum Jülich GmbH 2020
11
//! @authors Gennady Pospelov et al, Scientific Computing Group at MLZ (see CITATION, AUTHORS)
12
//
13
// ************************************************************************************************
14
15
#ifndef BORNAGAIN_MVVM_MODEL_MVVM_COMMANDS_UNDOSTACK_H
16
#define BORNAGAIN_MVVM_MODEL_MVVM_COMMANDS_UNDOSTACK_H
17
18
#include "
mvvm/interfaces/undostackinterface.h
"
19
#include "mvvm/model_export.h"
20
#include <memory>
21
22
class
QUndoStack;
23
24
namespace
ModelView
{
25
26
//! Default undo stack implementation. Internally relies on QUndoStack.
27
//! It serves two goals: a) hides Qt usage b) simplifies future refactoring toward Qt-independent
28
//! libmvvm_model library.
29
30
class
MVVM_MODEL_EXPORT
UndoStack
:
public
UndoStackInterface
{
31
public
:
32
UndoStack
();
33
~UndoStack
()
override
;
34
35
//! Executes the command, then pushes it in the stack for possible undo.
36
void
execute(std::shared_ptr<AbstractItemCommand> command)
override
;
37
38
bool
isActive()
const override
;
39
bool
canUndo()
const override
;
40
bool
canRedo()
const override
;
41
int
index()
const override
;
42
int
count()
const override
;
43
void
undo()
override
;
44
void
redo()
override
;
45
void
clear()
override
;
46
void
setUndoLimit(
int
limit)
override
;
47
48
static
QUndoStack* qtUndoStack(
UndoStackInterface
* stack_interface);
49
50
void
beginMacro(
const
std::string&
name
)
override
;
51
void
endMacro()
override
;
52
53
private
:
54
struct
UndoStackImpl
;
55
std::unique_ptr<UndoStackImpl>
p_impl
;
56
};
57
58
}
// namespace ModelView
59
60
#endif
// BORNAGAIN_MVVM_MODEL_MVVM_COMMANDS_UNDOSTACK_H
ModelView::UndoStackInterface
Interface class for undo/redo stack.
Definition:
undostackinterface.h:29
ModelView::UndoStack
Default undo stack implementation.
Definition:
undostack.h:30
ModelView::UndoStack::~UndoStack
~UndoStack() override
ModelView::UndoStack::p_impl
std::unique_ptr< UndoStackImpl > p_impl
Definition:
undostack.h:54
ModelView
materialitems.h Collection of materials to populate MaterialModel.
Definition:
importtablewidget.h:26
RealSpace::Particles::name
QString const & name(EShape k)
Definition:
particles.cpp:21
ModelView::UndoStack::UndoStackImpl
Definition:
undostack.cpp:21
undostackinterface.h
Defines class CLASS?
mvvm
model
mvvm
commands
undostack.h
Generated by
1.9.1