source: trunk/libdjvu/XMLParser.h @ 426

Last change on this file since 426 was 280, checked in by rbri, 12 years ago

DJVU plugin: djvulibre updated to version 3.5.22

File size: 4.4 KB
Line 
1//C-  -*- C++ -*-
2//C- -------------------------------------------------------------------
3//C- DjVuLibre-3.5
4//C- Copyright (c) 2002  Leon Bottou and Yann Le Cun.
5//C- Copyright (c) 2001  AT&T
6//C-
7//C- This software is subject to, and may be distributed under, the
8//C- GNU General Public License, either Version 2 of the license,
9//C- or (at your option) any later version. The license should have
10//C- accompanied the software or you may obtain a copy of the license
11//C- from the Free Software Foundation at http://www.fsf.org .
12//C-
13//C- This program is distributed in the hope that it will be useful,
14//C- but WITHOUT ANY WARRANTY; without even the implied warranty of
15//C- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16//C- GNU General Public License for more details.
17//C-
18//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library from
19//C- Lizardtech Software.  Lizardtech Software has authorized us to
20//C- replace the original DjVu(r) Reference Library notice by the following
21//C- text (see doc/lizard2002.djvu and doc/lizardtech2007.djvu):
22//C-
23//C-  ------------------------------------------------------------------
24//C- | DjVu (r) Reference Library (v. 3.5)
25//C- | Copyright (c) 1999-2001 LizardTech, Inc. All Rights Reserved.
26//C- | The DjVu Reference Library is protected by U.S. Pat. No.
27//C- | 6,058,214 and patents pending.
28//C- |
29//C- | This software is subject to, and may be distributed under, the
30//C- | GNU General Public License, either Version 2 of the license,
31//C- | or (at your option) any later version. The license should have
32//C- | accompanied the software or you may obtain a copy of the license
33//C- | from the Free Software Foundation at http://www.fsf.org .
34//C- |
35//C- | The computer code originally released by LizardTech under this
36//C- | license and unmodified by other parties is deemed "the LIZARDTECH
37//C- | ORIGINAL CODE."  Subject to any third party intellectual property
38//C- | claims, LizardTech grants recipient a worldwide, royalty-free,
39//C- | non-exclusive license to make, use, sell, or otherwise dispose of
40//C- | the LIZARDTECH ORIGINAL CODE or of programs derived from the
41//C- | LIZARDTECH ORIGINAL CODE in compliance with the terms of the GNU
42//C- | General Public License.   This grant only confers the right to
43//C- | infringe patent claims underlying the LIZARDTECH ORIGINAL CODE to
44//C- | the extent such infringement is reasonably necessary to enable
45//C- | recipient to make, have made, practice, sell, or otherwise dispose
46//C- | of the LIZARDTECH ORIGINAL CODE (or portions thereof) and not to
47//C- | any greater extent that may be necessary to utilize further
48//C- | modifications or combinations.
49//C- |
50//C- | The LIZARDTECH ORIGINAL CODE is provided "AS IS" WITHOUT WARRANTY
51//C- | OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
52//C- | TO ANY WARRANTY OF NON-INFRINGEMENT, OR ANY IMPLIED WARRANTY OF
53//C- | MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
54//C- +------------------------------------------------------------------
55//
56// $Id: XMLParser.h,v 1.11 2008/01/27 11:36:27 leonb Exp $
57// $Name: release_3_5_22 $
58
59#ifndef _LT_XMLPARSER__
60#define _LT_XMLPARSER__
61#ifdef HAVE_CONFIG_H
62#include "config.h"
63#endif
64#if NEED_GNUG_PRAGMAS
65# pragma interface
66#endif
67
68// From: Leon Bottou, 1/31/2002
69// This is purely Lizardtech stuff.
70
71#include "GContainer.h"
72#include "GURL.h"
73
74#ifdef HAVE_NAMESPACES
75namespace DJVU {
76# ifdef NOT_DEFINED // Just to fool emacs c++ mode
77}
78#endif
79#endif
80
81class ByteStream;
82class lt_XMLTags;
83class lt_XMLContents;
84class DjVuFile;
85class DjVuDocument;
86class DjVuImage;
87class GBitmap;
88
89// this is the base class for using XML to change DjVu Docs.
90
91class DJVUAPI lt_XMLParser : public GPEnabled
92{
93public:
94  class Impl;
95  typedef GP<ByteStream> mapOCRcallback(
96    void *,const GUTF8String &value,const GP<DjVuImage> &);
97protected:
98  lt_XMLParser(void);
99  virtual ~lt_XMLParser();
100public:
101  static GP<lt_XMLParser> create(void);
102  /// Parse the specified bytestream.
103  virtual void parse(const GP<ByteStream> &bs) = 0;
104  /// Parse the specified tags - this one does all the work
105  virtual void parse(const lt_XMLTags &tags) = 0;
106  /// write to disk.
107  virtual void save(void) = 0;
108  /// erase.
109  virtual void empty(void) = 0;
110
111  // helper function for args
112  static void setOCRcallback(
113    void * const arg,mapOCRcallback * const );
114};
115
116
117#ifdef HAVE_NAMESPACES
118}
119# ifndef NOT_USING_DJVU_NAMESPACE
120using namespace DJVU;
121# endif
122#endif
123#endif /* _LT_XMLPARSER__ */
124
125
Note: See TracBrowser for help on using the repository browser.