Blame libdjvu/DjVuDocEditor.h

Packit df99a1
//C-  -*- C++ -*-
Packit df99a1
//C- -------------------------------------------------------------------
Packit df99a1
//C- DjVuLibre-3.5
Packit df99a1
//C- Copyright (c) 2002  Leon Bottou and Yann Le Cun.
Packit df99a1
//C- Copyright (c) 2001  AT&T
Packit df99a1
//C-
Packit df99a1
//C- This software is subject to, and may be distributed under, the
Packit df99a1
//C- GNU General Public License, either Version 2 of the license,
Packit df99a1
//C- or (at your option) any later version. The license should have
Packit df99a1
//C- accompanied the software or you may obtain a copy of the license
Packit df99a1
//C- from the Free Software Foundation at http://www.fsf.org .
Packit df99a1
//C-
Packit df99a1
//C- This program is distributed in the hope that it will be useful,
Packit df99a1
//C- but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit df99a1
//C- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
Packit df99a1
//C- GNU General Public License for more details.
Packit df99a1
//C- 
Packit df99a1
//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library from
Packit df99a1
//C- Lizardtech Software.  Lizardtech Software has authorized us to
Packit df99a1
//C- replace the original DjVu(r) Reference Library notice by the following
Packit df99a1
//C- text (see doc/lizard2002.djvu and doc/lizardtech2007.djvu):
Packit df99a1
//C-
Packit df99a1
//C-  ------------------------------------------------------------------
Packit df99a1
//C- | DjVu (r) Reference Library (v. 3.5)
Packit df99a1
//C- | Copyright (c) 1999-2001 LizardTech, Inc. All Rights Reserved.
Packit df99a1
//C- | The DjVu Reference Library is protected by U.S. Pat. No.
Packit df99a1
//C- | 6,058,214 and patents pending.
Packit df99a1
//C- |
Packit df99a1
//C- | This software is subject to, and may be distributed under, the
Packit df99a1
//C- | GNU General Public License, either Version 2 of the license,
Packit df99a1
//C- | or (at your option) any later version. The license should have
Packit df99a1
//C- | accompanied the software or you may obtain a copy of the license
Packit df99a1
//C- | from the Free Software Foundation at http://www.fsf.org .
Packit df99a1
//C- |
Packit df99a1
//C- | The computer code originally released by LizardTech under this
Packit df99a1
//C- | license and unmodified by other parties is deemed "the LIZARDTECH
Packit df99a1
//C- | ORIGINAL CODE."  Subject to any third party intellectual property
Packit df99a1
//C- | claims, LizardTech grants recipient a worldwide, royalty-free, 
Packit df99a1
//C- | non-exclusive license to make, use, sell, or otherwise dispose of 
Packit df99a1
//C- | the LIZARDTECH ORIGINAL CODE or of programs derived from the 
Packit df99a1
//C- | LIZARDTECH ORIGINAL CODE in compliance with the terms of the GNU 
Packit df99a1
//C- | General Public License.   This grant only confers the right to 
Packit df99a1
//C- | infringe patent claims underlying the LIZARDTECH ORIGINAL CODE to 
Packit df99a1
//C- | the extent such infringement is reasonably necessary to enable 
Packit df99a1
//C- | recipient to make, have made, practice, sell, or otherwise dispose 
Packit df99a1
//C- | of the LIZARDTECH ORIGINAL CODE (or portions thereof) and not to 
Packit df99a1
//C- | any greater extent that may be necessary to utilize further 
Packit df99a1
//C- | modifications or combinations.
Packit df99a1
//C- |
Packit df99a1
//C- | The LIZARDTECH ORIGINAL CODE is provided "AS IS" WITHOUT WARRANTY
Packit df99a1
//C- | OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
Packit df99a1
//C- | TO ANY WARRANTY OF NON-INFRINGEMENT, OR ANY IMPLIED WARRANTY OF
Packit df99a1
//C- | MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
Packit df99a1
//C- +------------------------------------------------------------------
Packit df99a1
Packit df99a1
#ifndef _DJVUDOCEDITOR_H
Packit df99a1
#define _DJVUDOCEDITOR_H
Packit df99a1
#ifdef HAVE_CONFIG_H
Packit df99a1
#include "config.h"
Packit df99a1
#endif
Packit df99a1
#if NEED_GNUG_PRAGMAS
Packit df99a1
# pragma interface
Packit df99a1
#endif
Packit df99a1
Packit df99a1
Packit df99a1
#include "DjVuDocument.h"
Packit df99a1
#include "DjVmDoc.h"
Packit df99a1
Packit df99a1
#ifdef HAVE_NAMESPACES
Packit df99a1
namespace DJVU {
Packit df99a1
# ifdef NOT_DEFINED // Just to fool emacs c++ mode
Packit df99a1
}
Packit df99a1
#endif
Packit df99a1
#endif
Packit df99a1
Packit df99a1
/** @name DjVuDocEditor.h
Packit df99a1
    Files #"DjVuDocEditor.h"# and #"DjVuDocEditor.cpp"# contain extension
Packit df99a1
    of \Ref{DjVuDocument} class, which can create and modify existing
Packit df99a1
    DjVu document, generate thumbnails, etc. It does {\bf not} do
Packit df99a1
    compression though.
Packit df99a1
Packit df99a1
    @memo DjVu document editor class.
Packit df99a1
    @author Andrei Erofeev <eaf@geocities.com>
Packit df99a1
*/
Packit df99a1
Packit df99a1
//@{
Packit df99a1
Packit df99a1
/** #DjVuDocEditor# is an extension of \Ref{DjVuDocument} class with
Packit df99a1
    additional capabilities for editing the document contents.
Packit df99a1
Packit df99a1
    It can be used to:
Packit df99a1
    \begin{enumerate}
Packit df99a1
       \item Create (compose) new multipage DjVu documents using single
Packit df99a1
             page DjVu documents. The class does {\bf not} do compression.
Packit df99a1
       \item Insert and remove different pages of multipage DjVu documents.
Packit df99a1
       \item Change attributes ({\em names}, {\em IDs} and {\em titles})
Packit df99a1
             of files composing the DjVu document.
Packit df99a1
       \item Generate thumbnail images and integrate them into the document.
Packit df99a1
    \end{enumerate}
Packit df99a1
*/
Packit df99a1
Packit df99a1
class DJVUAPI DjVuDocEditor : public DjVuDocument
Packit df99a1
{
Packit df99a1
public:
Packit df99a1
   static int	thumbnails_per_file;
Packit df99a1
Packit df99a1
protected:
Packit df99a1
      /// Default constructor
Packit df99a1
   DjVuDocEditor(void);
Packit df99a1
Packit df99a1
      /** Initialization function. Initializes an empty document.
Packit df99a1
Packit df99a1
	  {\bf Note}: You must call either of the two
Packit df99a1
	  available \Ref{init}() function before you start doing
Packit df99a1
	  anything else with the #DjVuDocEditor#. */
Packit df99a1
   void		init(void);
Packit df99a1
Packit df99a1
      /** Initialization function. Opens document with name #filename#.
Packit df99a1
Packit df99a1
	  {\bf Note}: You must call either of the two
Packit df99a1
	  available \Ref{init}() function before you start doing
Packit df99a1
	  anything else with the #DjVuDocEditor#. */
Packit df99a1
   void		init(const GURL &url;;
Packit df99a1
Packit df99a1
public:
Packit df99a1
     /** Creates a DjVuDocEditor class and initializes with #fname#. */
Packit df99a1
   static GP<DjVuDocEditor> create_wait(const GURL &url;;
Packit df99a1
Packit df99a1
     /** Creates a DjVuDocEditor class and initializes an empty document. */
Packit df99a1
   static GP<DjVuDocEditor> create_wait(void);
Packit df99a1
Packit df99a1
Packit df99a1
      /// Destructor
Packit df99a1
   virtual ~DjVuDocEditor(void);
Packit df99a1
Packit df99a1
      /** Returns type of open document. #DjVuDocEditor# silently
Packit df99a1
	  converts any open DjVu document to #BUNDLED# format (see
Packit df99a1
	  \Ref{DjVuDocument}. Thus, \Ref{DjVuDocument::get_doc_type}()
Packit df99a1
	  will always be returning #BUNDLED#. Use this function to
Packit df99a1
	  learn the original format of the document being edited. */
Packit df99a1
   int		get_orig_doc_type(void) const;
Packit df99a1
Packit df99a1
      /** Returns #TRUE# if the document can be "saved" (sometimes
Packit df99a1
	  the only possibility is to do a "save as"). The reason why
Packit df99a1
	  we have this function is that #DjVuDocEditor# can save
Packit df99a1
	  documents in new formats only (#BUNDLED# and #INDIRECT#).
Packit df99a1
	  At the same time it recognizes all DjVu formats (#OLD_BUNDLED#,
Packit df99a1
	  #OLD_INDEXED#, #BUNDLED#, and #INDIRECT#).
Packit df99a1
Packit df99a1
	  #OLD_BUNDLED# and #BUNDLED# documents occupy only one file,
Packit df99a1
	  so in this case "saving" involves the automatic conversion
Packit df99a1
	  to #BUNDLED# format and storing data into the same file.
Packit df99a1
Packit df99a1
	  #OLD_INDEXED# documents, on the other hand, occupy more
Packit df99a1
	  than one file. They could be converted to #INDIRECT# format
Packit df99a1
	  if these two formats had the same set of files. Unfortunately,
Packit df99a1
	  these formats are too different, and the best thing to do
Packit df99a1
	  is to use "save as" capability. */
Packit df99a1
   bool		can_be_saved(void) const;
Packit df99a1
Packit df99a1
      /** Returns type of the document, which can be created by
Packit df99a1
	  \Ref{save}() function. Can be #INDIRECT#, #BUNDLED#,
Packit df99a1
	  #SINGLE_PAGE#, or #UNKNOWN_TYPE#. The latter indicates,
Packit df99a1
	  that \Ref{save}() will fail, and that \Ref{save_as}()
Packit df99a1
	  should be used instead */
Packit df99a1
   int		get_save_doc_type(void) const;
Packit df99a1
Packit df99a1
      /** Saves the document. May generate exception if the document
Packit df99a1
	  can not be saved, and \Ref{save_as}() should be used.
Packit df99a1
	  See \Ref{can_be_saved}() for details. */
Packit df99a1
   void		save(void);
Packit df99a1
Packit df99a1
      /** Saves the document. */
Packit df99a1
   virtual void	save_as(const GURL &where, bool bundled);
Packit df99a1
Packit df99a1
      /** Saves the document in the {\em new bundled} format. All the data
Packit df99a1
	  is "bundled" into one file and this file is written into the
Packit df99a1
	  passed stream.
Packit df99a1
Packit df99a1
	  If #force_djvm# is #TRUE# then even one page documents will be
Packit df99a1
	  saved in the #DJVM BUNDLED# format (inside a #FORM:DJVM#);
Packit df99a1
Packit df99a1
	  {\bf Plugin Warning}. This function will read contents of the whole
Packit df99a1
	  document. Thus, if you call it from the main thread (the thread,
Packit df99a1
	  which transfers data from Netscape), the plugin will block. */
Packit df99a1
   virtual void	write(const GP<ByteStream> &str, bool force_djvm=false);
Packit df99a1
     /** Always save as bundled, renaming any files conflicting with the
Packit df99a1
         the names in the supplied GMap. */
Packit df99a1
   virtual void	write(const GP<ByteStream> &str,
Packit df99a1
     const GMap<GUTF8String,void *> &reserved);
Packit df99a1
Packit df99a1
      /** Saves the specified pages in DjVu #BUNDLED# multipage document. */
Packit df99a1
   void		save_pages_as(
Packit df99a1
     const GP<ByteStream> &str, const GList<int> & page_list);
Packit df99a1
Packit df99a1
      /** Translates page number #page_num# to ID. If #page_num# is invalid,
Packit df99a1
	  an exception is thrown. */
Packit df99a1
   GUTF8String	page_to_id(int page_num) const;
Packit df99a1
   
Packit df99a1
   GUTF8String	insert_file(const GURL &url, const GUTF8String &parent_id,
Packit df99a1
			    int chunk_num=1, DjVuPort *source=0);
Packit df99a1
      /** Inserts the referenced file into this DjVu document.
Packit df99a1
Packit df99a1
	  @param fname Name of the top-level file containing the image of
Packit df99a1
	  	 the page to be inserted. This file must be a DjVu file and
Packit df99a1
		 may include one or more other DjVu files.
Packit df99a1
Packit df99a1
		 If it include other DjVu files, the function will try to
Packit df99a1
		 insert them into the document too. Should this attempt fail,
Packit df99a1
		 the corresponding #INCL# chunk will be removed from the
Packit df99a1
		 referencing file and an exception will be thrown.
Packit df99a1
Packit df99a1
		 When inserting a file, the function may modify its name
Packit df99a1
		 to be unique in the DjVu document.
Packit df99a1
	  @param page_num Position where the new page should be inserted at.
Packit df99a1
	  	 Negative value means "append" */
Packit df99a1
   void insert_page(const GURL &fname, int page_num=-1);
Packit df99a1
   /** Inserts a new page with data inside the #data_pool# as page
Packit df99a1
       number #page_num.
Packit df99a1
Packit df99a1
	  @param data_pool \Ref{DataPool} with data for this page.
Packit df99a1
	  @param file_name Name, which will be assigned to this page.
Packit df99a1
	  	 If you try to save the document in #INDIRECT# format,
Packit df99a1
		 a file with this name will be created to hold the
Packit df99a1
		 page's data. If there is already a file in the document
Packit df99a1
		 with the same name, the function will derive a new
Packit df99a1
		 unique name from file_name, which will be assigned
Packit df99a1
		 to the page.
Packit df99a1
	  @param page_num Describes where the page should be inserted.
Packit df99a1
	  	 Negative number means "append". */
Packit df99a1
   void		insert_page(GP<DataPool> & file_pool,
Packit df99a1
			    const GURL &fname, int page_num=-1);
Packit df99a1
      /** Inserts a group of pages into this DjVu document.
Packit df99a1
	  
Packit df99a1
	  Like \Ref{insert_page}() it will insert every page into the document.
Packit df99a1
	  The main advantage of calling this function once for the whole
Packit df99a1
	  group instead of calling \Ref{insert_page}() for every page is
Packit df99a1
	  the processing of included files:
Packit df99a1
Packit df99a1
	  The group of files may include one or more files, which are thus
Packit df99a1
	  shared by them. If you call \Ref{insert_page}() for every page,
Packit df99a1
	  this shared file will be inserted into the document more than once
Packit df99a1
	  though under different names. This is how \Ref{insert_page}() works:
Packit df99a1
	  whenever it inserts something, it checks for duplicate names with
Packit df99a1
	  only one purpose: invent a new name if a given one is already in
Packit df99a1
	  use.
Packit df99a1
Packit df99a1
	  On the other hand, if you call #insert_group#(), it will insert
Packit df99a1
	  shared included files only once. This is because it can analyze
Packit df99a1
	  the group of files before inserting them and figure out what files
Packit df99a1
	  are shared and thus should be inserted only once.
Packit df99a1
Packit df99a1
	  @param fname_list List of top-level files for the pages to be inserted
Packit df99a1
	  @param page_num Position where the new pages should be inserted at.
Packit df99a1
	  	 Negative value means "append" */
Packit df99a1
   void		insert_group(const GList<GURL> & furl_list, int page_num=-1,
Packit df99a1
			     void (* refresh_cb)(void *)=0, void * cl_data=0);
Packit df99a1
      /** Removes the specified page from the document. If #remove_unref#
Packit df99a1
	  is #TRUE#, the function will also remove from the document any file,
Packit df99a1
	  which became unreferenced due to the page's removal */
Packit df99a1
   void		remove_page(int page_num, bool remove_unref=true);
Packit df99a1
      /** Removes the specified pages from the document. If #remove_unref#
Packit df99a1
	  is #TRUE#, the function will also remove from the document any file,
Packit df99a1
	  which became unreferenced due to the pages' removal */
Packit df99a1
   void		remove_pages(const GList<int> & page_list, bool remove_unref=true);
Packit df99a1
      /** Removes a DjVu file with the specified #id#.
Packit df99a1
Packit df99a1
	  If some other files include this file, the corresponding #INCL#
Packit df99a1
	  chunks will be removed to avoid dead links.
Packit df99a1
Packit df99a1
	  If #remove_unref# is #TRUE#, the function will also remove every
Packit df99a1
	  file, which will become unreferenced after the removal of this file. */
Packit df99a1
   void		remove_file(const GUTF8String &id, bool remove_unref=true);
Packit df99a1
      /** Makes page number #page_num# to be #new_page_num#. If #new_page_num#
Packit df99a1
	  is negative or too big, the function will move page #page_num# to
Packit df99a1
	  the end of the document. */
Packit df99a1
   void		move_page(int page_num, int new_page_num);
Packit df99a1
      /** Shifts all pags from the #page_list# according to the #shift#.
Packit df99a1
	  The #shift# can be positive (shift toward the end of the document)
Packit df99a1
	  or negative (shift toward the beginning of the document).
Packit df99a1
Packit df99a1
	  It is OK to make #shift# too big in value. Pages will just be
Packit df99a1
	  moved to the end (or to the beginning, depending on the #shift#
Packit df99a1
	  sign) of the document. */
Packit df99a1
   void		move_pages(const GList<int> & page_list, int shift);
Packit df99a1
   
Packit df99a1
      /** Changes the name of the file with ID #id# to #name#.
Packit df99a1
	  Refer to \Ref{DjVmDir} for the explanation of {\em IDs},
Packit df99a1
          {\em names} and {\em titles}. */
Packit df99a1
   void		set_file_name(const GUTF8String &id, const GUTF8String &name);
Packit df99a1
      /** Changes the name of the page #page_num# to #name#.
Packit df99a1
	  Refer to \Ref{DjVmDir} for the explanation of {\em IDs},
Packit df99a1
          {\em names} and {\em titles}. */
Packit df99a1
   void		set_page_name(int page_num, const GUTF8String &name);
Packit df99a1
      /** Changes the title of the file with ID #id# to #title#.
Packit df99a1
	  Refer to \Ref{DjVmDir} for the explanation of {\em IDs},
Packit df99a1
          {\em names} and {\em titles}. */
Packit df99a1
   void		set_file_title(const GUTF8String &id, const GUTF8String &title);
Packit df99a1
      /** Changes the title of the page #page_num# to #title#.
Packit df99a1
	  Refer to \Ref{DjVmDir} for the explanation of {\em IDs},
Packit df99a1
          {\em names} and {\em titles}. */
Packit df99a1
   void		set_page_title(int page_num, const GUTF8String &title);
Packit df99a1
Packit df99a1
      /** @name Thumbnails */
Packit df99a1
      //@{
Packit df99a1
      /** Returns the number of thumbnails stored inside this document.
Packit df99a1
Packit df99a1
	  It may be #ZERO#, which means, that there are no thumbnails at all.
Packit df99a1
Packit df99a1
	  It may be equal to the number of pages, which is what should
Packit df99a1
	  normally be.
Packit df99a1
Packit df99a1
	  Finally, it may be greater than #ZERO# and less than the number
Packit df99a1
	  of pages, in which case thumbnails should be regenerated before
Packit df99a1
	  the document can be saved. */
Packit df99a1
   int		get_thumbnails_num(void) const;
Packit df99a1
Packit df99a1
      /** Returns the size of the first encountered thumbnail image. Since
Packit df99a1
	  thumbnails can currently be generated by \Ref{generate_thumbnails}()
Packit df99a1
	  only, all thumbnail images should be of the same size. Thus,
Packit df99a1
	  the number returned is actually the size of {\em all}
Packit df99a1
	  document thumbnails.
Packit df99a1
Packit df99a1
	  The function will return #-1# if there are no thumbnails. */
Packit df99a1
   int		get_thumbnails_size(void) const;
Packit df99a1
Packit df99a1
      /** Removes all thumbnails from the document */
Packit df99a1
   void		remove_thumbnails(void);
Packit df99a1
Packit df99a1
      /** Generates thumbnails for the specified page, if and only if
Packit df99a1
          it does not have a thumbnail yet.  If you want to regenerate
Packit df99a1
          thumbnails for all pages, call \Ref{remove_thumbnails}() prior
Packit df99a1
          to calling this function.
Packit df99a1
Packit df99a1
	  @param thumb_size The size of the thumbnails in pixels. DjVu viewer
Packit df99a1
	         is able to rescale the thumbnail images if necessary, so this
Packit df99a1
		 parameter affects thumbnails quality only. 128 is a good number.
Packit df99a1
	  @param page_num The page number to genate the thumbnail for.  */
Packit df99a1
   int		generate_thumbnails(int thumb_size, int page_num);
Packit df99a1
Packit df99a1
      /** Generates thumbnails for those pages, which do not have them yet.
Packit df99a1
	  If you want to regenerate thumbnails for all pages, call
Packit df99a1
	  \Ref{remove_thumbnails}() prior to calling this function.
Packit df99a1
Packit df99a1
	  @param thumb_size The size of the thumbnails in pixels. DjVu viewer
Packit df99a1
	         is able to rescale the thumbnail images if necessary, so this
Packit df99a1
		 parameter affects thumbnails quality only. 128 is a good number.
Packit df99a1
	  @param cb The callback, which will be called after thumbnail image
Packit df99a1
	         for the next page has been generated. Regardless of if
Packit df99a1
		 the document already has thumbnail images for some of its
Packit df99a1
		 pages, the callback will be called #pages_num# times, where
Packit df99a1
		 #pages_num# is the total number of pages in the document.
Packit df99a1
		 The callback should return #FALSE# if thumbnails generating
Packit df99a1
		 should proceed. #TRUE# will stop it. */
Packit df99a1
   void	generate_thumbnails(int thumb_size,
Packit df99a1
                            bool (* cb)(int page_num, void *)=0,
Packit df99a1
                            void * cl_data=0);
Packit df99a1
      //@}
Packit df99a1
      /** Use this function to simplify annotations in the document.
Packit df99a1
        The "simplified" format is when annotations are only allowed
Packit df99a1
        either in top-level page files or in a special file with
Packit df99a1
        #SHARED_ANNO# flag on. This file is supposed to be included into
Packit df99a1
        every page. */
Packit df99a1
   void simplify_anno(void (* progress_cb)(float progress, void *)=0,
Packit df99a1
                      void * cl_data=0);
Packit df99a1
Packit df99a1
      /** Will create a file that will be included into every page and
Packit df99a1
        marked with the #SHARED_ANNO# flag. This file can be used
Packit df99a1
        to store global annotations (annotations applicable to every page).
Packit df99a1
Packit df99a1
        {\bf Note:} There may be only one #SHARED_ANNO# file in any
Packit df99a1
        DjVu multipage document. */
Packit df99a1
   void create_shared_anno_file(void (* progress_cb)(float progress, void *)=0,
Packit df99a1
                                void * cl_data=0);
Packit df99a1
Packit df99a1
      /** Sets bookmark data */
Packit df99a1
   void set_djvm_nav(GP<DjVmNav> nav);
Packit df99a1
Packit df99a1
      /** Returns a pointer to the file with #SHARED_ANNO# flag on.
Packit df99a1
        This file should be used for storing document-wide annotations.
Packit df99a1
Packit df99a1
        {\bf Note:} There may be only one #SHARED_ANNO# file in any
Packit df99a1
        DjVu multipage document. */
Packit df99a1
   GP<DjVuFile>       get_shared_anno_file(void);
Packit df99a1
Packit df99a1
   GURL               get_doc_url(void) const;
Packit df99a1
                                                                              
Packit df99a1
      /** Returns TRUE if #class_name# is #"DjVuDocEditor"#,
Packit df99a1
	  #"DjVuDocument"# or #"DjVuPort"# */
Packit df99a1
   virtual bool		inherits(const GUTF8String &class_name) const;
Packit df99a1
   virtual GP<DataPool>	request_data(const DjVuPort * source, const GURL & url);
Packit df99a1
protected:
Packit df99a1
   virtual GP<DjVuFile>	url_to_file(const GURL & url, bool dont_create) const;
Packit df99a1
   virtual GP<DataPool> get_thumbnail(int page_num, bool dont_decode);
Packit df99a1
   friend class CThumbNails;
Packit df99a1
public:
Packit df99a1
   class File;
Packit df99a1
private:
Packit df99a1
   bool		initialized;
Packit df99a1
   GURL		doc_url;
Packit df99a1
   GP<DataPool>	doc_pool;
Packit df99a1
   int		orig_doc_type;
Packit df99a1
   int		orig_doc_pages;
Packit df99a1
Packit df99a1
   GPMap<GUTF8String, File>	files_map; 	// files_map[id]=GP<File>
Packit df99a1
   GCriticalSection	files_lock;
Packit df99a1
Packit df99a1
   GPMap<GUTF8String,DataPool> thumb_map;
Packit df99a1
   GCriticalSection	thumb_lock;
Packit df99a1
Packit df99a1
   void		(* refresh_cb)(void *);
Packit df99a1
   void		* refresh_cl_data;
Packit df99a1
Packit df99a1
   void		check(void);
Packit df99a1
   GUTF8String	find_unique_id(GUTF8String id);
Packit df99a1
   GP<DataPool>	strip_incl_chunks(const GP<DataPool> & pool);
Packit df99a1
   void		clean_files_map(void);
Packit df99a1
   bool		insert_file_type(const GURL &file_url,
Packit df99a1
                  DjVmDir::File::FILE_TYPE page_type,
Packit df99a1
		  int & file_pos,
Packit df99a1
                  GMap<GUTF8String, GUTF8String> & name2id);
Packit df99a1
   bool		insert_file( const GP<DataPool> &pool,
Packit df99a1
                  const GURL &file_url, bool is_page,
Packit df99a1
		  int & file_pos,
Packit df99a1
                  GMap<GUTF8String,GUTF8String> & name2id,
Packit df99a1
                  DjVuPort *source=0 );
Packit df99a1
   bool		insert_file(
Packit df99a1
                  const GURL &file_url, bool is_page,
Packit df99a1
		  int & file_pos,
Packit df99a1
                  GMap<GUTF8String,GUTF8String> & name2id,
Packit df99a1
                  DjVuPort *source=0 );
Packit df99a1
   void		remove_file(const GUTF8String &id, bool remove_unref,
Packit df99a1
			    GMap<GUTF8String, void *> & ref_map);
Packit df99a1
   void		generate_ref_map(const GP<DjVuFile> & file,
Packit df99a1
				 GMap<GUTF8String, void *> & ref_map,
Packit df99a1
				 GMap<GURL, void *> & visit_map);
Packit df99a1
   void		move_file(const GUTF8String &id, int & file_pos,
Packit df99a1
			  GMap<GUTF8String, void *> & map);
Packit df99a1
   void		unfile_thumbnails(void);
Packit df99a1
   void		file_thumbnails(void);
Packit df99a1
   void	save_file(const GUTF8String &id, const GURL &codebase,
Packit df99a1
     const bool only_modified, GMap<GUTF8String, GUTF8String> & map);
Packit df99a1
   void	save_file(const GUTF8String &id, const GURL &codebase,
Packit df99a1
     GMap<GUTF8String, GUTF8String> & map);
Packit df99a1
};
Packit df99a1
Packit df99a1
//@}
Packit df99a1
Packit df99a1
Packit df99a1
#ifdef HAVE_NAMESPACES
Packit df99a1
}
Packit df99a1
# ifndef NOT_USING_DJVU_NAMESPACE
Packit df99a1
using namespace DJVU;
Packit df99a1
# endif
Packit df99a1
#endif
Packit df99a1
#endif
Packit df99a1