NCBI C++ ToolKit
|
Search Toolkit Book for CUndoManager
#include <gui/core/undo_manager.hpp>
Classes | |
class | CWriteLockGuard |
Public Member Functions | |
CUndoManager (size_t maxBufferSize=0, CGBDocument *document=0) | |
virtual | ~CUndoManager () |
virtual void | Undo (wxWindow *window=0) |
virtual void | Redo (wxWindow *window=0) |
virtual bool | CanUndo () |
virtual bool | CanRedo () |
virtual string | GetUndoLabel () |
virtual string | GetRedoLabel () |
virtual bool | RequestExclusiveEdit (wxWindow *window, const string &descr) |
virtual bool | ReleaseExclusiveEdit (wxWindow *window) |
virtual void | Execute (IEditCommand *command, wxWindow *window=0) |
virtual bool | ExecuteLock () |
virtual void | ExecuteUnlock () |
void | Reset () |
Public Member Functions inherited from CObjectEx | |
CObjectEx (void) | |
virtual | ~CObjectEx (void) |
Public Member Functions inherited from CObject | |
CObject (void) | |
Constructor. More... | |
CObject (const CObject &src) | |
Copy constructor. More... | |
virtual | ~CObject (void) |
Destructor. More... | |
CObject & | operator= (const CObject &src) THROWS_NONE |
Assignment operator. More... | |
bool | CanBeDeleted (void) const THROWS_NONE |
Check if object can be deleted. More... | |
bool | IsAllocatedInPool (void) const THROWS_NONE |
Check if object is allocated in memory pool (not system heap) More... | |
bool | Referenced (void) const THROWS_NONE |
Check if object is referenced. More... | |
bool | ReferencedOnlyOnce (void) const THROWS_NONE |
Check if object is referenced only once. More... | |
void | AddReference (void) const |
Add reference to object. More... | |
void | RemoveReference (void) const |
Remove reference to object. More... | |
void | ReleaseReference (void) const |
Remove reference without deleting object. More... | |
virtual void | DoNotDeleteThisObject (void) |
Mark this object as not allocated in heap – do not delete this object. More... | |
virtual void | DoDeleteThisObject (void) |
Mark this object as allocated in heap – object can be deleted. More... | |
void * | operator new (size_t size) |
Define new operator for memory allocation. More... | |
void * | operator new[] (size_t size) |
Define new[] operator for 'array' memory allocation. More... | |
void | operator delete (void *ptr) |
Define delete operator for memory deallocation. More... | |
void | operator delete[] (void *ptr) |
Define delete[] operator for memory deallocation. More... | |
void * | operator new (size_t size, void *place) |
Define new operator. More... | |
void | operator delete (void *ptr, void *place) |
Define delete operator. More... | |
void * | operator new (size_t size, CObjectMemoryPool *place) |
Define new operator using memory pool. More... | |
void | operator delete (void *ptr, CObjectMemoryPool *place) |
Define delete operator. More... | |
virtual void | DebugDump (CDebugDumpContext ddc, unsigned int depth) const |
Define method for dumping debug information. More... | |
Public Member Functions inherited from CDebugDumpable | |
CDebugDumpable (void) | |
virtual | ~CDebugDumpable (void) |
void | DebugDumpText (ostream &out, const string &bundle, unsigned int depth) const |
void | DebugDumpFormat (CDebugDumpFormatter &ddf, const string &bundle, unsigned int depth) const |
void | DumpToConsole (void) const |
Public Member Functions inherited from CWeakObject | |
CWeakObject (void) | |
virtual | ~CWeakObject (void) |
CPtrToObjectProxy * | GetPtrProxy (void) const |
Get pointer to proxy object containing pointer to this object. More... | |
Public Member Functions inherited from ICommandProccessor | |
virtual | ~ICommandProccessor () |
Protected Types | |
typedef list< CIRef< IEditCommand > > | TCommands |
Protected Member Functions | |
void | ShowErrorMsg (IEditCommand *pCommand, const string &errMsg) |
void | x_SendChangingEvent () |
void | x_SendChangedEvent () |
bool | x_WriteLock () |
bool | x_LockDocument () |
void | x_ShowExclusiveEditDlg () |
Protected Member Functions inherited from CObject | |
virtual void | DeleteThis (void) |
Virtual method "deleting" this object. More... | |
Protected Member Functions inherited from CWeakObject | |
void | CleanWeakRefs (void) const |
Method cleaning all CWeakRefs referencing at this moment to the object After calling to this method all existing CWeakRefs referencing to the object will return NULL, so it effectively will be equal to deleting the object. More... | |
Protected Attributes | |
TCommands | m_UndoBuffer |
TCommands | m_RedoBuffer |
CGBDocument * | m_Document |
size_t | m_MaxBufferSize |
CFastMutex | m_RWMutex |
int | m_LockCounter |
wxWindow * | m_ExclusiveEdit |
string | m_ExclusiveDescr |
Additional Inherited Members | |
Public Types inherited from CObject | |
enum | EAllocFillMode { eAllocFillNone = 1 , eAllocFillZero , eAllocFillPattern } |
Control filling of newly allocated memory. More... | |
typedef CObjectCounterLocker | TLockerType |
Default locker type for CRef. More... | |
typedef atomic< Uint8 > | TCounter |
Counter type is CAtomiCounter. More... | |
typedef Uint8 | TCount |
Alias for value type of counter. More... | |
Static Public Member Functions inherited from CObject | |
static NCBI_XNCBI_EXPORT void | ThrowNullPointerException (void) |
Define method to throw null pointer exception. More... | |
static NCBI_XNCBI_EXPORT void | ThrowNullPointerException (const type_info &type) |
static EAllocFillMode | GetAllocFillMode (void) |
static void | SetAllocFillMode (EAllocFillMode mode) |
static void | SetAllocFillMode (const string &value) |
Set mode from configuration parameter value. More... | |
Static Public Member Functions inherited from CDebugDumpable | |
static void | EnableDebugDump (bool on) |
Static Public Attributes inherited from CObject | |
static const TCount | eCounterBitsCanBeDeleted = 1 << 0 |
Define possible object states. More... | |
static const TCount | eCounterBitsInPlainHeap = 1 << 1 |
Heap signature was found. More... | |
static const TCount | eCounterBitsPlaceMask |
Mask for 'in heap' state flags. More... | |
static const int | eCounterStep = 1 << 2 |
Skip over the "in heap" bits. More... | |
static const TCount | eCounterValid = TCount(1) << (sizeof(TCount) * 8 - 2) |
Minimal value for valid objects (reference counter is zero) Must be a single bit value. More... | |
static const TCount | eCounterStateMask |
Valid object, and object in heap. More... | |
Definition at line 47 of file undo_manager.hpp.
|
protected |
Definition at line 81 of file undo_manager.hpp.
|
inline |
Definition at line 50 of file undo_manager.hpp.
|
inlinevirtual |
Definition at line 52 of file undo_manager.hpp.
|
virtual |
Implements IUndoManager.
Definition at line 183 of file undo_manager.cpp.
References m_RedoBuffer.
Referenced by CProjectView::CanRedo().
|
virtual |
Implements IUndoManager.
Definition at line 178 of file undo_manager.cpp.
References m_UndoBuffer.
Referenced by CProjectView::CanUndo().
|
virtual |
Implements ICommandProccessor.
Definition at line 50 of file undo_manager.cpp.
References command, CException::GetMsg(), m_ExclusiveEdit, m_MaxBufferSize, m_RedoBuffer, m_UndoBuffer, ShowErrorMsg(), x_LockDocument(), x_SendChangedEvent(), x_SendChangingEvent(), and x_ShowExclusiveEditDlg().
|
virtual |
Implements ICommandProccessor.
Definition at line 238 of file undo_manager.cpp.
References m_LockCounter, and m_RWMutex.
|
virtual |
Implements ICommandProccessor.
Definition at line 248 of file undo_manager.cpp.
References _ASSERT, m_LockCounter, and m_RWMutex.
|
virtual |
Implements IUndoManager.
Definition at line 194 of file undo_manager.cpp.
References _ASSERT, and m_RedoBuffer.
|
virtual |
Implements IUndoManager.
Definition at line 188 of file undo_manager.cpp.
References _ASSERT, and m_UndoBuffer.
|
virtual |
Implements IUndoManager.
Definition at line 136 of file undo_manager.cpp.
References _ASSERT, command, Error(), CException::GetMsg(), LOG_POST, m_ExclusiveEdit, m_RedoBuffer, m_UndoBuffer, ShowErrorMsg(), x_LockDocument(), x_SendChangedEvent(), x_SendChangingEvent(), and x_ShowExclusiveEditDlg().
Referenced by CProjectView::OnRedo().
|
virtual |
Implements IUndoManager.
Definition at line 305 of file undo_manager.cpp.
References m_ExclusiveDescr, and m_ExclusiveEdit.
Implements IUndoManager.
Definition at line 292 of file undo_manager.cpp.
References m_ExclusiveDescr, m_ExclusiveEdit, and x_ShowExclusiveEditDlg().
void CUndoManager::Reset | ( | void | ) |
Definition at line 200 of file undo_manager.cpp.
References m_RedoBuffer, and m_UndoBuffer.
Referenced by CLocalFileRestorer::RestoreFile().
|
protected |
Definition at line 206 of file undo_manager.cpp.
References Error(), IEditCommand::GetLabel(), LOG_POST, and msg().
|
virtual |
Implements IUndoManager.
Definition at line 94 of file undo_manager.cpp.
References _ASSERT, command, Error(), CException::GetMsg(), LOG_POST, m_ExclusiveEdit, m_RedoBuffer, m_UndoBuffer, ShowErrorMsg(), x_LockDocument(), x_SendChangedEvent(), x_SendChangingEvent(), and x_ShowExclusiveEditDlg().
Referenced by CProjectView::OnUndo().
|
protected |
Definition at line 276 of file undo_manager.cpp.
References NULL, and x_WriteLock().
|
protected |
Definition at line 230 of file undo_manager.cpp.
References CProjectViewEvent::eData, m_Document, and CGBDocument::x_FireProjectChanged().
|
protected |
Definition at line 224 of file undo_manager.cpp.
References CProjectViewEvent::eDataChanging, m_Document, and CGBDocument::x_FireProjectChanged().
|
protected |
Definition at line 316 of file undo_manager.cpp.
References CExclusiveEditDlg::Create(), CExclusiveEditDlg::InitData(), m_ExclusiveDescr, m_ExclusiveEdit, and NULL.
Referenced by Execute(), Redo(), RequestExclusiveEdit(), and Undo().
|
protected |
Definition at line 258 of file undo_manager.cpp.
References m_LockCounter, and m_RWMutex.
Referenced by x_LockDocument().
|
protected |
Definition at line 94 of file undo_manager.hpp.
Referenced by x_SendChangedEvent(), and x_SendChangingEvent().
|
protected |
Definition at line 101 of file undo_manager.hpp.
Referenced by ReleaseExclusiveEdit(), RequestExclusiveEdit(), and x_ShowExclusiveEditDlg().
|
protected |
Definition at line 100 of file undo_manager.hpp.
Referenced by Execute(), Redo(), ReleaseExclusiveEdit(), RequestExclusiveEdit(), Undo(), and x_ShowExclusiveEditDlg().
|
protected |
Definition at line 98 of file undo_manager.hpp.
Referenced by ExecuteLock(), ExecuteUnlock(), x_WriteLock(), and CUndoManager::CWriteLockGuard::~CWriteLockGuard().
|
protected |
Definition at line 95 of file undo_manager.hpp.
Referenced by Execute().
|
protected |
Definition at line 93 of file undo_manager.hpp.
Referenced by CanRedo(), Execute(), GetRedoLabel(), Redo(), Reset(), and Undo().
|
protected |
Definition at line 97 of file undo_manager.hpp.
Referenced by ExecuteLock(), ExecuteUnlock(), x_WriteLock(), and CUndoManager::CWriteLockGuard::~CWriteLockGuard().
|
protected |
Definition at line 92 of file undo_manager.hpp.
Referenced by CanUndo(), Execute(), GetUndoLabel(), Redo(), Reset(), and Undo().