Public Member Functions | Static Public Member Functions | List of all members
Celartem::DjVu::Document Class Referenceabstract

#include <djv_document.h>

Inheritance diagram for Celartem::DjVu::Document:
Inheritance graph
[legend]

Public Member Functions

virtual PageArraygetPages ()=0
 
virtual const PageArraygetPages () const =0
 
virtual BookmarkgetBookmark ()=0
 
virtual const BookmarkgetBookmark () const =0
 
virtual AnnotationgetSharedAnnotation ()=0
 
virtual const AnnotationgetSharedAnnotation () const =0
 
virtual const SecurityProvidergetSecurityProvider () const =0
 
virtual IFF::DjVuMultipageType getMultipageType () const =0
 
virtual void removeSharedAnnotation ()=0
 
virtual void save (const String &inFileName, const SecurityProvider *inSecProv=NULL, IFF::SerializationCallback inCallback=NULL, void *inContext=NULL, bool inForceReflectChanges=true) const =0
 
virtual void save (Storage *inStorage, const SecurityProvider *inSecProv=NULL, IFF::SerializationCallback inCallback=NULL, void *inContext=NULL, bool inForceReflectChanges=true) const =0
 
virtual void saveAsIndirect (const String &inOutputIndexFileName, const SecurityProvider *inSecProv=NULL, IFF::SerializationCallback inCallback=NULL, void *inContext=NULL, bool inForceReflectChanges=true) const =0
 
virtual void saveAsIndirect (Storage *inStorage, StorageLocator *inStorageLocator=NULL, const SecurityProvider *inSecProv=NULL, IFF::SerializationCallback inCallback=NULL, void *inContext=NULL, bool inForceReflectChanges=true) const =0
 
virtual void prepareForMerger (const Document *inDocMergeTo, std::map< String, String > *outNameRemappings=NULL, bool inDoingAutoNavmAnnoRemapping=true, Chunk::RenameFunc inRenameFunc=NULL, void *inRenameContext=NULL)=0
 
virtual const ChunkgetChunk () const =0
 
virtual ChunkgetChunk ()=0
 
virtual void updateChunks ()=0
 
virtual void syncToChunks ()=0
 
virtual void integrateDictionaryIntoPages ()=0
 
virtual void mergeSharedAnnotationIntoPages ()=0
 
- Public Member Functions inherited from Celartem::Referable
 Referable ()
 
void addRef () const
 
void releaseRef () const
 
size_t getReferenceCount () const
 

Static Public Member Functions

static AutoPtr< Documentcreate ()
 
static AutoPtr< Documentcreate (Chunk *inChunk, const IFF::Layout *inLayout=NULL)
 
static AutoPtr< Documentcreate (Storage *inStorage, CredentialProvider *inCredProv=NULL, SecurityProviderBroker *inSecProvBroker=NULL, bool inRecoverErrors=false)
 
static AutoPtr< Documentcreate (const String &inUrlOrFileName, CredentialProvider *inCredProv=NULL, SecurityProviderBroker *inSecProvBroker=NULL, bool inRecoverErrors=false)
 
- Static Public Member Functions inherited from Celartem::Referable
static void dumpDbgAllRefCount ()
 

Detailed Description

This class provides an easy access to DJVM or DJVU chunk based document.

See Also
Page
Warning
Without setting appropriate license script, decoding function (DjVuDecode feature) will stop working after 2 weeks from the its built time. See License System for more information.

Member Function Documentation

static AutoPtr<Document> Celartem::DjVu::Document::create ( )
static

Create an empty Document instance.

Returns
Pointer to the newly created instance.
static AutoPtr<Document> Celartem::DjVu::Document::create ( Chunk inChunk,
const IFF::Layout inLayout = NULL 
)
static

Create a new Document instance from the specified chunk.

Parameters
inChunkPointer to a chunk which contains either DJVM or DJVU.
inLayoutPointer to a IFF::Layout instance, which is returned by IFF::deserialize method. If this is NULL, all the chunks are loaded synchronously and this method may take relatively long.
Returns
Pointer to the newly created instance.
static AutoPtr<Document> Celartem::DjVu::Document::create ( Storage inStorage,
CredentialProvider inCredProv = NULL,
SecurityProviderBroker inSecProvBroker = NULL,
bool  inRecoverErrors = false 
)
static

Create a new Document instance from the specified Storage instance.

Parameters
inStoragePointer to a Storage instance to load DjVu from.
inCredProvA CredentialProvider instance which is used if the DjVu file being deserialized is protected by some security mechanism.
inSecProvBrokerA SecurityProviderBroker instance which loads SecurityProvider instance from 4 character security system Id. If this is NULL, this function uses the default SecurityProviderBroker instance.
This parameter is useful if you want to create your own SecurityProvider class and let deserialize function to use that class.
inRecoverErrorsIf this parameter is true, this method tries to recover the errors during loading chunks. It may be able to open broken DjVu files.
If this is false, this method throws exceptions if it encounters broken structures.
Returns
Pointer to the newly created instance.
static AutoPtr<Document> Celartem::DjVu::Document::create ( const String inUrlOrFileName,
CredentialProvider inCredProv = NULL,
SecurityProviderBroker inSecProvBroker = NULL,
bool  inRecoverErrors = false 
)
static

Create a new Document instance from the specified location.

Parameters
inUrlOrFileNameURL or a local file path.
inCredProvA CredentialProvider instance which is used if the DjVu file being deserialized is protected by some security mechanism.
inSecProvBrokerA SecurityProviderBroker instance which loads SecurityProvider instance from 4 character security system Id. If this is NULL, this function uses the default SecurityProviderBroker instance.
This parameter is useful if you want to create your own SecurityProvider class and let deserialize function to use that class.
inRecoverErrorsIf this parameter is true, this method tries to recover the errors during loading chunks. It may be able to open broken DjVu files.
If this is false, this method throws exceptions if it encounters broken structures.
Returns
Pointer to the newly created instance.
virtual Bookmark* Celartem::DjVu::Document::getBookmark ( )
pure virtual

Get the Bookmark instance.
Please note that the modifications to the returned instance does not reflect to the NAVM chunk unless you explicitly call one of updateChunks, save and saveAsIndirect.
You had better use const version if you don't plan to modify the bookmark.

Returns
Pointer to the Bookmark instance.
virtual const Bookmark* Celartem::DjVu::Document::getBookmark ( ) const
pure virtual

Get the Bookmark instance.

Returns
Pointer to the Bookmark instance.
virtual const Chunk* Celartem::DjVu::Document::getChunk ( ) const
pure virtual

Get the actual Chunk instance.
Please note that modifications to the Page, Bookmark and the other attributes are not reflected to the real chunk until you explicitly call updateChunks method.

Returns
Pointer to the Chunk instance.
virtual Chunk* Celartem::DjVu::Document::getChunk ( )
pure virtual

Get the actual Chunk instance.
Please note that modifications to the Page, Bookmark and the other attributes are not reflected to the real chunk until you explicitly call updateChunks method.
And changes to the chunks are not reflected to the Document class attributes until you explicitly call syncToChunks method.

Returns
Pointer to the Chunk instance.
virtual IFF::DjVuMultipageType Celartem::DjVu::Document::getMultipageType ( ) const
pure virtual

Get the initial multipage configuration type.

Returns
Multipage configuration type.
virtual PageArray& Celartem::DjVu::Document::getPages ( )
pure virtual

Get the array of Page instances.

Returns
Reference to the Page array.
virtual const PageArray& Celartem::DjVu::Document::getPages ( ) const
pure virtual

Get the array of Page instances.

Returns
Reference to the Page array.
virtual const SecurityProvider* Celartem::DjVu::Document::getSecurityProvider ( ) const
pure virtual

Get the SecurityProvider instance which is associated to the first Page instance of the this Document instance. If no page or the page does not have any SecurityProvider, this method returns NULL.

Returns
Pointer to the SecurityProvider instance.
virtual Annotation* Celartem::DjVu::Document::getSharedAnnotation ( )
pure virtual

Get shared annotation.

Returns
Pointer to the annotation shared by several pages. This is preferred way to modify/update shared annotation. Do not use Page::getSharedAnnotation methods for normal operation; they're only for backward compatibility.
virtual const Annotation* Celartem::DjVu::Document::getSharedAnnotation ( ) const
pure virtual

Get shared annotation.

Returns
Pointer to the annotation shared by several pages.
virtual void Celartem::DjVu::Document::integrateDictionaryIntoPages ( )
pure virtual

Remoevs shared dictionaries. Each page integrates its referencing dictionary.

virtual void Celartem::DjVu::Document::mergeSharedAnnotationIntoPages ( )
pure virtual

Merge shared annotaion into pages.

virtual void Celartem::DjVu::Document::prepareForMerger ( const Document inDocMergeTo,
std::map< String, String > *  outNameRemappings = NULL,
bool  inDoingAutoNavmAnnoRemapping = true,
Chunk::RenameFunc  inRenameFunc = NULL,
void *  inRenameContext = NULL 
)
pure virtual

Prepare for the merger with the specified Document. Each DJVU chunks are usually managed by a name and if multiple DjVu files are merged into a DjVu file, it may cause some confliction in names. This method renames such chunks before the actual merge process. This method also removes shared annotation to reduce confliction with the merger document.
This method is actually a wrapper to Chunk::prepareForMerger and this method internally calls updateChunks and syncToChunks before and after of the call to keep the consistency.

Parameters
inDocMergeToPointer to a Document instance to merge with.
outNameRemappingsA map instance which receives name remapping list (old to new) for further process. It can be NULL if you don't need such information.
inDoingAutoNavmAnnoRemappingtrue to instruct this method to do updating NAVM and ANTz, ANTa chunks.
inRenameFuncOptional function to rename chunks.
inRenameContextOptional parameter, which is passed to rename function.
See Also
Chunk::prepareForMerger
virtual void Celartem::DjVu::Document::removeSharedAnnotation ( )
pure virtual

Remove shared annotation.

virtual void Celartem::DjVu::Document::save ( const String inFileName,
const SecurityProvider inSecProv = NULL,
IFF::SerializationCallback  inCallback = NULL,
void *  inContext = NULL,
bool  inForceReflectChanges = true 
) const
pure virtual

Write out the document to a file in bundled DjVu format.

Parameters
inFileNameOutput DjVu file name.
inSecProvSecurityProvider instance if needed. It can be NULL.
inCallbackPointer to a function which is called during the serialization process.
inContextPointer to a parameter which is passed to inCallback function.
inForceReflectChangesIf ture, this method internally calls updateChunks before writing out the chunks to the storage; otherwise this method writes out the chunks as it is and the modifications you've done are not reflected to the output result.
virtual void Celartem::DjVu::Document::save ( Storage inStorage,
const SecurityProvider inSecProv = NULL,
IFF::SerializationCallback  inCallback = NULL,
void *  inContext = NULL,
bool  inForceReflectChanges = true 
) const
pure virtual

Write out the document to the storage in bundled DjVu format.

Parameters
inStorageStorage instance to write on.
inSecProvSecurityProvider instance if needed. It can be NULL.
inCallbackPointer to a function which is called during the serialization process.
inContextPointer to a parameter which is passed to inCallback function.
inForceReflectChangesIf ture, this method internally calls updateChunks before writing out the chunks to the storage; otherwise this method writes out the chunks as it is and the modifications you've done are not reflected to the output result.
virtual void Celartem::DjVu::Document::saveAsIndirect ( const String inOutputIndexFileName,
const SecurityProvider inSecProv = NULL,
IFF::SerializationCallback  inCallback = NULL,
void *  inContext = NULL,
bool  inForceReflectChanges = true 
) const
pure virtual

Write out the document to the storage in indirect DjVu format.

Parameters
inOutputIndexFileNameOutput DjVu index file name. All the satellite files are placed on the same directory to this file.
inSecProvSecurityProvider instance if needed. It can be NULL.
inCallbackPointer to a function which is called during the serialization process.
inContextPointer to a parameter which is passed to inCallback function.
inForceReflectChangesIf ture, this method internally calls updateChunks before writing out the chunks to the storage; otherwise this method writes out the chunks as it is and the modifications you've done are not reflected to the output result.
virtual void Celartem::DjVu::Document::saveAsIndirect ( Storage inStorage,
StorageLocator inStorageLocator = NULL,
const SecurityProvider inSecProv = NULL,
IFF::SerializationCallback  inCallback = NULL,
void *  inContext = NULL,
bool  inForceReflectChanges = true 
) const
pure virtual

Write out the document to the storage in indirect DjVu format.

Parameters
inStorageStorage instance on which this method writes the indirect djvu index file.
inStorageLocatorStorageLocator instance which locates satellite files (this instance is used to determine the file path for the files other than index file).
inSecProvSecurityProvider instance if needed. It can be NULL.
inCallbackPointer to a function which is called during the serialization process.
inContextPointer to a parameter which is passed to inCallback function.
inForceReflectChangesIf ture, this method internally calls updateChunks before writing out the chunks to the storage; otherwise this method writes out the chunks as it is and the modifications you've done are not reflected to the output result.
virtual void Celartem::DjVu::Document::syncToChunks ( )
pure virtual

Discards the modifications on this Document instance and synchronizes the internal state to the real Chunk instance.
In other words, this method does Chunk to Document reflection.

virtual void Celartem::DjVu::Document::updateChunks ( )
pure virtual

Reflect the changes of this instance to the original chunks.
In other words, this method does Document to Chunk reflection.


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

Cuminas DjVu SDK 3.0.33103
This document is made with doxygen 1.8.5 at Sun Dec 15 2013 19:38:07.
Cuminas Logo