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

kviewshell

DjVmDir Class Reference

Implements DjVu multipage document directory. More...

#include <DjVmDir.h>

Inheritance diagram for DjVmDir:

Inheritance graph
[legend]

List of all members.


Classes

class  File

Public Member Functions

void decode (const GP< ByteStream > &stream)
void delete_file (const GUTF8String &id)
void encode (const GP< ByteStream > &stream, const bool bundled, const bool do_rename) const
void encode (const GP< ByteStream > &stream, const bool do_rename=false) const
int get_file_pos (const File *f) const
GPList< File > get_files_list (void) const
int get_files_num (void) const
int get_page_pos (int page_num) const
int get_pages_num (void) const
GP< File > get_shared_anno_file (void) const
GP< File > id_to_file (const GUTF8String &id) const
int insert_file (const GP< File > &file, int pos=-1)
bool is_bundled (void) const
bool is_indirect (void) const
GP< File > name_to_file (const GUTF8String &name) const
GP< File > page_to_file (int page_num) const
GPList< File > resolve_duplicates (const bool save_as_bundled)
void set_file_name (const GUTF8String &id, const GUTF8String &name)
void set_file_title (const GUTF8String &id, const GUTF8String &title)
GP< File > title_to_file (const GUTF8String &title) const

Static Public Member Functions

static GP< DjVmDir > create (void)

Static Public Attributes

static const int version = 1

Protected Member Functions

 DjVmDir (void)

Detailed Description

Implements DjVu multipage document directory.

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.

The multipage document directory lists all component files composing the given document, helps to access every file, identify pages and maintain user-specified shortcuts. Every directory record describes a file composing the document. Each file is identified by a small string named the identifier (ID). Each file may also contain a file name and a title.

The DjVmDir# class represents a multipage document directory. Its main purpose is to encode and decode the document directory when writing or reading the DIRM# chunk. Normally you don't have to create this class yourself. It's done automatically when {DjVmDoc} class initializes itself. It may be useful though to be able to access records in the directory because some classes (like {DjVuDocument} and {DjVmDoc}) return a pointer to DjVmDir# in some cases.

Definition at line 152 of file DjVmDir.h.


Constructor & Destructor Documentation

DjVmDir::DjVmDir ( void   )  [inline, protected]

Class {DjVmDir::File} represents the directory records managed by class {DjVmDir}.

Definition at line 157 of file DjVmDir.h.


Member Function Documentation

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

Class {DjVmDir::File} represents the directory records managed by class {DjVmDir}.

Definition at line 165 of file DjVmDir.h.

void DjVmDir::decode ( const GP< ByteStream > &  stream  ) 

Decodes the directory from the specified stream.

Definition at line 213 of file DjVmDir.cpp.

void DjVmDir::delete_file ( const GUTF8String &  id  ) 

Removes a file record with ID id#.

Definition at line 696 of file DjVmDir.cpp.

void DjVmDir::encode ( const GP< ByteStream > &  stream,
const bool  bundled,
const bool  do_rename 
) const

Encodes the directory into the specified stream, explicitely as bundled or indirect.

Definition at line 411 of file DjVmDir.cpp.

void DjVmDir::encode ( const GP< ByteStream > &  stream,
const bool  do_rename = false 
) const

Encodes the directory into the specified stream.

Definition at line 396 of file DjVmDir.cpp.

int DjVmDir::get_file_pos ( const File *  f  )  const

Returns position of the file in the directory.

Definition at line 588 of file DjVmDir.cpp.

GPList< DjVmDir::File > DjVmDir::get_files_list ( void   )  const

Returns a copy of the list of file records.

Definition at line 567 of file DjVmDir.cpp.

int DjVmDir::get_files_num ( void   )  const

Returns the number of file records.

Definition at line 574 of file DjVmDir.cpp.

int DjVmDir::get_page_pos ( int  page_num  )  const

Returns position of the given page in the directory.

Definition at line 599 of file DjVmDir.cpp.

int DjVmDir::get_pages_num ( void   )  const

Returns the number of file records representing pages.

Definition at line 581 of file DjVmDir.cpp.

GP< DjVmDir::File > DjVmDir::get_shared_anno_file ( void   )  const

Returns back pointer to the file with SHARED_ANNO# flag.

Note that there may be only one file with shared annotations in any multipage DjVu document.

Definition at line 608 of file DjVmDir.cpp.

GP< DjVmDir::File > DjVmDir::id_to_file ( const GUTF8String &  id  )  const

Translates file IDs to file records.

Definition at line 549 of file DjVmDir.cpp.

int DjVmDir::insert_file ( const GP< File > &  file,
int  pos = -1 
)

Inserts the specified file record at the specified position.

Specifying pos# equal to #-1# means to append. The actual position inserted is returned.

Definition at line 626 of file DjVmDir.cpp.

bool DjVmDir::is_bundled ( void   )  const [inline]

Tests if the directory defines a {bundled} document.

Definition at line 428 of file DjVmDir.h.

bool DjVmDir::is_indirect ( void   )  const [inline]

Tests if directory defines an {indirect} document.

Definition at line 434 of file DjVmDir.h.

GP< DjVmDir::File > DjVmDir::name_to_file ( const GUTF8String &  name  )  const

Translates file names to file records.

Definition at line 540 of file DjVmDir.cpp.

GP< DjVmDir::File > DjVmDir::page_to_file ( int  page_num  )  const

Translates page numbers to file records.

Definition at line 532 of file DjVmDir.cpp.

GPList< DjVmDir::File > DjVmDir::resolve_duplicates ( const bool  save_as_bundled  ) 

Check for duplicate names, and resolve them.

Definition at line 788 of file DjVmDir.cpp.

void DjVmDir::set_file_name ( const GUTF8String &  id,
const GUTF8String &  name 
)

Changes the name of the file with ID id#.

Definition at line 734 of file DjVmDir.cpp.

void DjVmDir::set_file_title ( const GUTF8String &  id,
const GUTF8String &  title 
)

Changes the title of the file with ID id#.

Definition at line 761 of file DjVmDir.cpp.

GP< DjVmDir::File > DjVmDir::title_to_file ( const GUTF8String &  title  )  const

Translates file shortcuts to file records.

Definition at line 558 of file DjVmDir.cpp.


Member Data Documentation

const int DjVmDir::version = 1 [static]

Definition at line 159 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