Main Page | Modules | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

CP_DocumentManager Class Reference

Singleton class to manage all open document objects.

Inheritance diagram for CP_DocumentManager:

CP_NoCopy List of all members.

Public Member Functions

void CloseEach ()
Constructor / Destructor
 CP_DocumentManager ()
 Constructor.
virtual ~CP_DocumentManager ()
 Destructor.
Commands
bool CloseAll ()
bool CloseAllNoSave ()
Document List
UInt32 Count ()
void Append (CP_Document_Base *inDocument)
void Remove (CP_Document_Base *inDocument)
CP_Document_BaseGetNthDocument (SInt32 inIndex)
CP_Documents_ListGetDocumentsList ()

Static Public Member Functions

Instance
static CP_DocumentManagerInstance ()

Protected Member Functions

CP_AskReviewDialogGetAskReviewDialog (UInt32 inNumberDocuments)

Protected Attributes

CP_Documents_ListfDocuments
bool fCloseAllInProgress

Static Protected Attributes

static CP_DocumentManagerfsInstance = NULL

Constructor & Destructor Documentation

CP_DocumentManager::CP_DocumentManager  ) 
 

Constructor.

CP_DocumentManager::~CP_DocumentManager  )  [virtual]
 

Destructor.


Member Function Documentation

CP_DocumentManager * CP_DocumentManager::Instance  )  [static]
 

bool CP_DocumentManager::CloseAll  ) 
 

Ask all documents in this classes list to close themselves. Under OSX this class will not be able to immediately close the documents if they are asking the user to save information in sheets. However, after the last document is closed this will automatically be called again, this time it will be able to return true.

If the user also cancels a save or causes the document to not remove its dirty status and return false when it is asked if the document can close itself, then this will not be able to close all of the documents.

Returns:
bool Returns true only if all documents were able to close themselves, otherwise false is returned, indicating that the user choose not to close a document.

bool CP_DocumentManager::CloseAllNoSave  ) 
 

UInt32 CP_DocumentManager::Count  ) 
 

Returns the number of documents managed by this class.

Returns:
UInt32 Number of documents managed by this class.

void CP_DocumentManager::Append CP_Document_Base inDocument  ) 
 

Adds the passed in CP_Document_Base to the list of documents managed by this class. This will only add the document if it is not currently in the list of known documents for this object. So it is safe to call with the same document more than once. You normally do not need to call this, as it is called in the documents constructor.

Parameters:
inDocument A CP_Document_Base to add to list of known documents.
Returns:
void

void CP_DocumentManager::Remove CP_Document_Base inDocument  ) 
 

Remove a document from this list. This is called for you automatically when a CP_Document_Base is deleted. A std::runtime_error is thrown if the document is not in the list. You normally do not need to call this, as it is called in the documents destructor.

Parameters:
inDocument A CP_Document_Base to remove from this list.
Exceptions:
OSError exceptions.
Returns:
void

CP_Document_Base * CP_DocumentManager::GetNthDocument SInt32  inIndex  ) 
 

CP_Documents_List* CP_DocumentManager::GetDocumentsList  ) 
 

Returns the list of documents managed by this class.

Exceptions:
none 
Returns:
CP_Documents_List The list of documents managed by this class.

void CP_DocumentManager::CloseEach  ) 
 

CP_AskReviewDialog * CP_DocumentManager::GetAskReviewDialog UInt32  inNumberDocuments  )  [protected]
 


Member Data Documentation

CPLAT_Begin_Namespace_CPLAT CP_DocumentManager * CP_DocumentManager::fsInstance = NULL [static, protected]
 

CP_Documents_List* CP_DocumentManager::fDocuments [protected]
 

bool CP_DocumentManager::fCloseAllInProgress [protected]
 

List of all documents.


The documentation for this class was generated from the following files:
Generated on Sat Sep 17 20:01:30 2005 for CPLAT by  doxygen 1.4.0