Public Member Functions | Protected Member Functions | List of all members
idoc::CTmplBasedDocumentManagerBase Class Reference

Base implementation of document manager. More...

#include <CTmplBasedDocumentManagerBase.h>

Inheritance diagram for idoc::CTmplBasedDocumentManagerBase:
idoc::IDocumentManager istd::IChangeable idoc::IDocumentTypesInfo istd::IPolymorphic istd::IPolymorphic idoc::CMultiDocumentManagerBase idoc::CSingleDocumentManagerBase iqtdoc::TQtDocumentManagerWrap< idoc::CMultiDocumentManagerBase, iqtgui::TRestorableGuiWrap< iqtgui::TGuiComponentBase< QMdiArea > > > iqtdoc::TQtDocumentManagerWrap< idoc::CSingleDocumentManagerBase, iqtgui::TRestorableGuiWrap< iqtgui::TGuiComponentBase< QWidget > > > iqtdoc::CMultiDocumentWorkspaceGuiComp iqtdoc::CSingleDocumentWorkspaceGuiComp

Public Member Functions

 CTmplBasedDocumentManagerBase ()
 
virtual int GetAllowedOperationFlags (const istd::IPolymorphic *viewPtr=NULL) const
 Get flags of allowed operations. More...
 
virtual bool IsFeatureSupported (int featureFlags, const QByteArray &documentTypeId) const
 Return true, if the feature(s) is supported by this document template. More...
 
virtual Ids GetDocumentTypeIds () const
 Get list of supported document ID's can be created for specified file. More...
 
virtual QString GetDocumentTypeName (const QByteArray &documentTypeId) const
 Get human readable name of some document type ID. More...
 
virtual ifile::IFileTypeInfoGetDocumentFileTypeInfo (const QByteArray &documentTypeId) const
 Get file type information object for some selected document type. More...
 
virtual Ids GetDocumentTypeIdsForFile (const QString &filePath) const
 Get list of supported document ID's can be created for specified file. More...
 
virtual QString GetDefaultDirectory (const QString &sugestedDir="", const QByteArray *documentTypeIdPtr=NULL) const
 Return default directory for specified document type. More...
 
- Public Member Functions inherited from idoc::IDocumentManager
virtual idoc::IUndoManagerGetUndoManagerForDocument (const istd::IChangeable *documentPtr) const =0
 Return undo mananger for document documenPtr. More...
 
virtual int GetDocumentsCount () const =0
 Get number of opened documents. More...
 
virtual istd::IChangeableGetDocumentFromIndex (int index, DocumentInfo *documentInfoPtr=NULL) const =0
 Get document at specified index. More...
 
virtual int GetViewsCount (int documentIndex) const =0
 Get number of view for specified document. More...
 
virtual istd::IPolymorphicGetViewFromIndex (int documentIndex, int viewIndex) const =0
 Get single view using its and document indices. More...
 
virtual istd::IPolymorphicGetActiveView () const =0
 Return the active document. More...
 
virtual istd::IChangeableGetDocumentFromView (const istd::IPolymorphic &view, DocumentInfo *documentInfoPtr=NULL) const =0
 Return the document assigned to view. More...
 
virtual istd::IPolymorphicAddViewToDocument (const istd::IChangeable &document, const QByteArray &viewTypeId=QByteArray())=0
 Add a new view to the document. More...
 
virtual QByteArray GetDocumentTypeId (const istd::IChangeable &document) const =0
 Get ID of document type managed by this object. More...
 
virtual bool InsertNewDocument (const QByteArray &documentTypeId, bool createView=true, const QByteArray &viewTypeId="", istd::IChangeable **newDocumentPtr=NULL, bool beQuiet=false, bool *ignoredPtr=NULL)=0
 Creates a new document with the document ID documentTypeId. More...
 
virtual bool OpenDocument (const QByteArray *documentTypeIdPtr=NULL, const QString *fileNamePtr=NULL, bool createView=true, const QByteArray &viewTypeId="", istd::IChangeable **documentPtr=NULL, FileToTypeMap *loadedMapPtr=NULL, bool beQuiet=false, bool *ignoredPtr=NULL)=0
 Opens document(s) from the file list. More...
 
virtual bool SaveDocument (int documentIndex=-1, bool requestFileName=false, FileToTypeMap *savedMapPtr=NULL, bool beQuiet=false, bool *ignoredPtr=NULL)=0
 Save document. More...
 
virtual bool SaveDirtyDocuments (bool beQuiet=false, bool *ignoredPtr=NULL)=0
 Ask user (optional) and save all dirty (changed) documents. More...
 
virtual bool CloseDocument (int documentIndex=-1, bool beQuiet=false, bool *ignoredPtr=NULL)=0
 Close document and all its views. More...
 
virtual bool CloseView (istd::IPolymorphic *viewPtr=NULL, bool beQuiet=false, bool *ignoredPtr=NULL)=0
 Close view. More...
 
- Public Member Functions inherited from istd::IChangeable
virtual int GetSupportedOperations () const
 Get set of flags for supported operations. More...
 
virtual bool CopyFrom (const IChangeable &object, CompatibilityMode mode=CM_WITHOUT_REFS)
 Copy this object from another one. More...
 
virtual bool IsEqual (const IChangeable &object) const
 Compare this object with another object. More...
 
virtual IChangeableCloneMe (CompatibilityMode mode=CM_WITHOUT_REFS) const
 Make a copy of this object. More...
 
virtual bool ResetData (CompatibilityMode mode=CM_WITHOUT_REFS)
 Reset data to its default state. More...
 
virtual void BeginChanges (const ChangeSet &changeSet)
 Starts the change transaction. More...
 
virtual void EndChanges (const ChangeSet &changeSet)
 Ends the change transaction. More...
 
virtual void BeginChangeGroup (const ChangeSet &changeSet)
 Starts group of changes. More...
 
virtual void EndChangeGroup (const ChangeSet &changeSet)
 Ends group of changes. More...
 
- Public Member Functions inherited from istd::IPolymorphic
virtual ~IPolymorphic ()
 

Protected Member Functions

virtual const
idoc::IDocumentTemplate
GetDocumentTemplate () const
 
void SetDocumentTemplate (const idoc::IDocumentTemplate *documentTemplatePtr)
 
- Protected Member Functions inherited from istd::IChangeable
virtual void OnBeginChanges ()
 Callback function for begin change event. More...
 
virtual void OnEndChanges (const ChangeSet &changeSet)
 Callback function for end change event. More...
 

Additional Inherited Members

- Public Types inherited from idoc::IDocumentManager
enum  ChangeFlags {
  CF_DOCUMENT_RENAMED = 0x834d670, CF_DOCUMENT_CREATED, CF_DOCUMENT_REMOVED, CF_DOCUMENT_COUNT_CHANGED,
  CF_VIEW_ACTIVATION_CHANGED
}
 Possible changes in the mananger data model. More...
 
enum  OperationFlags {
  OF_FILE_NEW = 0x0001, OF_FILE_OPEN = 0x0002, OF_FILE_SAVE = 0x0004, OF_FILE_SAVE_AS = 0x0008,
  OF_KNOWN_PATH = 0x0010
}
 Flags describing possible operations. More...
 
typedef QMap< QString, QByteArray > FileToTypeMap
 Map from file path to ducument type ID's. More...
 
- Public Types inherited from istd::IChangeable
enum  ChangeFlags {
  CF_ACF_INTERNAL = 0, CF_ALL_DATA, CF_ANY, CF_DESTROYING,
  CF_DELEGATED, CF_NO_UNDO
}
 Data model change notification flags. More...
 
enum  SupportedOperations {
  SO_NONE = 0, SO_OBSERVE = 1 << 0, SO_COPY = 1 << 1, SO_CLONE = 1 << 2,
  SO_COMPARE = 1 << 3, SO_RESET = 1 << 4
}
 Flags for supported operations. More...
 
enum  CompatibilityMode { CM_STRICT, CM_WITHOUT_REFS, CM_WITH_REFS, CM_CONVERT }
 Control how relationship betweeen objects are interpreted. More...
 
- Public Types inherited from idoc::IDocumentTypesInfo
enum  SupportedFeatures { SF_NEW_DOCUMENT = 0x0001, SF_EDIT_DOCUMENT = 0x0010, SF_DEFAULT = 0xffff }
 Enumeration for supported types of operation with the document. More...
 
typedef QVector< QByteArray > Ids
 
- Static Public Member Functions inherited from istd::IChangeable
static const ChangeSetGetNoChanges ()
 Get empty set of changes. More...
 
static const ChangeSetGetAnyChange ()
 Get anonymous change set. More...
 
static const ChangeSetGetAllChanges ()
 Get anonymous change set. More...
 
static const ChangeSetGetDelegatedChanges ()
 Get delegated change set. More...
 

Detailed Description

Base implementation of document manager.

This implementation base on the document template concept.

See Also
IDocumentTemplate

Definition at line 21 of file CTmplBasedDocumentManagerBase.h.

Constructor & Destructor Documentation

idoc::CTmplBasedDocumentManagerBase::CTmplBasedDocumentManagerBase ( )

Member Function Documentation

virtual int idoc::CTmplBasedDocumentManagerBase::GetAllowedOperationFlags ( const istd::IPolymorphic viewPtr = NULL) const
virtual

Get flags of allowed operations.

Implements idoc::IDocumentManager.

virtual QString idoc::CTmplBasedDocumentManagerBase::GetDefaultDirectory ( const QString &  sugestedDir = "",
const QByteArray *  documentTypeIdPtr = NULL 
) const
virtual

Return default directory for specified document type.

Parameters
sugestedDirtemplate directory sugested by user.
documentTypeIdPtroptional ID of document type.

Implements idoc::IDocumentTypesInfo.

virtual ifile::IFileTypeInfo* idoc::CTmplBasedDocumentManagerBase::GetDocumentFileTypeInfo ( const QByteArray &  documentTypeId) const
virtual

Get file type information object for some selected document type.

Parameters
documentTypeIdID of document type as returned by GetDocumentTypeIds().

Implements idoc::IDocumentTypesInfo.

virtual const idoc::IDocumentTemplate* idoc::CTmplBasedDocumentManagerBase::GetDocumentTemplate ( ) const
protectedvirtual
virtual Ids idoc::CTmplBasedDocumentManagerBase::GetDocumentTypeIds ( ) const
virtual

Get list of supported document ID's can be created for specified file.

Implements idoc::IDocumentTypesInfo.

virtual Ids idoc::CTmplBasedDocumentManagerBase::GetDocumentTypeIdsForFile ( const QString &  filePath) const
virtual

Get list of supported document ID's can be created for specified file.

Implements idoc::IDocumentTypesInfo.

virtual QString idoc::CTmplBasedDocumentManagerBase::GetDocumentTypeName ( const QByteArray &  documentTypeId) const
virtual

Get human readable name of some document type ID.

Parameters
documentTypeIdID of document type as returned by GetDocumentTypeIds().

Implements idoc::IDocumentTypesInfo.

virtual bool idoc::CTmplBasedDocumentManagerBase::IsFeatureSupported ( int  featureFlags,
const QByteArray &  documentTypeId 
) const
virtual

Return true, if the feature(s) is supported by this document template.

Implements idoc::IDocumentTypesInfo.

void idoc::CTmplBasedDocumentManagerBase::SetDocumentTemplate ( const idoc::IDocumentTemplate documentTemplatePtr)
protected

The documentation for this class was generated from the following file:

© 2007-2017 Witold Gantzke and Kirill Lepskiy