All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
lc::operation::DocumentOperation Class Referenceabstract

#include <documentoperation.h>

Inheritance diagram for lc::operation::DocumentOperation:
Collaboration diagram for lc::operation::DocumentOperation:

Public Member Functions

 DocumentOperation (Document_SPtr document, const std::string &description)
Document_SPtr document () const
virtual void execute ()
 execute this operation More...
virtual ~DocumentOperation ()
- Public Member Functions inherited from lc::operation::Undoable
 Undoable (const std::string &text)
 Name of this operartion. More...
virtual ~Undoable ()
virtual void undo () const =0
 Undo a given operation. More...
virtual void redo () const =0
 Redo a given operation. More...
virtual std::string text ()
 Name of the operation. More...

Protected Member Functions

virtual void processInternal ()=0

Private Member Functions

void process ()
virtual void start () const
virtual void finnish () const

Private Attributes

Document_SPtr _document


class lc::Document
class Builder

Detailed Description

An operation is a grouped set of 'things' we can do on a document Only one operation can run at a time because the document needs to get locked during an operation.


Definition at line 23 of file documentoperation.h.

Constructor & Destructor Documentation

DocumentOperation::DocumentOperation ( Document_SPtr  document,
const std::string &  description 

Definition at line 7 of file documentoperation.cpp.

7  :
8  Undoable(description),
10 }
Undoable(const std::string &text)
Name of this operartion.
Definition: undoable.h:24
virtual lc::operation::DocumentOperation::~DocumentOperation ( )

Definition at line 36 of file documentoperation.h.

36 {}

Member Function Documentation

std::shared_ptr< Document > DocumentOperation::document ( ) const

Definition at line 12 of file documentoperation.cpp.

12  {
13  return _document;
14 }
void DocumentOperation::execute ( )

execute this operation

Definition at line 20 of file documentoperation.cpp.

20  {
21  _document->execute(shared_from_this());
22 }
virtual void lc::operation::DocumentOperation::finnish ( ) const

This function will get called when the process of this operation is finished

Definition at line 53 of file documentoperation.h.

53 {};
void DocumentOperation::process ( )

This function gets called when an operation starts and when the document is locked for you so you can do your work

Definition at line 16 of file documentoperation.cpp.

16  {
18 }
virtual void lc::operation::DocumentOperation::processInternal ( )
protectedpure virtual
virtual void lc::operation::DocumentOperation::start ( ) const

This function will get called when the process of this operation starts

Definition at line 48 of file documentoperation.h.

48 {};

Friends And Related Function Documentation

friend class Builder

Definition at line 25 of file documentoperation.h.

friend class lc::Document

Definition at line 24 of file documentoperation.h.

Member Data Documentation

Document_SPtr lc::operation::DocumentOperation::_document

Definition at line 53 of file documentoperation.h.

The documentation for this class was generated from the following files: