• Skip to content
  • Skip to link menu
KDE 3.5 API Reference
  • KDE API Reference
  • API Reference
  • Sitemap
  • Contact Us
 

kviewshell

DjVmDir::File

DjVmDir::File Class Reference

#include <DjVmDir.h>

Inheritance diagram for DjVmDir::File:

Inheritance graph
[legend]

List of all members.


Public Types

enum  FILE_TYPE { INCLUDE = 0, PAGE = 1, THUMBNAILS = 2, SHARED_ANNO = 3 }

Public Member Functions

const GUTF8String & check_save_name (const bool as_bundled)
int get_page_num (void) const
const GUTF8String & get_save_name (void) const
GUTF8String get_str_type (void) const
bool is_include (void) const
bool is_page (void) const
bool is_shared_anno (void) const
bool is_thumbnails (void) const
void set_load_name (const GUTF8String &id)
DjVmDir.h
Files #"DjVmDir.h"# and #"DjVmDir.cpp"# implement class {DjVmDir} for representing the directory of a DjVu multipage document.

{ Bundled vs. Indirect format} --- There are currently two multipage DjVu formats supported: {bundled} and {indirect}. In the first format all component files composing a given document are packaged (or bundled) into one file, in the second one every page and component is stored in a separate file and there is one more file, which contains the list of all others.

{ Multipage DjVu format} --- Multipage DjVu documents follow the EA IFF85 format (cf. {IFFByteStream.h}.) A document is composed of a #"FORM:DJVM"# whose first chunk is a #"DIRM"# chunk containing the {document directory}. This directory lists all component files composing the given document, helps to access every component file and identify the pages of the document. {itemize} In a {bundled} multipage file, the component files are stored immediately after the #"DIRM"# chunk, within the #"FORM:DJVU"# composite chunk. In an {indirect} multipage file, the component files are stored in different files whose URLs are composed using information stored in the #"DIRM"# chunk. {itemize} Most of the component files represent pages of a document. Some files however represent data shared by several pages. The pages refer to these supporting files by means of an inclusion chunk (#"INCL"# chunks) identifying the supporting file.

{ Document Directory} --- Every directory record describes a component file. Each component file is identified by a small string named the identifier (ID). Each component file also contains a file name and a title. The format of the #"DIRM"# chunk is described in section {Format of the DIRM chunk.}.

Theoretically, IDs are used to uniquely identify each component file in #"INCL"# chunks, names are used to compose the the URLs of the component files in an indirect multipage DjVu file, and titles are cosmetic names possibly displayed when viewing a page of a document. There are however many problems with this scheme, and we {strongly suggest}, with the current implementation to always make the file ID, the file name and the file title identical.

Implements DjVu multipage document directory

Author:
Andrei Erofeev <eaf@geocities.com>
Version:
$Id: DjVmDir.h,v 1.10 2003/11/07 22:08:20 leonb Exp $#


const GUTF8String & get_load_name (void) const
const GUTF8String & get_title () const
void set_title (const GUTF8String &id)

Static Public Member Functions

static GP< File > create (const GUTF8String &load_name, const GUTF8String &save_name, const GUTF8String &title, const FILE_TYPE file_type)
static GP< File > create (void)

Public Attributes

int offset
int size
bool valid_name

Protected Member Functions

 File (void)
void set_save_name (const GUTF8String &name)

Protected Attributes

GUTF8String id
GUTF8String name
GUTF8String oldname
GUTF8String title

Detailed Description

Definition at line 223 of file DjVmDir.h.


Member Enumeration Documentation

enum DjVmDir::File::FILE_TYPE

File type.

Possible file types are: {description} [PAGE] This is a top level page file. It may include other INCLUDE::d files, which may in turn be shared between different pages. [INCLUDE] This file is included into some other file inside this document. [THUMBNAILS] This file contains thumbnails for the document pages. [SHARED_ANNO] This file contains annotations shared by all the pages. It's supposed to be included into every page for the annotations to take effect. There may be only one file with shared annotations in a document. {description}

Enumerator:
INCLUDE 
PAGE 
THUMBNAILS 
SHARED_ANNO 

Definition at line 244 of file DjVmDir.h.


Constructor & Destructor Documentation

DjVmDir::File::File ( void   )  [protected]

Default constructor.

Definition at line 180 of file DjVmDir.cpp.


Member Function Documentation

const GUTF8String & DjVmDir::File::check_save_name ( const bool  as_bundled  ) 

Check for filenames that are not valid for the native encoding, and change them.

Definition at line 95 of file DjVmDir.cpp.

GP< DjVmDir::File > DjVmDir::File::create ( const GUTF8String &  load_name,
const GUTF8String &  save_name,
const GUTF8String &  title,
const FILE_TYPE  file_type 
) [static]

Definition at line 81 of file DjVmDir.cpp.

static GP<File> DjVmDir::File::create ( void   )  [inline, static]

Definition at line 250 of file DjVmDir.h.

const GUTF8String & DjVmDir::File::get_load_name ( void   )  const [inline]

File identifier.

The encoder assigns a unique identifier to each file in a multipage document. This is the name used when loading files. Indirection chunks in other files (#"INCL"# chunks) may refer to another file using its identifier.

Definition at line 339 of file DjVmDir.h.

int DjVmDir::File::get_page_num ( void   )  const [inline]

Definition at line 322 of file DjVmDir.h.

const GUTF8String & DjVmDir::File::get_save_name ( void   )  const

File name.

The optional file name must be unique and is the name that will be used when the document is saved to an indirect file. If not assigned, the value of id# will be used for this purpose. By keeping the name in {bundled} document we guarantee, that it can be expanded later into {indirect} document and files will still have the same names, if the name is legal on a given filesystem.

Definition at line 135 of file DjVmDir.cpp.

GUTF8String DjVmDir::File::get_str_type ( void   )  const

Reports an ascii string indicating file type.

Definition at line 184 of file DjVmDir.cpp.

const GUTF8String & DjVmDir::File::get_title (  )  const [inline]

File title.

The file title is assigned by the user and may be used as a shortcut for viewing a particular page. Names like #"chapter1"# or #"appendix"# are appropriate.

Definition at line 343 of file DjVmDir.h.

bool DjVmDir::File::is_include ( void   )  const [inline]

Returns TRUE# if this file is included into some other files of this document.

Definition at line 306 of file DjVmDir.h.

bool DjVmDir::File::is_page ( void   )  const [inline]

Tests if this file represents a page of the document.

Definition at line 299 of file DjVmDir.h.

bool DjVmDir::File::is_shared_anno ( void   )  const [inline]

Returns the page number of this file.

This function returns #-1# if this file does not represent a page of the document.

Definition at line 319 of file DjVmDir.h.

bool DjVmDir::File::is_thumbnails ( void   )  const [inline]

Returns TRUE# if this file contains thumbnails for the document pages.

Definition at line 312 of file DjVmDir.h.

void DjVmDir::File::set_load_name ( const GUTF8String &  id  ) 

Definition at line 141 of file DjVmDir.cpp.

void DjVmDir::File::set_save_name ( const GUTF8String &  name  )  [protected]

Definition at line 152 of file DjVmDir.cpp.

void DjVmDir::File::set_title ( const GUTF8String &  id  )  [inline]

Definition at line 347 of file DjVmDir.h.


Member Data Documentation

GUTF8String DjVmDir::File::id [protected]

Definition at line 327 of file DjVmDir.h.

GUTF8String DjVmDir::File::name [protected]

Definition at line 325 of file DjVmDir.h.

int DjVmDir::File::offset

Offset of the file data in a bundled DJVM file.

This number is relevant in the {bundled} case only when everything is packed into one single file.

Definition at line 287 of file DjVmDir.h.

GUTF8String DjVmDir::File::oldname [protected]

Definition at line 326 of file DjVmDir.h.

int DjVmDir::File::size

Size of the file data in a bundled DJVM file.

This number is relevant in the {bundled} case only when everything is packed into one single file.

Definition at line 292 of file DjVmDir.h.

GUTF8String DjVmDir::File::title [protected]

Definition at line 328 of file DjVmDir.h.

bool DjVmDir::File::valid_name

Have we checked the saved file name, to see if it is valid on the local disk?

Definition at line 296 of file DjVmDir.h.


The documentation for this class was generated from the following files:
  • DjVmDir.h
  • DjVmDir.cpp

kviewshell

Skip menu "kviewshell"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members

API Reference

Skip menu "API Reference"
  • kviewshell
Generated for API Reference by doxygen 1.5.9
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal