Celartem::DjVu::Link Class Reference

#include <djv_links.h>

List of all members.

Public Types

enum  Type { Empty = 0, Uri = 1, PageNumber = 2, Object = 3 }

Public Member Functions

 Link ()
 Link (const String &inHRef)
 Link (NULL_STRING null)
 Link (size_t inPageNumber)
 Link (const Chunk *inPageChunk)
 Link (const Link &inLink)
Linkoperator= (const Link &inLink)
Linkoperator= (const String &inHRef)
Linkoperator= (size_t inPageNumber)
Linkoperator= (const Chunk *inPageChunk)
Linkoperator= (const NULL_STRING null)
void setLink (const String &inHRef)
void setLink (size_t inPageNumber)
void setLink (const Chunk *inPageChunk)
bool isEmptyLink ()
Type getType () const
size_t getPageNumber (const Chunk *inDJVM=NULL) const
size_t getPageChunkIndex (const Chunk *inDJVM) const

Public Attributes

String href


Detailed Description

This class defines link structure used by Bookmark and MapArea classes.

Definition at line 22 of file djv_links.h.


Member Enumeration Documentation

enum Celartem::DjVu::Link::Type

This enumeration is used to describe the type of the Link instance.

Enumerator:
Empty  The link is empty.

href memeber is empty.

Uri  Any kind of the URIs can be acceptable even if it is supported by the platform which runs the DjVu applications. The method does not verify the actual content of the URL but confirms that it's not starting from #.
PageNumber  href contains a number prefixed by a #. For example, link to the cover page is represented as "#0001".
This link is linked to the page literally indicated by the page number.
Object  The link is to a page or an object.

href contains an internal identifier prefixed by a #.
This link is linked to either a page or an object. Please note that this type of link is "literally" distinguished from PageNumber by assuming that the identifiers do not start from numeric characters; they should not start from numeric characters.

Definition at line 36 of file djv_links.h.


Constructor & Destructor Documentation

Celartem::DjVu::Link::Link (  )  [inline]

Initializes the instance without any parameters.

Definition at line 75 of file djv_links.h.

Celartem::DjVu::Link::Link ( const String inHRef  )  [inline]

Initializes the instance with an URI.

Parameters:
inHRef Any kind of URI or a DjVu specific local links starts with #.

Definition at line 85 of file djv_links.h.

Celartem::DjVu::Link::Link ( NULL_STRING  null  )  [inline]

Initializes the instance with empty string.

Parameters:
null Always NullString.

Definition at line 95 of file djv_links.h.

Celartem::DjVu::Link::Link ( size_t  inPageNumber  )  [inline]

Initializes the instance with a page number.

Parameters:
inPageNumber Page number.

Definition at line 104 of file djv_links.h.

Celartem::DjVu::Link::Link ( const Chunk inPageChunk  )  [inline]

Initializes the instance with a Chunk which contains a page (DJVU).

Parameters:
inPageChunk Pointer to a Chunk of DJVU.

Definition at line 115 of file djv_links.h.

Celartem::DjVu::Link::Link ( const Link inLink  )  [inline]

Duplicates a Link instance.

Parameters:
inLink Link instance to duplicate.

Definition at line 125 of file djv_links.h.


Member Function Documentation

Link& Celartem::DjVu::Link::operator= ( const Link inLink  )  [inline]

Copies a Link instance.

Parameters:
inLink Link instance to copy.

Definition at line 135 of file djv_links.h.

Link& Celartem::DjVu::Link::operator= ( const String inHRef  )  [inline]

Re-initializes the instance with an URI.

Parameters:
inHRef Any kind of URI or a DjVu specific local links starts with #.
Returns:
Reference to this instance.

Definition at line 149 of file djv_links.h.

Link& Celartem::DjVu::Link::operator= ( size_t  inPageNumber  )  [inline]

Re-initializes the instance with a page number.

Parameters:
inPageNumber Page number.
Returns:
Reference to this instance.

Definition at line 162 of file djv_links.h.

Link& Celartem::DjVu::Link::operator= ( const Chunk inPageChunk  )  [inline]

Initializes the instance with a Chunk which contains a page (DJVU).

Parameters:
inPageChunk Pointer to a Chunk of DJVU.

Definition at line 174 of file djv_links.h.

Link& Celartem::DjVu::Link::operator= ( const NULL_STRING  null  )  [inline]

Re-initializes the instance with empty string.

Parameters:
null Always NullString.
Returns:
Reference to this instance.

Definition at line 187 of file djv_links.h.

void Celartem::DjVu::Link::setLink ( const String inHRef  )  [inline]

Sets an URI.

Parameters:
inHRef Any kind of URI or a DjVu specific local links starts with #.

Definition at line 199 of file djv_links.h.

Referenced by Link(), and operator=().

void Celartem::DjVu::Link::setLink ( size_t  inPageNumber  )  [inline]

Sets a page number.

Parameters:
inPageNumber Page number.

Definition at line 209 of file djv_links.h.

void Celartem::DjVu::Link::setLink ( const Chunk inPageChunk  ) 

Sets a Chunk which contains a page (DJVU).

Parameters:
inPageChunk Pointer to a Chunk of DJVU.

bool Celartem::DjVu::Link::isEmptyLink (  )  [inline]

Determines whether the link is empty or not.

Returns:
true if the link is empty; otherwise false.

Definition at line 226 of file djv_links.h.

Type Celartem::DjVu::Link::getType (  )  const [inline]

Returns the type of the Link based on the href value.

Returns:
The returned value is one of the Type values.
See also:
Type.

Definition at line 238 of file djv_links.h.

size_t Celartem::DjVu::Link::getPageNumber ( const Chunk inDJVM = NULL  )  const

Returns the page number (start from 1) of the specified page.

Parameters:
inDJVM If the Type of this link is Page, the page number cannot be determined without DJVM chunk instance.
In other cases, it can be NULL.
Returns:
Returns valid page number if succeeded; otherwise returns 0.

size_t Celartem::DjVu::Link::getPageChunkIndex ( const Chunk inDJVM  )  const

Returns the index of the Chunk which corresponds to the page. param inDJVM Chunk of DJVM which the link is applied for.

Returns:
Returns valid page index if succeeded; otherwise returns notFound.


Member Data Documentation

String Celartem::DjVu::Link::href

This can be any kind of URI usually used with Internet browsers or a special type of links which is privately defined by a DjVu file. See Type, for more information.

Definition at line 30 of file djv_links.h.

Referenced by getType(), isEmptyLink(), operator=(), and setLink().


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.