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

kviewshell

DjVuDocEditor.h

Go to the documentation of this file.
00001 //C-  -*- C++ -*-
00002 //C- -------------------------------------------------------------------
00003 //C- DjVuLibre-3.5
00004 //C- Copyright (c) 2002  Leon Bottou and Yann Le Cun.
00005 //C- Copyright (c) 2001  AT&T
00006 //C-
00007 //C- This software is subject to, and may be distributed under, the
00008 //C- GNU General Public License, Version 2. The license should have
00009 //C- accompanied the software or you may obtain a copy of the license
00010 //C- from the Free Software Foundation at http://www.fsf.org .
00011 //C-
00012 //C- This program is distributed in the hope that it will be useful,
00013 //C- but WITHOUT ANY WARRANTY; without even the implied warranty of
00014 //C- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015 //C- GNU General Public License for more details.
00016 //C- 
00017 //C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library
00018 //C- distributed by Lizardtech Software.  On July 19th 2002, Lizardtech 
00019 //C- Software authorized us to replace the original DjVu(r) Reference 
00020 //C- Library notice by the following text (see doc/lizard2002.djvu):
00021 //C-
00022 //C-  ------------------------------------------------------------------
00023 //C- | DjVu (r) Reference Library (v. 3.5)
00024 //C- | Copyright (c) 1999-2001 LizardTech, Inc. All Rights Reserved.
00025 //C- | The DjVu Reference Library is protected by U.S. Pat. No.
00026 //C- | 6,058,214 and patents pending.
00027 //C- |
00028 //C- | This software is subject to, and may be distributed under, the
00029 //C- | GNU General Public License, Version 2. The license should have
00030 //C- | accompanied the software or you may obtain a copy of the license
00031 //C- | from the Free Software Foundation at http://www.fsf.org .
00032 //C- |
00033 //C- | The computer code originally released by LizardTech under this
00034 //C- | license and unmodified by other parties is deemed "the LIZARDTECH
00035 //C- | ORIGINAL CODE."  Subject to any third party intellectual property
00036 //C- | claims, LizardTech grants recipient a worldwide, royalty-free, 
00037 //C- | non-exclusive license to make, use, sell, or otherwise dispose of 
00038 //C- | the LIZARDTECH ORIGINAL CODE or of programs derived from the 
00039 //C- | LIZARDTECH ORIGINAL CODE in compliance with the terms of the GNU 
00040 //C- | General Public License.   This grant only confers the right to 
00041 //C- | infringe patent claims underlying the LIZARDTECH ORIGINAL CODE to 
00042 //C- | the extent such infringement is reasonably necessary to enable 
00043 //C- | recipient to make, have made, practice, sell, or otherwise dispose 
00044 //C- | of the LIZARDTECH ORIGINAL CODE (or portions thereof) and not to 
00045 //C- | any greater extent that may be necessary to utilize further 
00046 //C- | modifications or combinations.
00047 //C- |
00048 //C- | The LIZARDTECH ORIGINAL CODE is provided "AS IS" WITHOUT WARRANTY
00049 //C- | OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
00050 //C- | TO ANY WARRANTY OF NON-INFRINGEMENT, OR ANY IMPLIED WARRANTY OF
00051 //C- | MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
00052 //C- +------------------------------------------------------------------
00053 // 
00054 // $Id: DjVuDocEditor.h,v 1.9 2005/05/25 20:24:52 leonb Exp $
00055 // $Name: release_3_5_15 $
00056 
00057 #ifndef _DJVUDOCEDITOR_H
00058 #define _DJVUDOCEDITOR_H
00059 #ifdef HAVE_CONFIG_H
00060 #include "config.h"
00061 #endif
00062 #if NEED_GNUG_PRAGMAS
00063 # pragma interface
00064 #endif
00065 
00066 
00067 #include "DjVuDocument.h"
00068 #include "DjVmDoc.h"
00069 
00070 #ifdef HAVE_NAMESPACES
00071 namespace DJVU {
00072 # ifdef NOT_DEFINED // Just to fool emacs c++ mode
00073 }
00074 #endif
00075 #endif
00076 
00089 
00104 class DjVuDocEditor : public DjVuDocument
00105 {
00106 public:
00107    static int   thumbnails_per_file;
00108 
00109 protected:
00111    DjVuDocEditor(void);
00112 
00118    void     init(void);
00119 
00125    void     init(const GURL &url);
00126 
00127 public:
00129    static GP<DjVuDocEditor> create_wait(const GURL &url);
00130 
00132    static GP<DjVuDocEditor> create_wait(void);
00133 
00134 
00136    virtual ~DjVuDocEditor(void);
00137 
00143    int      get_orig_doc_type(void) const;
00144 
00161    bool     can_be_saved(void) const;
00162 
00168    int      get_save_doc_type(void) const;
00169 
00173    void     save(void);
00174 
00176    virtual void save_as(const GURL &where, bool bundled);
00177 
00188    virtual void write(const GP<ByteStream> &str, bool force_djvm=false);
00191    virtual void write(const GP<ByteStream> &str,
00192      const GMap<GUTF8String,void *> &reserved);
00193 
00195    void     save_pages_as(
00196      const GP<ByteStream> &str, const GList<int> & page_list);
00197 
00200    GUTF8String  page_to_id(int page_num) const;
00201    
00202    GUTF8String  insert_file(const GURL &url, const GUTF8String &parent_id,
00203                 int chunk_num=1, DjVuPort *source=0);
00219    void insert_page(const GURL &fname, int page_num=-1);
00233    void     insert_page(GP<DataPool> & file_pool,
00234                 const GURL &fname, int page_num=-1);
00258    void     insert_group(const GList<GURL> & furl_list, int page_num=-1,
00259                  void (* refresh_cb)(void *)=0, void * cl_data=0);
00263    void     remove_page(int page_num, bool remove_unref=true);
00267    void     remove_pages(const GList<int> & page_list, bool remove_unref=true);
00275    void     remove_file(const GUTF8String &id, bool remove_unref=true);
00279    void     move_page(int page_num, int new_page_num);
00287    void     move_pages(const GList<int> & page_list, int shift);
00288    
00292    void     set_file_name(const GUTF8String &id, const GUTF8String &name);
00296    void     set_page_name(int page_num, const GUTF8String &name);
00300    void     set_file_title(const GUTF8String &id, const GUTF8String &title);
00304    void     set_page_title(int page_num, const GUTF8String &title);
00305 
00318    int      get_thumbnails_num(void) const;
00319 
00327    int      get_thumbnails_size(void) const;
00328 
00330    void     remove_thumbnails(void);
00331 
00341    int      generate_thumbnails(int thumb_size, int page_num);
00342 
00357    void generate_thumbnails(int thumb_size,
00358                             bool (* cb)(int page_num, void *)=0,
00359                             void * cl_data=0);
00361 
00366    void simplify_anno(void (* progress_cb)(float progress, void *)=0,
00367                       void * cl_data=0);
00368 
00375    void create_shared_anno_file(void (* progress_cb)(float progress, void *)=0,
00376                                 void * cl_data=0);
00377 
00379    void set_djvm_nav(GP<DjVmNav> nav);
00380 
00386    GP<DjVuFile>       get_shared_anno_file(void);
00387 
00388    GURL               get_doc_url(void) const;
00389                                                                               
00392    virtual bool     inherits(const GUTF8String &class_name) const;
00393    virtual GP<DataPool> request_data(const DjVuPort * source, const GURL & url);
00394 protected:
00395    virtual GP<DjVuFile> url_to_file(const GURL & url, bool dont_create) const;
00396    virtual GP<DataPool> get_thumbnail(int page_num, bool dont_decode);
00397    friend class CThumbNails;
00398 public:
00399    class File;
00400 private:
00401    bool     initialized;
00402    GURL     doc_url;
00403    GP<DataPool> doc_pool;
00404    GURL     tmp_doc_url;
00405    int      orig_doc_type;
00406    int      orig_doc_pages;
00407 
00408    GPMap<GUTF8String, File> files_map;  // files_map[id]=GP<File>
00409    GCriticalSection files_lock;
00410 
00411    GPMap<GUTF8String,DataPool> thumb_map;
00412    GCriticalSection thumb_lock;
00413 
00414    void     (* refresh_cb)(void *);
00415    void     * refresh_cl_data;
00416 
00417    void     check(void);
00418    GUTF8String  find_unique_id(GUTF8String id);
00419    GP<DataPool> strip_incl_chunks(const GP<DataPool> & pool);
00420    void     clean_files_map(void);
00421    bool     insert_file_type(const GURL &file_url,
00422                   DjVmDir::File::FILE_TYPE page_type,
00423           int & file_pos,
00424                   GMap<GUTF8String, GUTF8String> & name2id);
00425    bool     insert_file( const GP<DataPool> &pool,
00426                   const GURL &file_url, bool is_page,
00427           int & file_pos,
00428                   GMap<GUTF8String,GUTF8String> & name2id,
00429                   DjVuPort *source=0 );
00430    bool     insert_file(
00431                   const GURL &file_url, bool is_page,
00432           int & file_pos,
00433                   GMap<GUTF8String,GUTF8String> & name2id,
00434                   DjVuPort *source=0 );
00435    void     remove_file(const GUTF8String &id, bool remove_unref,
00436                 GMap<GUTF8String, void *> & ref_map);
00437    void     generate_ref_map(const GP<DjVuFile> & file,
00438                  GMap<GUTF8String, void *> & ref_map,
00439                  GMap<GURL, void *> & visit_map);
00440    void     move_file(const GUTF8String &id, int & file_pos,
00441               GMap<GUTF8String, void *> & map);
00442    void     unfile_thumbnails(void);
00443    void     file_thumbnails(void);
00444    void save_file(const GUTF8String &id, const GURL &codebase,
00445      const bool only_modified, GMap<GUTF8String, GUTF8String> & map);
00446    void save_file(const GUTF8String &id, const GURL &codebase,
00447      GMap<GUTF8String, GUTF8String> & map);
00448 };
00449 
00451 
00452 
00453 #ifdef HAVE_NAMESPACES
00454 }
00455 # ifndef NOT_USING_DJVU_NAMESPACE
00456 using namespace DJVU;
00457 # endif
00458 #endif
00459 #endif
00460 

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