Sourceforge.net - The VCF's Project Host
   The VCF Website Home   |   Online Discussion Forums   |   Sourceforge.net Project Page   

VCF::DocumentManager Class Reference

The DocumentManager manages the interaction between the application (and any other UI classes) and a collection of one or more documents. More...

#include <vcf/ApplicationKit/DocumentManager.h>

Inheritance diagram for VCF::DocumentManager:

VCF::DocumentManagerImpl< AppClass, DocInterfacePolicy > VCF::DocumentManagerImpl< DocumentBasedApplication< DocInterfacePolicy >, DocInterfacePolicy > VCF::DocumentBasedApplication< DocInterfacePolicy > List of all members.

Public Types

enum  {
  dmSaveDocument = 1000, dmOpenDocument, dmNewDocument, dmCloseDocument,
  dmDocumentInitialized, dmCurrentDocumentChanged
}
 events types. More...
enum  ActionTag {
  atFileNew = 1, atFileOpen, atFileClose, atFileSave,
  atFileSaveAs, atEditUndo = 100, atEditRedo, atEditCut,
  atEditCopy, atEditPaste, atEditPreferences, atLast
}

Public Member Functions

 DocumentManager ()
virtual ~DocumentManager ()
virtual void init ()
 inizialization function for document based applications.
virtual void terminate ()
 termination function for document based applications.
virtual DocumentgetCurrentDocument ()
 gets the current document.
virtual void setCurrentDocument (Document *newCurrentDocument)
 sets the new current document.
bool saveDocument (Document *doc)
 saves the specified document.
virtual bool saveFile (Document *document)
 save a document into a file.
virtual bool saveFileAs (Document *document, const String &newFileName=L"")
 save a document into a file.
virtual DocumentopenFromFileName (const String &fileName)
 opens a document instance from a file.
virtual void openFile ()
 opens a file.
virtual void closeCurrentDocument ()
 close the current ( active ) document.
virtual void reloadDocument (Document *document, const bool &keepPosition=true)
 reloads from the hard drive the file for an existing document.
void currentDocumentChanged ()
 this method is called to notify the application has changed its active document, child or not.
virtual void newDocument ()
 creates a new document.
virtual DocumentnewDefaultDocument (const String &fileName, const MIMEType &mimetype)
 creates a new default document.
virtual DocumentcreateDocumentFromType (const DocumentInfo &info)
 creates a new document with specified Document infos.
virtual ModelcreateModelFromType (const DocumentInfo &info)
virtual WindowgetWindowForNewDocument (Document *document, const DocumentInfo &info)
 gets the appropriate window to be associated to a new document.
void addDocumentInfo (const MIMEType &mimeType, const DocumentInfo &info)
 there is an internal association map between a mimeType and the DocumentInfo this function adds an item to this map.
Enumerator< DocumentInfo > * getRegisteredDocumentInfo ()
 gets a pointer to the enumerator of all the registered DocumentInfo(s).
DocumentInfo getDocumentInfo (const MIMEType &mimeType)
 gets the DocumentInfo of a document from its mime type only.
MIMEType getMimeTypeFromFileExtension (const String &fileName)
 gets the mime type of a document from the extension of its associated file.
virtual void setNewView (const DocumentInfo &info, View *view, Window *window, Document *newDocument)
 sets a specified view for a specified new document.
virtual void editPreferences ()
 preferences support.
bool getShouldCreateUI ()
 tells if our Document manager is expected to have (create) a User Interface.
void setShouldCreateUI (bool val)
 states if our Document manager should create a User Interface.
virtual void attachUIToDocument (const String &mimeType, Document *document)
 attaches a document specific User Interface to a document.
Enumerator< Document * > * getOpenedDocuments ()
 gets a pointer to an enumerator of all the opened documents in the application.
virtual void createMenus ()
 creates the menus associated to our document based application.
virtual void initializeWindowMenus (Window *window, Document *document, const DocumentInfo &info)
 initializes the menu for the window associated to a document.
ActiongetAction (uint32 tag)
 gets the action associated to an action tag, as specified by this document manager.
virtual void cutFromDocument (Document *doc)
 performs a cut operation on the document, if the document allows for it.
virtual void copyFromDocument (Document *doc)
 performs a copy operation on the document, if the document allows for it.
virtual void pasteToDocument (Document *doc)
 performs a paste operation on the document, if the document allows for it.
virtual void undoForDocument (Document *doc)
 performs an undo operation on the document.
virtual void redoForDocument (Document *doc)
 performs a redo operation on the document.
void undo ()
 performs an undo operation using the shared undo-redo stack
void redo ()
 performs a redo operation using the shared undo-redo stack
UndoRedoStackgetUndoRedoStack (Document *doc)
 gets the undo-redo stack associated with a document.
UndoRedoStackgetUndoRedoStack (Model *model)
UndoRedoStackgetSharedUndoRedoStack ()
 Returns the shared undo-redo stack for the document manager.
void linkDocumentToModel (Document *document, Model *model)
void unlinkDocumentToModel (Document *document)
DocumentgetDocument (Model *model)
ModelgetModel (Document *document)
void addDropTarget (DropTarget *dropTarget)
void cleanupDropTarget (Document *doc)
void addDocument (Document *document)
 called to add a document to the document based application
void removeDocument (Document *document)
 called to remove a document from the document based application
void openFromCommandLine (const CommandLine &comdLine)

Static Public Member Functions

static DocumentManagergetDocumentManager ()
 gives the current document manager instance.

Public Attributes

VCF::Delegate DocManagerDelegate
 SaveFile
 OpenFile
DocumentInitialized VCF::Delegate DocManagerDelegate
DocumentClosed VCF::Delegate DocManagerDelegate

Protected Types

typedef std::map< String,
DocumentInfo
DocumentInfoMap
typedef std::map< Document *,
UndoRedoStack * > 
DocumentUndoRedoMap
typedef std::map< uint32,
Action * > 
ActionMap
typedef std::map< Document *,
Model * > 
DocumentModelMap

Protected Member Functions

DocumentInfogetDocumentInfo (Document *doc)
 gives the document info associated to the document this implementation uses the VCF RTTI for this document.
virtual void prepareOpenDialog (CommonFileOpenDialog *openDialog)
 called to prepare a file open dialog
virtual void openDialogFinished (CommonFileOpenDialog *openDialog)
 called after the file open dialog has been closed by the user and confirmed Ok
virtual void prepareSaveDialog (CommonFileSaveDialog *saveDialog, Document *doc)
 called to prepare a file save dialog
virtual void saveDialogFinished (CommonFileSaveDialog *saveDialog)
 called after the file save dialog has been closed by the user and confirmed Ok
virtual void updateSave (ActionEvent *event, Document *doc)
 called when this target gets notified for update events of the UI of a save operation
virtual void updateSaveAs (ActionEvent *event, Document *doc)
 called when this target gets notified for update events of the UI of a saveAs operation
virtual void updateClose (ActionEvent *event, Document *doc)
 called when this target gets notified for update events of the UI of a close operation
virtual void updateCut (ActionEvent *event, Document *doc)
 called when this target gets notified for update events of the UI of a cut operation
virtual void updateCopy (ActionEvent *event, Document *doc)
 called when this target gets notified for update events of the UI of a copy operation
virtual void updatePaste (ActionEvent *event, Document *doc)
 called when this target gets notified for update events of the UI of a paste operation
virtual void updateUndo (ActionEvent *event, Document *doc)
 called when this target gets notified for update events of the UI of a undo operation
virtual void updateRedo (ActionEvent *event, Document *doc)
 called when this target gets notified for update events of the UI of a redo operation
void removeUndoRedoStackForDocument (Document *doc)
 removes the undo redo stack from the specified document
virtual UIToolkit::ModalReturnType saveChanges (Document *document)
 called to save the changes done on a specified document
void addAction (uint32 tag, Action *action)
 add an action to the internal action map
void onDocWndEntered (DropTargetEvent *e)
void onDocWndDragging (DropTargetEvent *e)
void onDocWndDropped (DropTargetEvent *e)

Protected Attributes

DocumentInfoMap docInfo_
 The map of all registered DocumentInfo(s).
EnumeratorMapContainer< DocumentInfoMap,
DocumentInfo
docInfoContainer_
Array< Document * > openDocuments_
 The list of all the opened document at this moment.
bool shouldCreateUI_
 this DocumentManager has a User Interface
ActionMap actionsMap_
 the map of all actions and their associated tags according to our document manager
DocumentUndoRedoMap undoRedoStack_
 the map of all undo redo stack associated to each document
DocumentModelMap docModelMap_
std::vector< DropTarget * > dropTargets_
DocumentcurrentDragDocument_

Static Protected Attributes

static DocumentManagerdocManagerInstance
 the only document manager instance for the application

Detailed Description

The DocumentManager manages the interaction between the application (and any other UI classes) and a collection of one or more documents.

A DocumentBasedApplication inherits from this class and from a DocInterfacePolicy The DocInterfacePolicy is the template argument class that specifies how the DocumentManager is supposed to manage the collection (of one or more) documents. The member functions of this DocumentManager class are very general and common to any kind document manager interface, and so it contributes to define the Document Interface pattern itself. The DocumentManager allows only for a single instance, which you can get at by calling the static method DocumentManager::getDocumentManager().

Event Delegates for this class:


Member Typedef Documentation

typedef std::map< uint32, Action* > VCF::DocumentManager::ActionMap [protected]
 

typedef std::map<String,DocumentInfo> VCF::DocumentManager::DocumentInfoMap [protected]
 

typedef std::map<Document*,Model*> VCF::DocumentManager::DocumentModelMap [protected]
 

typedef std::map<Document*,UndoRedoStack*> VCF::DocumentManager::DocumentUndoRedoMap [protected]
 


Member Enumeration Documentation

anonymous enum
 

events types.

See the DELEGATEs of this class.

Enumerator:
dmSaveDocument 
dmOpenDocument 
dmNewDocument 
dmCloseDocument 
dmDocumentInitialized 
dmCurrentDocumentChanged 

enum VCF::DocumentManager::ActionTag
 

Enumerator:
atFileNew 
atFileOpen 
atFileClose 
atFileSave 
atFileSaveAs 
atEditUndo 
atEditRedo 
atEditCut 
atEditCopy 
atEditPaste 
atEditPreferences 
atLast 


Constructor & Destructor Documentation

VCF::DocumentManager::DocumentManager  ) 
 

virtual VCF::DocumentManager::~DocumentManager  )  [virtual]
 


Member Function Documentation

void VCF::DocumentManager::addAction uint32  tag,
Action action
[protected]
 

add an action to the internal action map

void VCF::DocumentManager::addDocument Document document  ) 
 

called to add a document to the document based application

void VCF::DocumentManager::addDocumentInfo const MIMEType mimeType,
const DocumentInfo info
 

there is an internal association map between a mimeType and the DocumentInfo this function adds an item to this map.

Parameters:
const String&, the mime type.
const DocumentInfo& info, the DocumentInfo.

void VCF::DocumentManager::addDropTarget DropTarget dropTarget  ) 
 

virtual void VCF::DocumentManager::attachUIToDocument const String mimeType,
Document document
[inline, virtual]
 

attaches a document specific User Interface to a document.

using the appropriate DocumentInfo extracted from the mimeType. The basic functionality is empty. The real implementation is dependent on the policy.

Reimplemented in VCF::DocumentManagerImpl< AppClass, DocInterfacePolicy >, and VCF::DocumentManagerImpl< DocumentBasedApplication< DocInterfacePolicy >, DocInterfacePolicy >.

void VCF::DocumentManager::cleanupDropTarget Document doc  ) 
 

virtual void VCF::DocumentManager::closeCurrentDocument  )  [inline, virtual]
 

close the current ( active ) document.

The basic functionality is empty. The real implementation is dependent on the policy.

Reimplemented in VCF::DocumentManagerImpl< AppClass, DocInterfacePolicy >, and VCF::DocumentManagerImpl< DocumentBasedApplication< DocInterfacePolicy >, DocInterfacePolicy >.

virtual void VCF::DocumentManager::copyFromDocument Document doc  )  [virtual]
 

performs a copy operation on the document, if the document allows for it.

Parameters:
Document* doc, the document.

virtual Document* VCF::DocumentManager::createDocumentFromType const DocumentInfo info  )  [inline, virtual]
 

creates a new document with specified Document infos.

The basic functionality is empty. The real implementation is dependent on the policy.

Parameters:
const DocumentInfo& info, the characteristic infos of the document to be created.
Returns:
Document*, the newly created document.

Reimplemented in VCF::DocumentManagerImpl< AppClass, DocInterfacePolicy >, and VCF::DocumentManagerImpl< DocumentBasedApplication< DocInterfacePolicy >, DocInterfacePolicy >.

virtual void VCF::DocumentManager::createMenus  )  [inline, virtual]
 

creates the menus associated to our document based application.

The basic functionality is empty. The real implementation is dependent on the policy.

Reimplemented in VCF::DocumentManagerImpl< AppClass, DocInterfacePolicy >, and VCF::DocumentManagerImpl< DocumentBasedApplication< DocInterfacePolicy >, DocInterfacePolicy >.

virtual Model* VCF::DocumentManager::createModelFromType const DocumentInfo info  )  [inline, virtual]
 

Reimplemented in VCF::DocumentManagerImpl< AppClass, DocInterfacePolicy >, and VCF::DocumentManagerImpl< DocumentBasedApplication< DocInterfacePolicy >, DocInterfacePolicy >.

void VCF::DocumentManager::currentDocumentChanged  )  [inline]
 

this method is called to notify the application has changed its active document, child or not.

virtual void VCF::DocumentManager::cutFromDocument Document doc  )  [virtual]
 

performs a cut operation on the document, if the document allows for it.

Parameters:
Document* doc, the document.

virtual void VCF::DocumentManager::editPreferences  )  [inline, virtual]
 

preferences support.

performs any editing operation on the application's preferences. The basic functionality is empty. Override this to implement one.

Action* VCF::DocumentManager::getAction uint32  tag  ) 
 

gets the action associated to an action tag, as specified by this document manager.

Parameters:
ActionTag,the action's tag.
Returns:
Action*, the pointer to the associated action.
See also:
Action

virtual Document* VCF::DocumentManager::getCurrentDocument  )  [inline, virtual]
 

gets the current document.

The current document is the document having the focus, so to speak. It is also called the active document, as the default operations are performed on this one. The basic functionality is empty. The real implementation is dependent on the policy.

Returns:
Document*, the currently active document.

Reimplemented in VCF::DocumentManagerImpl< AppClass, DocInterfacePolicy >, and VCF::DocumentManagerImpl< DocumentBasedApplication< DocInterfacePolicy >, DocInterfacePolicy >.

Document* VCF::DocumentManager::getDocument Model model  ) 
 

DocumentInfo* VCF::DocumentManager::getDocumentInfo Document doc  )  [protected]
 

gives the document info associated to the document this implementation uses the VCF RTTI for this document.

DocumentInfo VCF::DocumentManager::getDocumentInfo const MIMEType mimeType  ) 
 

gets the DocumentInfo of a document from its mime type only.

Parameters:
const String&, the mime type.
Returns:
DocumentInfo, the document infos.

static DocumentManager* VCF::DocumentManager::getDocumentManager  )  [static]
 

gives the current document manager instance.

This is a singleton, so this function is static.

Returns:
DocumentManager*, a pointer to the only DocumentManager for the application.

MIMEType VCF::DocumentManager::getMimeTypeFromFileExtension const String fileName  ) 
 

gets the mime type of a document from the extension of its associated file.

Parameters:
const String&, the filename.
Returns:
String, the mime type.

Model* VCF::DocumentManager::getModel Document document  ) 
 

Enumerator<Document*>* VCF::DocumentManager::getOpenedDocuments  ) 
 

gets a pointer to an enumerator of all the opened documents in the application.

Returns:
Enumerator<Document*>* , the pointer to this enumerator.

Enumerator<DocumentInfo>* VCF::DocumentManager::getRegisteredDocumentInfo  ) 
 

gets a pointer to the enumerator of all the registered DocumentInfo(s).

Parameters:
Enumerator<DocumentInfo>*,the pointer to this enumerator.

UndoRedoStack& VCF::DocumentManager::getSharedUndoRedoStack  )  [inline]
 

Returns the shared undo-redo stack for the document manager.

Returns:
UndoRedoStack&, a reference to the document's stack.
See also:
getUndoRedoStack()

bool VCF::DocumentManager::getShouldCreateUI  )  [inline]
 

tells if our Document manager is expected to have (create) a User Interface.

Returns:
bool, true if it does.

UndoRedoStack& VCF::DocumentManager::getUndoRedoStack Model model  ) 
 

UndoRedoStack& VCF::DocumentManager::getUndoRedoStack Document doc  ) 
 

gets the undo-redo stack associated with a document.

Parameters:
Document* doc, the document. If this is NULL then the function returns the default undo-redo stack, that is "global" and not specific to a particular document.
Returns:
UndoRedoStack&, a reference to the document's stack.

virtual Window* VCF::DocumentManager::getWindowForNewDocument Document document,
const DocumentInfo info
[inline, virtual]
 

gets the appropriate window to be associated to a new document.

The standard implementation of a Document Interface is a one to one relationship between documents and windows. The basic functionality is empty. The real implementation is dependent on the policy, as this is depending on the type of Document Interface.

Parameters:
const Document* doc, the document.
const DocumentInfo& info, the DocInfo to create the window from if necessary.
Returns:
Window*, the window to be associated with the document.

Reimplemented in VCF::DocumentManagerImpl< AppClass, DocInterfacePolicy >, and VCF::DocumentManagerImpl< DocumentBasedApplication< DocInterfacePolicy >, DocInterfacePolicy >.

virtual void VCF::DocumentManager::init  )  [virtual]
 

inizialization function for document based applications.

This is called just after Application::initRunningApplication().

Reimplemented in VCF::DocumentManagerImpl< AppClass, DocInterfacePolicy >, and VCF::DocumentManagerImpl< DocumentBasedApplication< DocInterfacePolicy >, DocInterfacePolicy >.

virtual void VCF::DocumentManager::initializeWindowMenus Window window,
Document document,
const DocumentInfo info
[inline, virtual]
 

initializes the menu for the window associated to a document.

The DocumentInfo is also specified. The basic functionality is empty. The real implementation is dependent on the policy.

Parameters:
DocumentInfo& info, the DocumentInfo.
Window* window, the window.
Document* document, the document.

Reimplemented in VCF::DocumentManagerImpl< AppClass, DocInterfacePolicy >, and VCF::DocumentManagerImpl< DocumentBasedApplication< DocInterfacePolicy >, DocInterfacePolicy >.

void VCF::DocumentManager::linkDocumentToModel Document document,
Model model
 

virtual Document* VCF::DocumentManager::newDefaultDocument const String fileName,
const MIMEType mimetype
[inline, virtual]
 

creates a new default document.

The mimetype of the document to be opened can be optionally specified. The basic functionality is empty. The real implementation is dependent on the policy.

Parameters:
const String& mimetype, the mime type. Default is an empty String, as this function will be called only from a SDI policy. in which case the only registered DocumentInfo is used to open the document.
Returns:
Document*, the newly created document.

Reimplemented in VCF::DocumentManagerImpl< AppClass, DocInterfacePolicy >, and VCF::DocumentManagerImpl< DocumentBasedApplication< DocInterfacePolicy >, DocInterfacePolicy >.

virtual void VCF::DocumentManager::newDocument  )  [inline, virtual]
 

creates a new document.

The default implementation is to create a default document as this is what happens in a SDI policy ( where only one DocumentInfo has been registered into this DocumentManager). By overriding this function the user could change this default implementation and open an appropriate New File dialog.

void VCF::DocumentManager::onDocWndDragging DropTargetEvent e  )  [protected]
 

void VCF::DocumentManager::onDocWndDropped DropTargetEvent e  )  [protected]
 

void VCF::DocumentManager::onDocWndEntered DropTargetEvent e  )  [protected]
 

virtual void VCF::DocumentManager::openDialogFinished CommonFileOpenDialog openDialog  )  [inline, protected, virtual]
 

called after the file open dialog has been closed by the user and confirmed Ok

virtual void VCF::DocumentManager::openFile  )  [inline, virtual]
 

opens a file.

The basic functionality is empty. The real implementation is dependent on the policy.

Reimplemented in VCF::DocumentManagerImpl< AppClass, DocInterfacePolicy >, and VCF::DocumentManagerImpl< DocumentBasedApplication< DocInterfacePolicy >, DocInterfacePolicy >.

void VCF::DocumentManager::openFromCommandLine const CommandLine comdLine  ) 
 

virtual Document* VCF::DocumentManager::openFromFileName const String fileName  )  [virtual]
 

opens a document instance from a file.

the mime type identifying the document is extracted from the file extension stored with all the DocumentInfo(s) registered to the manager. Afterward creating/opening the document, the file is actually loaded too.

Parameters:
const String&, the filename.
Returns:
Document*, the opened document.
See also:
DocumentManager::getMimeTypeFromFileExtension()

Document::openFromType()

virtual void VCF::DocumentManager::pasteToDocument Document doc  )  [virtual]
 

performs a paste operation on the document, if the document allows for it.

Parameters:
Document* doc, the document.

virtual void VCF::DocumentManager::prepareOpenDialog CommonFileOpenDialog openDialog  )  [protected, virtual]
 

called to prepare a file open dialog

virtual void VCF::DocumentManager::prepareSaveDialog CommonFileSaveDialog saveDialog,
Document doc
[protected, virtual]
 

called to prepare a file save dialog

void VCF::DocumentManager::redo  ) 
 

performs a redo operation using the shared undo-redo stack

virtual void VCF::DocumentManager::redoForDocument Document doc  )  [virtual]
 

performs a redo operation on the document.

Parameters:
Document* doc, the document.

virtual void VCF::DocumentManager::reloadDocument Document document,
const bool &  keepPosition = true
[inline, virtual]
 

reloads from the hard drive the file for an existing document.

The basic functionality is empty. The real implementation is dependent on the policy.

Parameters:
Document* doc, the document whose file needs to be reloaded.
const bool& keepPosition, true to reopen the file in the same position as before. The default is true.

Reimplemented in VCF::DocumentManagerImpl< AppClass, DocInterfacePolicy >, and VCF::DocumentManagerImpl< DocumentBasedApplication< DocInterfacePolicy >, DocInterfacePolicy >.

void VCF::DocumentManager::removeDocument Document document  ) 
 

called to remove a document from the document based application

void VCF::DocumentManager::removeUndoRedoStackForDocument Document doc  )  [protected]
 

removes the undo redo stack from the specified document

virtual UIToolkit::ModalReturnType VCF::DocumentManager::saveChanges Document document  )  [protected, virtual]
 

called to save the changes done on a specified document

virtual void VCF::DocumentManager::saveDialogFinished CommonFileSaveDialog saveDialog  )  [inline, protected, virtual]
 

called after the file save dialog has been closed by the user and confirmed Ok

bool VCF::DocumentManager::saveDocument Document doc  ) 
 

saves the specified document.

Parameters:
Document* doc, the document.

virtual bool VCF::DocumentManager::saveFile Document document  )  [inline, virtual]
 

save a document into a file.

The basic functionality is empty. The real implementation is dependent on the policy.

Parameters:
Document* doc, the document.
Returns:
bool, true if the operation completed successfully.

Reimplemented in VCF::DocumentManagerImpl< AppClass, DocInterfacePolicy >, and VCF::DocumentManagerImpl< DocumentBasedApplication< DocInterfacePolicy >, DocInterfacePolicy >.

virtual bool VCF::DocumentManager::saveFileAs Document document,
const String newFileName = L""
[inline, virtual]
 

save a document into a file.

The basic functionality is empty. The real implementation is dependent on the policy.

Parameters:
Document* doc, the document.
const String& newFileName, the new destination filename. By default it is empty so the user is prompted with a dialog.
Returns:
bool, true if the operation completed successfully.

Reimplemented in VCF::DocumentManagerImpl< AppClass, DocInterfacePolicy >, and VCF::DocumentManagerImpl< DocumentBasedApplication< DocInterfacePolicy >, DocInterfacePolicy >.

virtual void VCF::DocumentManager::setCurrentDocument Document newCurrentDocument  )  [inline, virtual]
 

sets the new current document.

The basic functionality is empty. The real implementation is dependent on the policy.

Parameters:
Document*,the document that we want to be active.

Reimplemented in VCF::DocumentManagerImpl< AppClass, DocInterfacePolicy >, and VCF::DocumentManagerImpl< DocumentBasedApplication< DocInterfacePolicy >, DocInterfacePolicy >.

virtual void VCF::DocumentManager::setNewView const DocumentInfo info,
View view,
Window window,
Document newDocument
[inline, virtual]
 

sets a specified view for a specified new document.

In this default implementation the window, previously 'assigned' to the document, becomes the view itself. The DocumentInfo is also specified because in alternative implementations we may need to decide to select which view will be associated to the document: the window could be the view itself or the control hosting the view instead.

Parameters:
DocumentInfo& info, the DocumentInfo.
View* view, the specified view.
Window* window, the window.
Document* newDocument, the new document.

void VCF::DocumentManager::setShouldCreateUI bool  val  )  [inline]
 

states if our Document manager should create a User Interface.

Parameters:
bool,true if we want to have it.

virtual void VCF::DocumentManager::terminate  )  [virtual]
 

termination function for document based applications.

This is called just before Application::terminateRunningApplication().

void VCF::DocumentManager::undo  ) 
 

performs an undo operation using the shared undo-redo stack

virtual void VCF::DocumentManager::undoForDocument Document doc  )  [virtual]
 

performs an undo operation on the document.

Parameters:
Document* doc, the document.

void VCF::DocumentManager::unlinkDocumentToModel Document document  ) 
 

virtual void VCF::DocumentManager::updateClose ActionEvent event,
Document doc
[protected, virtual]
 

called when this target gets notified for update events of the UI of a close operation

virtual void VCF::DocumentManager::updateCopy ActionEvent event,
Document doc
[protected, virtual]
 

called when this target gets notified for update events of the UI of a copy operation

virtual void VCF::DocumentManager::updateCut ActionEvent event,
Document doc
[protected, virtual]
 

called when this target gets notified for update events of the UI of a cut operation

virtual void VCF::DocumentManager::updatePaste ActionEvent event,
Document doc
[protected, virtual]
 

called when this target gets notified for update events of the UI of a paste operation

virtual void VCF::DocumentManager::updateRedo ActionEvent event,
Document doc
[protected, virtual]
 

called when this target gets notified for update events of the UI of a redo operation

virtual void VCF::DocumentManager::updateSave ActionEvent event,
Document doc
[protected, virtual]
 

called when this target gets notified for update events of the UI of a save operation

virtual void VCF::DocumentManager::updateSaveAs ActionEvent event,
Document doc
[protected, virtual]
 

called when this target gets notified for update events of the UI of a saveAs operation

virtual void VCF::DocumentManager::updateUndo ActionEvent event,
Document doc
[protected, virtual]
 

called when this target gets notified for update events of the UI of a undo operation


Member Data Documentation

ActionMap VCF::DocumentManager::actionsMap_ [protected]
 

the map of all actions and their associated tags according to our document manager

Document* VCF::DocumentManager::currentDragDocument_ [protected]
 

DocumentInfoMap VCF::DocumentManager::docInfo_ [protected]
 

The map of all registered DocumentInfo(s).

EnumeratorMapContainer< DocumentInfoMap, DocumentInfo > VCF::DocumentManager::docInfoContainer_ [protected]
 

DocumentClosed VCF::Delegate VCF::DocumentManager::DocManagerDelegate
 

Event Delegate:
CurrentDocumentChanged this is fired whenever the currentDocumentChanged() method is called, to motify that the application has changed its active document. It is the responsibility of the DocInterfacePolicy to call the currentDocumentChanged() method when appropriate. An event fired from this delegate causes the UI to be notified of any changes on any document so it can choose to display them or else.
event class: VCF::Event
event type: DocumentManager::dmCurrentDocumentChanged

DocumentInitialized VCF::Delegate VCF::DocumentManager::DocManagerDelegate
 

Event Delegate:
DocumentClosed this fires to notify the user it is the time to close the document. It is up to the implementer to add an event handler to this delegate so to handle how to close the document and destroy it.
event class: VCF::Event
event type: DocumentManager::dmCloseDocument

VCF::Delegate VCF::DocumentManager::DocManagerDelegate
 

Event Delegate:
SaveFile this is called when the document manager's saveFile() method is called from the UI. It implements the way used to bypass the normal behaviour of the document manager's saveFile() method itself. It is effective only if a DocManagerEvent event handler is added to this delegate and setAllowFileOperation( false ) is called from the handler.
event class: VCF::DocManagerEvent
event type: DocumentManager::dmSaveDocument
See also:
saveFile()

DocumentManager* VCF::DocumentManager::docManagerInstance [static, protected]
 

the only document manager instance for the application

DocumentModelMap VCF::DocumentManager::docModelMap_ [protected]
 

std::vector<DropTarget*> VCF::DocumentManager::dropTargets_ [protected]
 

Array<Document*> VCF::DocumentManager::openDocuments_ [protected]
 

The list of all the opened document at this moment.

VCF::DocumentManager::OpenFile
 

VCF::DocumentManager::SaveFile
 

bool VCF::DocumentManager::shouldCreateUI_ [protected]
 

this DocumentManager has a User Interface

DocumentUndoRedoMap VCF::DocumentManager::undoRedoStack_ [protected]
 

the map of all undo redo stack associated to each document


The documentation for this class was generated from the following file:
   Comments or Suggestions?    License Information