ACF $AcfVersion:0$
Public Types | Public Member Functions | Protected Member Functions | List of all members
idoc::CMultiPageDocumentFilePersistenceComp Class Reference

File based persistence of the multi-paged bitmap document. More...

#include <CMultiPageDocumentFilePersistenceComp.h>

Inheritance diagram for idoc::CMultiPageDocumentFilePersistenceComp:
ilog::TLoggerCompWrap< Base > ifile::IFilePersistence ilog::CLoggerBase ifile::IFileTypeInfo ilog::ILoggable istd::ILogger istd::IPolymorphic istd::IPolymorphic istd::IPolymorphic

Public Types

enum  OperationMode { OM_FLAT , OM_FOLDER , OM_COMPRESSED_FOLDER }
 
typedef ilog::CLoggerComponentBase BaseClass
 
- Public Types inherited from ilog::TLoggerCompWrap< Base >
typedef Base BaseClass
 Base class typedef for component functionality.
 
typedef ilog::CLoggerBase BaseClass2
 Base class typedef for logger functionality.
 
- Public Types inherited from ifile::IFilePersistence
enum  OperationState { OS_OK , OS_CANCELED , OS_FAILED }
 Result of operation. More...
 
enum  ErrorType { ET_NO_WRITE_PERMISSIONS , ET_NO_READ_PERMISSIONS , ET_FILE_NOT_EXIST }
 Possible file I/O errors. More...
 
enum  MessageId {
  MI_BAD_OBJECT_TYPE = 0xabf0 , MI_CANNOT_LOAD , MI_CANNOT_SAVE , MI_BAD_EXTENSION ,
  MI_FILE_NOT_EXIST , MI_UNSUPPORTED_VERSION
}
 List of possible message IDs used in context of this interface. More...
 
- Public Types inherited from ifile::IFileTypeInfo
enum  QueryFlags {
  QF_LOAD = 1 << 0 , QF_SAVE = 1 << 1 , QF_FILE = 1 << 2 , QF_DIRECTORY = 1 << 3 ,
  QF_ANONYMOUS = 1 << 4
}
 Describe detailed options of query. More...
 

Public Member Functions

virtual bool IsOperationSupported (const istd::IChangeable *dataObjectPtr, const QString *filePathPtr=NULL, int flags=-1, bool beQuiet=true) const override
 Returns true if object dataObject can be loaded/saved.
 
virtual ifile::IFilePersistence::OperationState LoadFromFile (istd::IChangeable &data, const QString &filePath=QString(), ibase::IProgressManager *progressManagerPtr=NULL) const override
 This function loads data data from file filePath.
 
virtual ifile::IFilePersistence::OperationState SaveToFile (const istd::IChangeable &data, const QString &filePath=QString(), ibase::IProgressManager *progressManagerPtr=NULL) const override
 This function saves data data to file filePath.
 
virtual bool GetFileExtensions (QStringList &result, const istd::IChangeable *dataObjectPtr=NULL, int flags=-1, bool doAppend=false) const override
 Get file extensions supported by this loader.
 
virtual QString GetTypeDescription (const QString *extensionPtr=NULL) const override
 Get description of object type associated with single extension.
 
- Public Member Functions inherited from ilog::CLoggerBase
 CLoggerBase ()
 Default constructor.
 
virtual void SetLogPtr (ilog::IMessageConsumer *logPtr) override
 Attach a message consumer for logging.
 
virtual ilog::IMessageConsumerGetLogPtr () const override
 Get the currently attached message consumer.
 
- Public Member Functions inherited from istd::IPolymorphic
virtual ~IPolymorphic ()
 

Protected Member Functions

virtual void OnComponentCreated () override
 Called when component is created.
 
virtual bool SerializeDocumentMetaInfo (const idoc::IMultiPageDocument &document, iser::IArchive &archive) const
 
virtual bool SerializePageMetaInfo (idoc::IMultiPageDocument &document, int pageIndex, iser::IArchive &archive) const
 
- Protected Member Functions inherited from ilog::TLoggerCompWrap< Base >
bool IsVerboseEnabled (int tracingLevel=0) const
 Check if verbose messages are enabled for a given tracing level.
 
void SendVerboseMessage (const QString &message, const QString &messageSource=QString(), int tracingLevel=0) const
 Send a verbose message if enabled.
 
virtual void DecorateMessage (istd::IInformationProvider::InformationCategory category, int id, int flags, QString &message, QString &messageSource) const override
 Decorate message before sending.
 
virtual void OnComponentDestroyed () override
 Called when component is destroyed.
 
- Protected Member Functions inherited from ilog::CLoggerBase
bool SendInfoMessage (int id, const QString &message, const QString &messageSource=QString(), int flags=0) const
 Send info message to log.
 
bool SendWarningMessage (int id, const QString &message, const QString &messageSource=QString(), int flags=0) const
 Send warning message to log.
 
bool SendErrorMessage (int id, const QString &message, const QString &messageSource=QString(), int flags=0) const
 Send error message to log.
 
bool SendCriticalMessage (int id, const QString &message, const QString &messageSource=QString(), int flags=0) const
 Send critical message to log.
 
bool SendInfoMessageOnce (int id, const QString &message, const QString &messageSource=QString(), int flags=0) const
 Send once info message to log.
 
bool SendWarningMessageOnce (int id, const QString &message, const QString &messageSource=QString(), int flags=0) const
 Send once warning message to log.
 
bool SendErrorMessageOnce (int id, const QString &message, const QString &messageSource=QString(), int flags=0) const
 Send once error message to log.
 
bool SendCriticalMessageOnce (int id, const QString &message, const QString &messageSource=QString(), int flags=0) const
 Send once critical message to log.
 
bool SendUserMessage (const istd::IInformationProvider *messagePtr) const
 Send message with user object.
 
bool AllowMessageOnceAgain (int id)
 Reset message lock.
 
virtual bool IsLogConsumed (const istd::IInformationProvider::InformationCategory *categoryPtr=NULL, const int *flagsPtr=NULL) const override
 Check if any log message is consumed.
 
virtual bool SendLogMessage (istd::IInformationProvider::InformationCategory category, int id, const QString &message, const QString &messageSource, int flags=0) const override
 Send any message to log.
 

Additional Inherited Members

- Protected Attributes inherited from ilog::CLoggerBase
QSet< int > m_onceMessageIds
 

Detailed Description

File based persistence of the multi-paged bitmap document.

Document persistence is realized as a list of document page files (for each document page) and meta info description file. There are three operating modes for this component (controlled by component attribute 'OpeationMode'):

  1. Document pages and meta info are saved in the target directory with following naming convention: <DocumentFileName>_[PageIndex].<DocumentExtension> for bitmap pages and <DocumentFileName>.bdm for the document's meta info.
  2. All files (document pages and meta info) are saved in the document's own directory with the same name as a document file name: <DocumentFileName>.bid
  3. The same as 2. but the document's directory will be zipped.

Definition at line 24 of file CMultiPageDocumentFilePersistenceComp.h.

Member Typedef Documentation

◆ BaseClass

Definition at line 29 of file CMultiPageDocumentFilePersistenceComp.h.

Member Enumeration Documentation

◆ OperationMode

Enumerator
OM_FLAT 
OM_FOLDER 
OM_COMPRESSED_FOLDER 

Definition at line 31 of file CMultiPageDocumentFilePersistenceComp.h.

Member Function Documentation

◆ GetFileExtensions()

virtual bool idoc::CMultiPageDocumentFilePersistenceComp::GetFileExtensions ( QStringList &  result,
const istd::IChangeable dataObjectPtr = NULL,
int  flags = -1,
bool  doAppend = false 
) const
overridevirtual

Get file extensions supported by this loader.

Parameters
resultlist of extensions, e.g. {"txt", "doc"}.
dataObjectPtroptional pointer to data object for which all possible extensions are requested. It can be NULL if any object is meant.
flagsset of flags
See also
QueryFlags.
Parameters
doAppendif true, list of extensions should be appended to existing list.

Implements ifile::IFileTypeInfo.

◆ GetTypeDescription()

virtual QString idoc::CMultiPageDocumentFilePersistenceComp::GetTypeDescription ( const QString *  extensionPtr = NULL) const
overridevirtual

Get description of object type associated with single extension.

Implements ifile::IFileTypeInfo.

◆ IsOperationSupported()

virtual bool idoc::CMultiPageDocumentFilePersistenceComp::IsOperationSupported ( const istd::IChangeable dataObjectPtr,
const QString *  filePathPtr = NULL,
int  flags = -1,
bool  beQuiet = true 
) const
overridevirtual

Returns true if object dataObject can be loaded/saved.

Parameters
dataObjectPtroptional pointer to data object should be loaded/stored. It can be NULL if any object is meant.
filePathPtroptional pointer to file should be loaded/stored. It can be NULL if any file is meant. If it points at empty string, anonymous loading is mean.
flagscombination of flags defined in QueryFlags and ifile::IFileTypeInfo::QueryFlags.
beQuietif true, no user message output is allowed.

Implements ifile::IFilePersistence.

◆ LoadFromFile()

virtual ifile::IFilePersistence::OperationState idoc::CMultiPageDocumentFilePersistenceComp::LoadFromFile ( istd::IChangeable data,
const QString &  filePath = QString(),
ibase::IProgressManager progressManagerPtr = NULL 
) const
overridevirtual

This function loads data data from file filePath.

Returns
File loading state.
See also
OperationState

Implements ifile::IFilePersistence.

◆ OnComponentCreated()

virtual void idoc::CMultiPageDocumentFilePersistenceComp::OnComponentCreated ( )
overrideprotectedvirtual

Called when component is created.

Automatically connects the log consumer from the "Log" reference.

Note
Override to add initialization, but always call base class:
virtual void OnComponentCreated() override {
// Custom initialization
}
virtual void OnComponentCreated() override
Called when component is created.
virtual void OnComponentCreated() override
Called when component is created.

Reimplemented from ilog::TLoggerCompWrap< Base >.

◆ SaveToFile()

virtual ifile::IFilePersistence::OperationState idoc::CMultiPageDocumentFilePersistenceComp::SaveToFile ( const istd::IChangeable data,
const QString &  filePath = QString(),
ibase::IProgressManager progressManagerPtr = NULL 
) const
overridevirtual

This function saves data data to file filePath.

Returns
File saving state.
See also
OperationState

Implements ifile::IFilePersistence.

◆ SerializeDocumentMetaInfo()

virtual bool idoc::CMultiPageDocumentFilePersistenceComp::SerializeDocumentMetaInfo ( const idoc::IMultiPageDocument document,
iser::IArchive archive 
) const
protectedvirtual

◆ SerializePageMetaInfo()

virtual bool idoc::CMultiPageDocumentFilePersistenceComp::SerializePageMetaInfo ( idoc::IMultiPageDocument document,
int  pageIndex,
iser::IArchive archive 
) const
protectedvirtual

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