Public Types | Public Member Functions | Static Public Member Functions | Public Attributes

Celartem::DjVu::Annotation Class Reference

#include <djv_annotation.h>

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

List of all members.

Public Types

enum  HorzAlign { haNone = 0, haLeft = 1, haCenter = 2, haRight = 3 }
enum  VertAlign { vaNone = 0, vaTop = 1, vaCenter = 2, vaBottom = 3 }
enum  SpecialZoom {
  szNone = 0, szStretch = -4, szOne2One = -3, szFitToWidth = -2,
  szFitToPage = -1
}
enum  ViewerMode {
  vmNone = 0, vmNormal = 1, vmBlackAndWhite = 2, vmForeground = 3,
  vmBackground = 4
}

Public Member Functions

virtual void init (HorzAlign inHorzAlign=haNone, VertAlign inVertAlign=vaNone, Color inBgColor=Color::InvalidColor, int inZoom=szNone, ViewerMode inViewerMode=vmNone)=0
virtual bool isDefaultState () const =0
virtual void decode (Stream *inStream, const PageInfo &inPageInfo)=0
virtual void decode (const Chunk *inChunk, const PageInfo &inPageInfo)=0
virtual void decode (const String &inAnnoText, const PageInfo &inPageInfo)=0
virtual void decode (const UChar1 *inAnnoText, size_t inAnnoSize, const PageInfo &inPageInfo)=0
virtual void decode (Stream *inStream)=0
virtual void decode (const Chunk *inChunk)=0
virtual void decode (const String &inAnnoText)=0
virtual void decode (const UChar1 *inAnnoText, size_t inAnnoSize)=0
virtual String encode (const PageInfo &inPageInfo) const =0
virtual void encode (Stream *inStream, const PageInfo &inPageInfo) const =0
virtual AutoPtr< ChunkencodeANTzChunk (const PageInfo &inPageInfo) const =0
virtual AutoPtr< ChunkencodeANTaChunk (const PageInfo &inPageInfo) const =0
virtual String encode () const =0
virtual void encode (Stream *inStream) const =0
virtual AutoPtr< ChunkencodeANTzChunk () const =0
virtual AutoPtr< ChunkencodeANTaChunk () const =0
virtual void merge (const Annotation *inAnno)=0
virtual AutoPtr< Annotationduplicate (bool inDupMapAreas) const =0
virtual Rotation getRotation ()=0
virtual void setRotation (Rotation inRotation)=0

Static Public Member Functions

static AutoPtr< Annotationcreate (HorzAlign inHorzAlign=haNone, VertAlign inVertAlign=vaNone, Color inBgColor=Color::InvalidColor, int inZoom=szNone, ViewerMode inViewerMode=vmNone)
static AutoPtr< Annotationcreate (size_t inWidth, size_t inHeight, HorzAlign inHorzAlign=haNone, VertAlign inVertAlign=vaNone, Color inBgColor=Color::InvalidColor, int inZoom=szNone, ViewerMode inViewerMode=vmNone)
static AutoPtr< Annotationcreate (Stream *inStream, const PageInfo &inPageInfo)
static AutoPtr< Annotationcreate (const Chunk *inChunk, const PageInfo &inPageInfo)
static AutoPtr< Annotationcreate (const String &inAnnoText, const PageInfo &inPageInfo)
static AutoPtr< Annotationcreate (Stream *inStream)
static AutoPtr< Annotationcreate (const Chunk *inChunk)
static AutoPtr< Annotationcreate (const String &inAnnoText)

Public Attributes

HorzAlign horzAlign
VertAlign vertAlign
Color bgColor
int zoom
ViewerMode viewerMode
SimpleArray< AutoPtr< MapArea > > mapAreas
AutoPtr< PropertySetproperties
AutoPtr< PrintHeaderprintHeader
AutoPtr< PrintHeaderprintFooter
String xmp
SimpleArray< Stringothers

Detailed Description

This class is used to manipulate annotation and page attributes.


Member Enumeration Documentation

This enumeration defines the horizontal alignment of the pages.

Enumerator:
haNone 

No specification.

haLeft 

Align to Left.

haCenter 

Align to Center.

haRight 

Align to Right.

This enumeration defines special zoom conditions.

Enumerator:
szNone 

No specification for zoom.

szStretch 

Shown as stretched. The aspect ratio is not retained.

szOne2One 

Shown as 1:1 (Actual pixels).

szFitToWidth 

Shown horizontally fit to the application client area.

szFitToPage 

Whole the page is fit to the application client area.

This enumeration defines the vertical alignment of the pages.

Enumerator:
vaNone 

No specification.

vaTop 

Align to Top.

vaCenter 

Align to Center.

vaBottom 

Align to Bottom.

This enumeration defines the viewer mode.

Enumerator:
vmNone 

No specification for viewer mode.

vmNormal 

Show the pages normally (color).

vmBlackAndWhite 

Show only the mask of the pages.

vmForeground 

Show only the foreground of the pages.

vmBackground 

Show only the background of the pages.


Member Function Documentation

static AutoPtr<Annotation> Celartem::DjVu::Annotation::create ( HorzAlign  inHorzAlign = haNone,
VertAlign  inVertAlign = vaNone,
Color  inBgColor = Color::InvalidColor,
int  inZoom = szNone,
ViewerMode  inViewerMode = vmNone 
) [static]

Initializes Anotation instance with the specified parameters.

Parameters:
inHorzAlign The horizontal alignment of the page. See horzAlign.
inVertAlign The vertical alignment of the page. See vertAlign.
inBgColor The color of the background. See bgColor.
inZoom The zoom ratio of the page. See zoom.
inViewerMode The viewer mode. See viewerMode.
static AutoPtr<Annotation> Celartem::DjVu::Annotation::create ( size_t  inWidth,
size_t  inHeight,
HorzAlign  inHorzAlign = haNone,
VertAlign  inVertAlign = vaNone,
Color  inBgColor = Color::InvalidColor,
int  inZoom = szNone,
ViewerMode  inViewerMode = vmNone 
) [static]

Initializes Anotation instance with the specified parameters.

Parameters:
inWidth The width in pixels.
inHeight The height in pixels.
inHorzAlign The horizontal alignment of the page. See horzAlign.
inVertAlign The vertical alignment of the page. See vertAlign.
inBgColor The color of the background. See bgColor.
inZoom The zoom ratio of the page. See zoom.
inViewerMode The viewer mode. See viewerMode.
static AutoPtr<Annotation> Celartem::DjVu::Annotation::create ( const Chunk inChunk,
const PageInfo inPageInfo 
) [static]

Initializes Anotation instance by loading ANTa or ANTz data from the specified chunk.

Parameters:
inChunk Pointer to a Chunk which contains ANTa or ANTz data.
inPageInfo The dimensions and rotation status of the page is used during decoding ANT* chunk.
static AutoPtr<Annotation> Celartem::DjVu::Annotation::create ( const String inAnnoText  )  [static]

Initializes Anotation instance by loading ANTa style string.
Please note that this constructor cannot deal with mapAreas; if mapAreas has any elements in it, they're simply ignored.

Parameters:
inAnnoText String which contains ANTa data.
static AutoPtr<Annotation> Celartem::DjVu::Annotation::create ( const String inAnnoText,
const PageInfo inPageInfo 
) [static]

Initializes Anotation instance by loading ANTa style string.

Parameters:
inAnnoText String which contains ANTa data.
inPageInfo The dimensions and rotation status of the page is used during decoding ANTa chunk.
static AutoPtr<Annotation> Celartem::DjVu::Annotation::create ( Stream inStream,
const PageInfo inPageInfo 
) [static]

Initializes Anotation instance by loading ANTa data from the specified stream.
If decoding ANTz data in a stream, you should use InflateStream to convert ANTz into ANTa.
This constructor is for advanced purpose and you had better use Annotation(const Chunk*).

Parameters:
inStream Pointer to a Stream which contains ANTa data.
inPageInfo The dimensions and rotation status of the page is used during decoding ANTa chunk.
static AutoPtr<Annotation> Celartem::DjVu::Annotation::create ( Stream inStream  )  [static]

Initializes Anotation instance by loading ANTa data from the specified stream.
If decoding ANTz data in a stream, you should use InflateStream to convert ANTz into ANTa.
This constructor is for advanced purpose and you had better use Annotation(const Chunk*).
Please note that this constructor cannot deal with mapAreas; if mapAreas has any elements in it, they're simply ignored.

Parameters:
inStream Pointer to a Stream which contains ANTa data.
static AutoPtr<Annotation> Celartem::DjVu::Annotation::create ( const Chunk inChunk  )  [static]

Initializes Anotation instance by loading ANTa or ANTz data from the specified chunk.
Please note that this constructor cannot deal with mapAreas; if mapAreas has any elements in it, they're simply ignored.

Parameters:
inStream Pointer to a Stream which contains ANTa data.
virtual void Celartem::DjVu::Annotation::decode ( const Chunk inChunk  )  [pure virtual]

Initializes Anotation instance by loading ANTa or ANTz data from the specified chunk.
Please note that this function cannot deal with mapAreas; if mapAreas has any elements in it, they're simply ignored.

Parameters:
inStream Pointer to a Stream which contains ANTa data.
virtual void Celartem::DjVu::Annotation::decode ( const String inAnnoText  )  [pure virtual]

Initializes Anotation instance by loading ANTa style string.
Please note that this function cannot deal with mapAreas; if mapAreas has any elements in it, they're simply ignored.

Parameters:
inAnnoText String which contains ANTa data.
virtual void Celartem::DjVu::Annotation::decode ( const UChar1 inAnnoText,
size_t  inAnnoSize 
) [pure virtual]

Initializes Anotation instance by loading ANTa style string.
Please note that this function cannot deal with mapAreas; if mapAreas has any elements in it, they're simply ignored.

Parameters:
inAnnoText Pointer to a buffer which contains ANTa data.
inAnnoSize The size of the data.
virtual void Celartem::DjVu::Annotation::decode ( Stream inStream,
const PageInfo inPageInfo 
) [pure virtual]

Initializes Anotation instance by loading ANTa data from the specified stream.
If decoding ANTz data in a stream, you should use InflateStream to convert ANTz into ANTa.
This constructor is for advanced purpose and you had better use Annotation(const Chunk*).

Parameters:
inStream Pointer to a Stream which contains ANTa data.
inPageInfo The dimensions and rotation status of the page is used during decoding ANTa chunk.
virtual void Celartem::DjVu::Annotation::decode ( const Chunk inChunk,
const PageInfo inPageInfo 
) [pure virtual]

Initializes Anotation instance by loading ANTa or ANTz data from the specified chunk.

Parameters:
inStream Pointer to a Stream which contains ANTa data.
inPageInfo The dimensions and rotation status of the page is used during decoding ANT* chunk.
virtual void Celartem::DjVu::Annotation::decode ( const String inAnnoText,
const PageInfo inPageInfo 
) [pure virtual]

Initializes Anotation instance by loading ANTa style string.

Parameters:
inAnnoText String which contains ANTa data.
inPageInfo The dimensions and rotation status of the page is used during decoding ANTa chunk.
virtual void Celartem::DjVu::Annotation::decode ( const UChar1 inAnnoText,
size_t  inAnnoSize,
const PageInfo inPageInfo 
) [pure virtual]

Initializes Anotation instance by loading ANTa style string.

Parameters:
inAnnoText Pointer to a buffer which contains ANTa data.
inAnnoSize The size of the data.
inPageInfo The dimensions and rotation status of the page is used during decoding ANTa chunk.
virtual void Celartem::DjVu::Annotation::decode ( Stream inStream  )  [pure virtual]

Initializes Anotation instance by loading ANTa data from the specified stream.
If decoding ANTz data in a stream, you should use InflateStream to convert ANTz into ANTa.
This constructor is for advanced purpose and you had better use Annotation(const Chunk*).
Please note that this function cannot deal with mapAreas; if mapAreas has any elements in it, they're simply ignored.

Parameters:
inStream Pointer to a Stream which contains ANTa data.
virtual AutoPtr<Annotation> Celartem::DjVu::Annotation::duplicate ( bool  inDupMapAreas  )  const [pure virtual]

Duplicates the instance.

Parameters:
inDupMapAreas Whether to duplicate MapArea instances or not.
If this is false, MapArea instances are not duplicated but their reference counts are incremented.
Returns:
New instance.
virtual String Celartem::DjVu::Annotation::encode (  )  const [pure virtual]

Encodes the instance to the DjVu's ANTa block.
This method is for advanced purpose and for normal purpose, you had better use encodeANTzChunk or encodeANTaChunk. To encode ANTz chunk, you should compress the returned data using DeflateStream.
Please note that this function cannot deal with mapAreas; if mapAreas has any elements in it, they're simply ignored.

Returns:
String which contains ANTa data.
virtual String Celartem::DjVu::Annotation::encode ( const PageInfo inPageInfo  )  const [pure virtual]

Encodes the instance to the DjVu's ANTa block.
This method is for advanced purpose and for normal purpose, you had better use encodeANTzChunk or encodeANTaChunk. To encode ANTz chunk, you should compress the returned data using DeflateStream.

Parameters:
inPageInfo The dimensions and rotation status of the page is used during encoding ANTa chunk.
Returns:
String which contains ANTa data.
virtual void Celartem::DjVu::Annotation::encode ( Stream inStream,
const PageInfo inPageInfo 
) const [pure virtual]

Encodes the instance to the DjVu's ANTa block.
This method is for advanced purpose and for normal purpose, you had better use encodeANTzChunk or encodeANTaChunk. To encode ANTz chunk, you should compress the returned data using DeflateStream.

Parameters:
inStream The stream to write on.
inPageInfo The dimensions and rotation status of the page is used during encoding ANTa chunk.
virtual void Celartem::DjVu::Annotation::encode ( Stream inStream  )  const [pure virtual]

Encodes the instance to the DjVu's ANTa block.
This method is for advanced purpose and for normal purpose, you had better use encodeANTzChunk or encodeANTaChunk. To encode ANTz chunk, you should compress the returned data using DeflateStream.
Please note that this function cannot deal with mapAreas; if mapAreas has any elements in it, they're simply ignored.

Parameters:
inStream The stream to write on.
virtual AutoPtr<Chunk> Celartem::DjVu::Annotation::encodeANTaChunk (  )  const [pure virtual]

Encodes the instance to the DjVu's ANTa chunk.
Please note that this function cannot deal with mapAreas; if mapAreas has any elements in it, they're simply ignored.

Returns:
ANTa Chunk.
virtual AutoPtr<Chunk> Celartem::DjVu::Annotation::encodeANTaChunk ( const PageInfo inPageInfo  )  const [pure virtual]

Encodes the instance to the DjVu's ANTa chunk.

Parameters:
inPageInfo The dimensions and rotation status of the page is used during encoding ANTa chunk.
Returns:
ANTa Chunk.
virtual AutoPtr<Chunk> Celartem::DjVu::Annotation::encodeANTzChunk ( const PageInfo inPageInfo  )  const [pure virtual]

Encodes the instance to the DjVu's ANTz chunk.

Parameters:
inPageInfo The dimensions and rotation status of the page is used during encoding ANTz chunk.
Returns:
ANTz Chunk.
virtual AutoPtr<Chunk> Celartem::DjVu::Annotation::encodeANTzChunk (  )  const [pure virtual]

Encodes the instance to the DjVu's ANTz chunk.
Please note that this function cannot deal with mapAreas; if mapAreas has any elements in it, they're simply ignored.

Returns:
ANTz Chunk.
virtual Rotation Celartem::DjVu::Annotation::getRotation (  )  [pure virtual]

Get the current rotation angle.

Returns:
The current rotation angle.
virtual void Celartem::DjVu::Annotation::init ( HorzAlign  inHorzAlign = haNone,
VertAlign  inVertAlign = vaNone,
Color  inBgColor = Color::InvalidColor,
int  inZoom = szNone,
ViewerMode  inViewerMode = vmNone 
) [pure virtual]

Initializes Annotation instance with the specified values.

virtual bool Celartem::DjVu::Annotation::isDefaultState (  )  const [pure virtual]

Determines whether the annotation attributes are modified from the default (the parameters initialized by the constructors or init method) or not.

Returns:
true if the annotation attributes are not changed from the default state.
virtual void Celartem::DjVu::Annotation::merge ( const Annotation inAnno  )  [pure virtual]

Merges the specified Annotation into this instance.

Parameters:
inAnno Annotation to merge.
Please note that page attributes of this instance are completely overwritten by the ones of inAnno.
virtual void Celartem::DjVu::Annotation::setRotation ( Rotation  inRotation  )  [pure virtual]

Rotate all the MapArea instance.
Please note that this may take long if there're many MapArea instances.

Parameters:
inRotation The resulting rotation angle.
Please note that this is NOT the degrees to rotate but the absolute rotation destination.

Member Data Documentation

Specifies the background color of the page(s).
If this annotation is shared by pages in the DjVu file, it may be overrode by page-by-page annotation.
If the color is invalid (i.e. Color::InvalidColor), the background color is considered to be not specified.

Specifies the horizontal alignment of the page(s).
If this annotation is shared by pages in the DjVu file, it may be overrode by page-by-page annotation.

The mapareas which annotate a page.
It cannot contain any MapArea instances if it is shared annotation.

The annotation strings which cannot be recognized by the system. They're written back to the ANT* chunk on encode method just as a string; no syntax checks on them; you are responsible for these ones.

Print footer.

Print header.

Custom properties, known as Metadata.

Specifies the vertical alignment of the page(s).
If this annotation is shared by pages in the DjVu file, it may be overrode by page-by-page annotation.

Specifies the viewer mode of the viewer.
If this annotation is shared by pages in the DjVu file, it may be overrode by page-by-page annotation.

XMP metadata.

Specifies the zoom ratio either by a value within [1 999] or one of SpecialZoom enumeration values.


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:19.
Caminova Logo