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

VCF::DocManagerEvent Class Reference

class DocManagerEvent More...

#include <vcf/ApplicationKit/DocumentManager.h>

Inheritance diagram for VCF::DocManagerEvent:

VCF::Event VCF::Object List of all members.

Public Member Functions

 DocManagerEvent (Object *source, uint32 type)
bool allowFileOperation ()
 tells if we want to allow the DocumentManager to perform the standard file operation that he has been requested.
void setAllowFileOperation (const bool &val)
 sets this flag as false from the event handler in order in order to make the manager aware that an alternative way, implemented by the handler, is preferred.
bool getFileOperationStatus ()
 gets the status of a file operation after the event handler has been executed
void setFileOperationStatus (const bool &val)
 sets the status of a file operation from the event handler.

Protected Attributes

bool allowFileOp_
bool fileOperationStatus_

Detailed Description

class DocManagerEvent

while a normal event is appropriated to notify the user interface that a file operation has been performed on a document, a user will need this special kind of event if he needs to bypass a standard operation on documents as normally execute by the DocumentManager. Even if the DocumentManager is already very flexible, this let the user to have a comlete control in some case he may need ( very unfrequent though ).

This how this mechanism works: this event class has two member functions that are normally supposed to work togheter. Yet are normally *not* used. Let's take the case of DocumentManager::saveFile() for example, and imagine that the user needs to completely bypass the way saveFile works and adopt his personal implementation. In order to do that he needs to add an handler to the manager, that is performing the operation in hte way he needs. He will also have to setAllowFileOperation( false ) from inside this handler, and setFileOperationStatus( true ) whenever the saving operation has been completed successfuly. The standard implementation of saveFile will then call the handler, collect that fileOperationStatus_ value and return it. See comment for setFileOperationStatus.

See also:
saveFile()


Constructor & Destructor Documentation

VCF::DocManagerEvent::DocManagerEvent Object source,
uint32  type
[inline]
 


Member Function Documentation

bool VCF::DocManagerEvent::allowFileOperation  )  [inline]
 

tells if we want to allow the DocumentManager to perform the standard file operation that he has been requested.

Returns:
bool, false if an event handler has caught this event and performed the file operation in an alternative way.

bool VCF::DocManagerEvent::getFileOperationStatus  )  [inline]
 

gets the status of a file operation after the event handler has been executed

void VCF::DocManagerEvent::setAllowFileOperation const bool &  val  )  [inline]
 

sets this flag as false from the event handler in order in order to make the manager aware that an alternative way, implemented by the handler, is preferred.

void VCF::DocManagerEvent::setFileOperationStatus const bool &  val  )  [inline]
 

sets the status of a file operation from the event handler.

The value set with this function will be the value returned by the DocumentManager's member function that was supposed to perform the standard implementation of this file operation. Use setAllowFileOperation( false ) to make this function active.

Parameters:
const bool&, true if the file operation has been completed successfully, false otherwise.


Member Data Documentation

bool VCF::DocManagerEvent::allowFileOp_ [protected]
 

bool VCF::DocManagerEvent::fileOperationStatus_ [protected]
 


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