Public Types | Public Member Functions | Public Attributes | List of all members
Celartem::DjVu::Link Class Reference

#include <djv_links.h>

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 () const
 
Type getType () const
 
String getCanonicalizedHref () 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.

Member Enumeration Documentation

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

Enumerator
Empty 

The link is empty.

href memeber is empty.

Uri 

The link is by an URL.

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 

The link is by a page number.

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.

Constructor & Destructor Documentation

Celartem::DjVu::Link::Link ( )
inline

Initializes the instance without any parameters.

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

Initializes the instance with an URI.

Parameters
inHRefAny kind of URI or a DjVu specific local links starts with #.
Celartem::DjVu::Link::Link ( NULL_STRING  null)
inline

Initializes the instance with empty string.

Parameters
nullAlways NullString.
Celartem::DjVu::Link::Link ( size_t  inPageNumber)
inline

Initializes the instance with a page number.

Parameters
inPageNumberPage number.
Celartem::DjVu::Link::Link ( const Chunk inPageChunk)
inline

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

Parameters
inPageChunkPointer to a Chunk of DJVU.
Celartem::DjVu::Link::Link ( const Link inLink)
inline

Duplicates a Link instance.

Parameters
inLinkLink instance to duplicate.

Member Function Documentation

String Celartem::DjVu::Link::getCanonicalizedHref ( ) const

Returns canonicalized link.
This method is mainly to deal with invalid relative page links generated by some versions of DjVu Editor.

Returns
Canonicalized link.
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.
size_t Celartem::DjVu::Link::getPageNumber ( const Chunk inDJVM = NULL) const

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

Parameters
inDJVMIf 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.
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.
bool Celartem::DjVu::Link::isEmptyLink ( ) const
inline

Determines whether the link is empty or not.

Returns
true if the link is empty; otherwise false.
Link& Celartem::DjVu::Link::operator= ( const Link inLink)
inline

Copies a Link instance.

Parameters
inLinkLink instance to copy.
Link& Celartem::DjVu::Link::operator= ( const String inHRef)
inline

Re-initializes the instance with an URI.

Parameters
inHRefAny kind of URI or a DjVu specific local links starts with #.
Returns
Reference to this instance.
Link& Celartem::DjVu::Link::operator= ( size_t  inPageNumber)
inline

Re-initializes the instance with a page number.

Parameters
inPageNumberPage number.
Returns
Reference to this instance.
Link& Celartem::DjVu::Link::operator= ( const Chunk inPageChunk)
inline

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

Parameters
inPageChunkPointer to a Chunk of DJVU.
Link& Celartem::DjVu::Link::operator= ( const NULL_STRING  null)
inline

Re-initializes the instance with empty string.

Parameters
nullAlways NullString.
Returns
Reference to this instance.
void Celartem::DjVu::Link::setLink ( const String inHRef)
inline

Sets an URI.

Parameters
inHRefAny kind of URI or a DjVu specific local links starts with #.

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

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

Sets a page number.

Parameters
inPageNumberPage number.
void Celartem::DjVu::Link::setLink ( const Chunk inPageChunk)

Sets a Chunk which contains a page (DJVU).

Parameters
inPageChunkPointer to a Chunk of DJVU.

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.

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


The documentation for this class was generated from the following file:

Cuminas DjVu SDK 3.0.33103
This document is made with doxygen 1.8.5 at Sun Dec 15 2013 19:38:07.
Cuminas Logo