List of all members.
Detailed Description
Class to handle undo/redo information. Events that can be undone/redone are added to the Undo. One user operation may involve thouthands of changes added to the history, but the user does not want to press undo a thousand times. This is managed by setting a UserInteractionEnd flag on the last event in a chain that the user started. When doing undo, one undo step is consists of all events from the current event until the next event with the UserInteraction flag set.
This means that after all user-driven events, the UserInteractionEnd should be set:
void MyClass::userPushedAButtonCB( CallBacker* )
{
doSomethingsThatAddThingsOnTheHistory();
history.setUserInteractionEnd( currentEventID() );
}
Constructor & Destructor Documentation
| virtual Undo::~Undo |
( |
|
) |
[virtual] |
Member Function Documentation
| int Undo::addEvent |
( |
UndoEvent * |
event, |
|
|
const char * |
description = 0 | |
|
) |
| | |
- Parameters:
-
| event | The new event (becomes mine). |
- Returns:
- the event id.
| bool Undo::canReDo |
( |
|
) |
const |
| bool Undo::canUnDo |
( |
|
) |
const |
- Note:
- takes redodesc with userinteraction
| int Undo::currentEventID |
( |
|
) |
const |
| int Undo::firstEventID |
( |
|
) |
const |
| int Undo::getNextUserInteractionEnd |
( |
int |
start |
) |
const |
| int Undo::indexOf |
( |
int |
eventid |
) |
const [protected] |
| bool Undo::isUserInteractionEnd |
( |
int |
eventid |
) |
const |
| int Undo::lastEventID |
( |
|
) |
const |
| int Undo::maxLength |
( |
|
) |
const |
Returns maximum number of userevents.
- Note:
- The actual number of events may be considerably higher since many events may be part of one single user event.
| bool Undo::reDo |
( |
int |
nrtimes = 1, |
|
|
bool |
userinteraction = true | |
|
) |
| | |
| void Undo::removeAllAfterCurrentEvent |
( |
|
) |
|
| void Undo::removeAllBeforeCurrentEvent |
( |
|
) |
|
| void Undo::removeOldEvents |
( |
|
) |
[protected] |
| void Undo::removeStartToAndIncluding |
( |
int |
|
) |
[protected] |
| void Undo::setDesc |
( |
int |
eventid, |
|
|
const char * |
d | |
|
) |
| | |
| void Undo::setMaxLength |
( |
int |
|
) |
|
| void Undo::setUserInteractionEnd |
( |
int |
eventid, |
|
|
bool |
= true | |
|
) |
| | |
| bool Undo::unDo |
( |
int |
nrtimes = 1, |
|
|
bool |
userinteraction = true | |
|
) |
| | |
Member Data Documentation