NCBI C++ ToolKit
Classes | Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | List of all members
CUndoManager Class Reference

Search Toolkit Book for CUndoManager

#include <gui/core/undo_manager.hpp>

+ Inheritance diagram for CUndoManager:
+ Collaboration diagram for CUndoManager:

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...
 
CObjectoperator= (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)
 
CPtrToObjectProxyGetPtrProxy (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
 
CGBDocumentm_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< Uint8TCounter
 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...
 

Detailed Description

Definition at line 47 of file undo_manager.hpp.

Member Typedef Documentation

◆ TCommands

typedef list< CIRef<IEditCommand> > CUndoManager::TCommands
protected

Definition at line 81 of file undo_manager.hpp.

Constructor & Destructor Documentation

◆ CUndoManager()

CUndoManager::CUndoManager ( size_t  maxBufferSize = 0,
CGBDocument document = 0 
)
inline

Definition at line 50 of file undo_manager.hpp.

◆ ~CUndoManager()

virtual CUndoManager::~CUndoManager ( )
inlinevirtual

Definition at line 52 of file undo_manager.hpp.

Member Function Documentation

◆ CanRedo()

bool CUndoManager::CanRedo ( )
virtual

Implements IUndoManager.

Definition at line 183 of file undo_manager.cpp.

References m_RedoBuffer.

Referenced by CProjectView::CanRedo().

◆ CanUndo()

bool CUndoManager::CanUndo ( )
virtual

Implements IUndoManager.

Definition at line 178 of file undo_manager.cpp.

References m_UndoBuffer.

Referenced by CProjectView::CanUndo().

◆ Execute()

void CUndoManager::Execute ( IEditCommand command,
wxWindow *  window = 0 
)
virtual

◆ ExecuteLock()

bool CUndoManager::ExecuteLock ( )
virtual

Implements ICommandProccessor.

Definition at line 238 of file undo_manager.cpp.

References m_LockCounter, and m_RWMutex.

◆ ExecuteUnlock()

void CUndoManager::ExecuteUnlock ( )
virtual

Implements ICommandProccessor.

Definition at line 248 of file undo_manager.cpp.

References _ASSERT, m_LockCounter, and m_RWMutex.

◆ GetRedoLabel()

string CUndoManager::GetRedoLabel ( )
virtual

Implements IUndoManager.

Definition at line 194 of file undo_manager.cpp.

References _ASSERT, and m_RedoBuffer.

◆ GetUndoLabel()

string CUndoManager::GetUndoLabel ( )
virtual

Implements IUndoManager.

Definition at line 188 of file undo_manager.cpp.

References _ASSERT, and m_UndoBuffer.

◆ Redo()

void CUndoManager::Redo ( wxWindow *  window = 0)
virtual

◆ ReleaseExclusiveEdit()

bool CUndoManager::ReleaseExclusiveEdit ( wxWindow *  window)
virtual

Implements IUndoManager.

Definition at line 305 of file undo_manager.cpp.

References m_ExclusiveDescr, and m_ExclusiveEdit.

◆ RequestExclusiveEdit()

bool CUndoManager::RequestExclusiveEdit ( wxWindow *  window,
const string descr 
)
virtual

Implements IUndoManager.

Definition at line 292 of file undo_manager.cpp.

References m_ExclusiveDescr, m_ExclusiveEdit, and x_ShowExclusiveEditDlg().

◆ Reset()

void CUndoManager::Reset ( void  )

Definition at line 200 of file undo_manager.cpp.

References m_RedoBuffer, and m_UndoBuffer.

Referenced by CLocalFileRestorer::RestoreFile().

◆ ShowErrorMsg()

void CUndoManager::ShowErrorMsg ( IEditCommand pCommand,
const string errMsg 
)
protected

Definition at line 206 of file undo_manager.cpp.

References Error(), IEditCommand::GetLabel(), LOG_POST, and msg().

Referenced by Execute(), Redo(), and Undo().

◆ Undo()

void CUndoManager::Undo ( wxWindow *  window = 0)
virtual

◆ x_LockDocument()

bool CUndoManager::x_LockDocument ( )
protected

Definition at line 276 of file undo_manager.cpp.

References NULL, and x_WriteLock().

Referenced by Execute(), Redo(), and Undo().

◆ x_SendChangedEvent()

void CUndoManager::x_SendChangedEvent ( )
protected

Definition at line 230 of file undo_manager.cpp.

References CProjectViewEvent::eData, m_Document, and CGBDocument::x_FireProjectChanged().

Referenced by Execute(), Redo(), and Undo().

◆ x_SendChangingEvent()

void CUndoManager::x_SendChangingEvent ( )
protected

◆ x_ShowExclusiveEditDlg()

void CUndoManager::x_ShowExclusiveEditDlg ( )
protected

◆ x_WriteLock()

bool CUndoManager::x_WriteLock ( )
protected

Definition at line 258 of file undo_manager.cpp.

References m_LockCounter, and m_RWMutex.

Referenced by x_LockDocument().

Member Data Documentation

◆ m_Document

CGBDocument* CUndoManager::m_Document
protected

Definition at line 94 of file undo_manager.hpp.

Referenced by x_SendChangedEvent(), and x_SendChangingEvent().

◆ m_ExclusiveDescr

string CUndoManager::m_ExclusiveDescr
protected

◆ m_ExclusiveEdit

wxWindow* CUndoManager::m_ExclusiveEdit
protected

◆ m_LockCounter

int CUndoManager::m_LockCounter
protected

◆ m_MaxBufferSize

size_t CUndoManager::m_MaxBufferSize
protected

Definition at line 95 of file undo_manager.hpp.

Referenced by Execute().

◆ m_RedoBuffer

TCommands CUndoManager::m_RedoBuffer
protected

Definition at line 93 of file undo_manager.hpp.

Referenced by CanRedo(), Execute(), GetRedoLabel(), Redo(), Reset(), and Undo().

◆ m_RWMutex

CFastMutex CUndoManager::m_RWMutex
protected

◆ m_UndoBuffer

TCommands CUndoManager::m_UndoBuffer
protected

Definition at line 92 of file undo_manager.hpp.

Referenced by CanUndo(), Execute(), GetUndoLabel(), Redo(), Reset(), and Undo().


The documentation for this class was generated from the following files:
Modified on Fri Sep 20 14:57:32 2024 by modify_doxy.py rev. 669887