![]() |
Mapper
0.9.0
API documentation
|
A map part undo step handles addition, deletion and renaming of map parts. More...
#include <map_part_undo.h>
Public Types | |
enum | MapPartChange { AddMapPart = 1, RemoveMapPart = 2, ModifyMapPart = 3, UndefinedChange = 0 } |
Types of map part changes. More... | |
![]() | |
enum | Type { ReplaceObjectsUndoStepType = 0, DeleteObjectsUndoStepType = 1, AddObjectsUndoStepType = 2, SwitchSymbolUndoStepType = 3, SwitchDashesUndoStepType = 4, CombinedUndoStepType = 5, ValidNoOpUndoStepType = 6, ObjectTagsUndoStepType = 7, MapPartUndoStepType = 8, SwitchPartUndoStepTypeV0 = 9, SwitchPartUndoStepType = 10, InvalidUndoStepType = 999 } |
Types of undo steps for identification. More... | |
typedef std::set< int > | PartSet |
A set of integers referring to parts. More... | |
typedef std::set< Object * > | ObjectSet |
A set of pointers to objects. More... | |
Public Member Functions | |
MapPartUndoStep (Map *map, MapPartChange change, const MapPart *part) | |
Constructs a particular undo step for the given part. More... | |
MapPartUndoStep (Map *map, MapPartChange change, int index) | |
Constructs a particular undo step for the part specified by index. More... | |
MapPartUndoStep (Map *map) | |
Constructs an incomplete undo step of type UndefinedChange. More... | |
~MapPartUndoStep () override | |
bool | isValid () const override |
Returns true unless this step's type is UndefinedChange. More... | |
UndoStep * | undo () override |
Undoes the action and returns a new UndoStep. More... | |
bool | getModifiedParts (PartSet &out) const override |
Adds the list of the step's modified parts to the container provided by out. More... | |
void | getModifiedObjects (int part_index, ObjectSet &out) const override |
Adds the list of the step's modified objects to the container provided by out. More... | |
![]() | |
UndoStep (Type type, Map *map) | |
Constructs an undo step having the given type. More... | |
UndoStep (const UndoStep &)=delete | |
UndoStep (UndoStep &&)=delete | |
virtual | ~UndoStep () |
Destructor. More... | |
UndoStep & | operator= (const UndoStep &)=delete |
UndoStep & | operator= (UndoStep &&)=delete |
Type | getType () const |
Returns the type of the undo step. More... | |
void | save (QXmlStreamWriter &xml) const |
Saves the undo step to the stream in xml format. More... | |
Protected Member Functions | |
void | saveImpl (QXmlStreamWriter &xml) const override |
Saves undo properties to the the xml stream. More... | |
void | loadImpl (QXmlStreamReader &xml, SymbolDictionary &symbol_dict) override |
Loads undo properties from the the xml stream. More... | |
Protected Attributes | |
MapPartChange | change |
int | index |
QString | name |
![]() | |
Type const | type |
The type of the undo step. More... | |
Map *const | map |
The map this undo step belongs. More... | |
Additional Inherited Members | |
![]() | |
static UndoStep * | getUndoStepForType (Type type, Map *map) |
Constructs an undo step of the given type. More... | |
static UndoStep * | load (QXmlStreamReader &xml, Map *map, SymbolDictionary &symbol_dict) |
Loads the undo step from the stream in xml format. More... | |
A map part undo step handles addition, deletion and renaming of map parts.
OpenOrienteering::MapPartUndoStep::MapPartUndoStep | ( | Map * | map, |
MapPartChange | change, | ||
const MapPart * | part | ||
) |
Constructs a particular undo step for the given part.
OpenOrienteering::MapPartUndoStep::MapPartUndoStep | ( | Map * | map, |
MapPartChange | change, | ||
int | index | ||
) |
Constructs a particular undo step for the part specified by index.
OpenOrienteering::MapPartUndoStep::MapPartUndoStep | ( | Map * | map | ) |
Constructs an incomplete undo step of type UndefinedChange.
This is to be used with loadImpl().
|
override |
|
overridevirtual |
Adds the list of the step's modified objects to the container provided by out.
Only objects which belong to the given part are dealt with.
The default implementation does nothing.
Reimplemented from OpenOrienteering::UndoStep.
Adds the list of the step's modified parts to the container provided by out.
The default implementation does nothing and returns false.
Reimplemented from OpenOrienteering::UndoStep.
|
overridevirtual |
Returns true unless this step's type is UndefinedChange.
Reimplemented from OpenOrienteering::UndoStep.
|
overrideprotectedvirtual |
Loads undo properties from the the xml stream.
Implementations in derived classes shall first check the element's name for one of their own elements, and otherwise call the parent class' implementation.
Reimplemented from OpenOrienteering::UndoStep.
|
overrideprotectedvirtual |
Saves undo properties to the the xml stream.
Implementations in derived classes shall first call the parent class' implementation, and then start a new element for additional properties.
Reimplemented from OpenOrienteering::UndoStep.
|
overridevirtual |
Undoes the action and returns a new UndoStep.
The returned UndoStep can redo the action again.
Implements OpenOrienteering::UndoStep.
|
protected |
|
protected |
|
protected |