#include <gcp/operation.h>
|
void | Add (unsigned type=0) |
|
void | Delete (unsigned type=0) |
|
Base operation class for the Undo/Redo framework. This class is virtual since some methods are pure virtual.
Definition at line 61 of file operation.h.
§ Operation()
gcp::Operation::Operation |
( |
Document * |
pDoc, |
|
|
unsigned long |
ID |
|
) |
| |
- Parameters
-
pDoc | a document. |
ID | a unique operation ID for the document and the session. |
Creates a new operation. Operations should always created by calls to Document::GetNewOperation().
§ Add()
void gcp::Operation::Add |
( |
unsigned |
type = 0 | ) |
|
|
protected |
- Parameters
-
type | a number indicationg the role of the stored objects. |
The type argument is only significant for the gcp::ModifyOperation class where 0 represent the state of the objects before the operation, and 1 the state of the objects after the operation.
Adds the stored objects to the document owning the operation.
§ AddNode()
virtual void gcp::Operation::AddNode |
( |
xmlNodePtr |
node, |
|
|
unsigned |
type = 0 |
|
) |
| |
|
virtual |
- Parameters
-
node | an xml node related to the changes. |
type | a number indicationg the role of the stored objects. |
The type argument is only significant for the gcp::ModifyOperation class where 0 represent the state of the objects before the operation, and 1 the state of the objects after the operation.
Adds the node to the document owning the operation. This might be used when Objects are not available such as when editing text.
§ AddObject()
virtual void gcp::Operation::AddObject |
( |
gcu::Object * |
pObject, |
|
|
unsigned |
type = 0 |
|
) |
| |
|
virtual |
- Parameters
-
pObject | an Object affected by the changes. |
type | a number indicationg the role of the stored objects. |
The type argument is only significant for the gcp::ModifyOperation class where 0 represent the state of the objects before the operation, and 1 the state of the objects after the operation.
Adds an object to the operation. Typically, modifying an object whould need code like:
Object *obj;
...
Document *doc = obj->GetDocument ();
op->AddObject (obj, 0);
...
op->AddObject (obj, 1);
doc->FinishOperation ();
§ Delete()
void gcp::Operation::Delete |
( |
unsigned |
type = 0 | ) |
|
|
protected |
- Parameters
-
type | a number indicationg the role of the stored objects. |
The type argument is only significant for the gcp::ModifyOperation class where 0 represent the state of the objects before the operation, and 1 the state of the objects after the operation.
Deletes the stored objects to the document owning the operation.
§ Redo()
virtual void gcp::Operation::Redo |
( |
| ) |
|
|
pure virtual |
§ Undo()
virtual void gcp::Operation::Undo |
( |
| ) |
|
|
pure virtual |
§ m_Nodes
xmlNodePtr* gcp::Operation::m_Nodes |
|
protected |
The xml nodes storing the changes.
Definition at line 145 of file operation.h.
The documentation for this class was generated from the following file: