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, bool inOverridePageAttributes)=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 (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
SimpleArray< Stringothers


Detailed Description

This class is used to manipulate annotation and page attributes.

Definition at line 123 of file djv_annotation.h.


Member Enumeration Documentation

enum Celartem::DjVu::Annotation::HorzAlign

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.

Definition at line 129 of file djv_annotation.h.

enum Celartem::DjVu::Annotation::VertAlign

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.

Definition at line 140 of file djv_annotation.h.

enum Celartem::DjVu::Annotation::SpecialZoom

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.

Definition at line 151 of file djv_annotation.h.

enum Celartem::DjVu::Annotation::ViewerMode

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.

Definition at line 163 of file djv_annotation.h.


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 ( 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 ( 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,
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  )  [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.

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.

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::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 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 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 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::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 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 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::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 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 void Celartem::DjVu::Annotation::merge ( const Annotation inAnno,
bool  inOverridePageAttributes 
) [pure virtual]

Merges the specified Annotation into this instance.

Parameters:
inAnno Annotation to merge.
inOverridePageAttributes If the configuration of this conflicts with the one of inAnno, this value controls which one is adopted. If inOverridePageAttributes is true, the values on inAnno are adopted; otherwise, the values of this instance are adopted.

virtual Rotation Celartem::DjVu::Annotation::getRotation (  )  [pure virtual]

Get the current rotation angle.

Returns:
The current rotation angle.

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

HorzAlign Celartem::DjVu::Annotation::horzAlign

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.

Definition at line 177 of file djv_annotation.h.

VertAlign Celartem::DjVu::Annotation::vertAlign

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.

Definition at line 184 of file djv_annotation.h.

Color Celartem::DjVu::Annotation::bgColor

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.

Definition at line 193 of file djv_annotation.h.

int Celartem::DjVu::Annotation::zoom

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

Definition at line 199 of file djv_annotation.h.

ViewerMode Celartem::DjVu::Annotation::viewerMode

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.

Definition at line 206 of file djv_annotation.h.

SimpleArray< AutoPtr<MapArea> > Celartem::DjVu::Annotation::mapAreas

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

Definition at line 213 of file djv_annotation.h.

AutoPtr<PropertySet> Celartem::DjVu::Annotation::properties

Custom properties, known as Metadata.

Definition at line 218 of file djv_annotation.h.

AutoPtr<PrintHeader> Celartem::DjVu::Annotation::printHeader

Print header.

Definition at line 223 of file djv_annotation.h.

AutoPtr<PrintHeader> Celartem::DjVu::Annotation::printFooter

Print footer.

Definition at line 228 of file djv_annotation.h.

SimpleArray<String> Celartem::DjVu::Annotation::others

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.

Definition at line 236 of file djv_annotation.h.


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