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 const SecurityProvidergetSecurityProvider () const =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 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

Definition at line 33 of file djv_document.h.


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

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.

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

Returns:
Pointer to the Chunk instance.

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

Reflect the changes of this instance to the original chunks.

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.


The documentation for this class was generated from the following file:
This document is automatically generated using doxygen 1.5.4 at Fri Jun 27 18:23:27 2008.