VCF::Document Class Reference
A document is a model has many extra features like saving, loading, cutting and all that kind of stuff. More...
#include <vcf/ApplicationKit/Document.h>
Inheritance diagram for VCF::Document:

Public Types | |
| enum | DocumentEvents { deSaved = Model::MODEL_LAST_EVENT + 100, deOpened } |
Public Member Functions | |
| Document () | |
| the document's constructor | |
| virtual void | empty () |
| empties the model | |
| bool | isModified () |
| tells is the document has been modified since the last time it has been saved | |
| void | setModified (bool val) |
| sets the modification flag for the document. | |
| virtual String | getName () |
| gets the basename associated to the document in the file system. | |
| virtual void | setName (const String &name) |
| sets the basename to be associated to the document. | |
| String | getFileName () |
| gets the full filename associated to the document in the file system. | |
| void | setFileName (const String &fileName) |
| sets the full filename associated to the document in the file system. | |
| Window * | getWindow () |
| gets the window associated to the document. | |
| void | setWindow (Window *val) |
| sets the window to be associated to the document. | |
| virtual void | initNew ()=0 |
| callback function called by the document manager framework as soon as a new document has been successfully created. | |
| virtual bool | saveAsType (const String &fileName, const String &fileType) |
| saves the document as a specified type of file with a name that could be different than the current name for the document. | |
| virtual bool | saveAsType (const String &fileType, OutputStream &stream) |
| saves the document as a specified type of file. | |
| virtual bool | openFromType (const String &fileName, const String &fileType) |
| this actually opens/loads the file associated to the document. | |
| virtual bool | openFromType (const String &fileType, InputStream &stream) |
| opens the document from an input stream. | |
| bool | getKeepsBackUpFile () |
| tells if we keep a backup copy of the file when saving the document. | |
| void | setKeepsBackUpFile (const bool &val) |
| sets the flag stating that we want to keep a backup copy of the file when saving the document. | |
| virtual bool | canCutFromDocument () |
| tells if we can perform a cut operation on the document. | |
| virtual bool | canCopyFromDocument () |
| tells if we can perform a copy operation on the document. | |
| virtual bool | canPasteToDocument () |
| tells if we can perform a paste operation on the document. | |
| virtual DataObject * | cut () |
| performs a cut operation on the document and returns the cut object. | |
| virtual DataObject * | copy () |
| performs a copy operation on the document and returns the copied object. | |
| virtual bool | paste (DataObject *data) |
| performs a past operation on the document. | |
| Enumerator< String > * | getSupportedClipboardFormats () |
| gets the enumerator of the clip formats supported by the document. | |
| void | addSupportedClipboardFormat (const String &type) |
| adds a clip format to the list of supported formats. | |
Protected Attributes | |
| Window * | docWindow_ |
| FilePath | fileName_ |
| bool | modified_ |
| bool | keepBackUpFile_ |
| std::vector< String > | clipFormats_ |
| EnumeratorContainer< std::vector< String >, String > | clipFormatContainer_ |
Detailed Description
A document is a model has many extra features like saving, loading, cutting and all that kind of stuff.
Member Enumeration Documentation
|
|
|
Constructor & Destructor Documentation
|
|
the document's constructor
|
Member Function Documentation
|
|
adds a clip format to the list of supported formats.
|
|
|
tells if we can perform a copy operation on the document. By default a document has not thisoperation enabled.
|
|
|
tells if we can perform a cut operation on the document. By default a document has not thisoperation enabled.
|
|
|
tells if we can perform a paste operation on the document. By default a document has not thisoperation enabled.
|
|
|
performs a copy operation on the document and returns the copied object.
|
|
|
performs a cut operation on the document and returns the cut object.
|
|
|
empties the model
Reimplemented from VCF::AbstractModel. |
|
|
gets the full filename associated to the document in the file system.
|
|
|
tells if we keep a backup copy of the file when saving the document.
|
|
|
gets the basename associated to the document in the file system. This is the name of the file without its path component
Reimplemented from VCF::Component. |
|
|
gets the enumerator of the clip formats supported by the document. This document will be able to cut & paste data from the clipboard of the OS only for these specified formats.
|
|
|
gets the window associated to the document.
|
|
|
callback function called by the document manager framework as soon as a new document has been successfully created. Override this to initializations specific of your document. |
|
|
tells is the document has been modified since the last time it has been saved
|
|
||||||||||||
|
opens the document from an input stream. The type of file has to be specified too, because this tells how to treat the stream.
|
|
||||||||||||
|
this actually opens/loads the file associated to the document. It calls a custom function specific to the document that appropriately opens and manages the file.
|
|
|
performs a past operation on the document.
|
|
||||||||||||
|
saves the document as a specified type of file. The output stream is also specified.
|
|
||||||||||||
|
saves the document as a specified type of file with a name that could be different than the current name for the document. We may need to save the document as a different type without renaming this document, so it is let to the user to call setFileName() first if he needs.
|
|
|
sets the full filename associated to the document in the file system.
|
|
|
sets the flag stating that we want to keep a backup copy of the file when saving the document.
|
|
|
sets the modification flag for the document.
|
|
|
sets the basename to be associated to the document. This is the name of the file without its path component. The full filename, which is accordingly updated, keeps the same path component of the previous filename.
Reimplemented from VCF::Component. |
|
|
sets the window to be associated to the document.
|
Member Data Documentation
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
The documentation for this class was generated from the following file:
- vcf/ApplicationKit/Document.h
