Public Member Functions | Static Public Member Functions

Celartem::DjVu::Document Class Reference

#include <djv_document.h>

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

List of all members.

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 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

Static Public Member Functions

static AutoPtr< Documentcreate ()
static AutoPtr< Documentcreate (Chunk *inChunk, 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)

Detailed Description

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

See also:
Page

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,
IFF::Layout inLayout = NULL 
) [static]

Create a new Document instance from the specified chunk.

Parameters:
inChunk Pointer to a chunk which contains either DJVM or DJVU.
inLayout Pointer 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 ( const String inUrlOrFileName,
CredentialProvider inCredProv = NULL,
SecurityProviderBroker inSecProvBroker = NULL,
bool  inRecoverErrors = false 
) [static]

Create a new Document instance from the specified location.

Parameters:
inUrlOrFileName URL or a local file path.
inCredProv A CredentialProvider instance which is used if the DjVu file being deserialized is protected by some security mechanism.
inSecProvBroker A 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.
inRecoverErrors If 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 ( Storage inStorage,
CredentialProvider inCredProv = NULL,
SecurityProviderBroker inSecProvBroker = NULL,
bool  inRecoverErrors = false 
) [static]

Create a new Document instance from the specified Storage instance.

Parameters:
inStorage Pointer to a Storage instance to load DjVu from.
inCredProv A CredentialProvider instance which is used if the DjVu file being deserialized is protected by some security mechanism.
inSecProvBroker A 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.
inRecoverErrors If 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 const Bookmark* Celartem::DjVu::Document::getBookmark (  )  const [pure virtual]

Get the Bookmark instance.

Returns:
Pointer to the Bookmark 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 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 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::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:
inDocMergeTo Pointer to a Document instance to merge with.
outNameRemappings A map instance which receives name remapping list (old to new) for further process. It can be NULL if you don't need such information.
inDoingAutoNavmAnnoRemapping true to instruct this method to do updating NAVM and ANTz, ANTa chunks.
inRenameFunc Optional function to rename chunks.
inRenameContext Optional 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 ( 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:
inStorage Storage instance to write on.
inSecProv SecurityProvider instance if needed. It can be NULL.
inCallback Pointer to a function which is called during the serialization process.
inContext Pointer to a parameter which is passed to inCallback function.
inForceReflectChanges If 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 ( 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:
inFileName Output DjVu file name.
inSecProv SecurityProvider instance if needed. It can be NULL.
inCallback Pointer to a function which is called during the serialization process.
inContext Pointer to a parameter which is passed to inCallback function.
inForceReflectChanges If 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:
inOutputIndexFileName Output DjVu index file name. All the satellite files are placed on the same directory to this file.
inSecProv SecurityProvider instance if needed. It can be NULL.
inCallback Pointer to a function which is called during the serialization process.
inContext Pointer to a parameter which is passed to inCallback function.
inForceReflectChanges If 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:
inStorage Storage instance on which this method writes the indirect djvu index file.
inStorageLocator StorageLocator instance which locates satellite files (this instance is used to determine the file path for the files other than index file).
inSecProv SecurityProvider instance if needed. It can be NULL.
inCallback Pointer to a function which is called during the serialization process.
inContext Pointer to a parameter which is passed to inCallback function.
inForceReflectChanges If 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:

This document is made with doxygen 1.7.1 at Thu Feb 17 2011 15:40:20.
Caminova Logo