source: trunk/libdjvu/DjVuMessage.h @ 206

Last change on this file since 206 was 206, checked in by Eugene Romanenko, 14 years ago

DJVU plugin: djvulibre updated to version 3.5.19

File size: 5.1 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: DjVuMessage.h,v 1.10 2007/03/25 20:48:30 leonb Exp $
57// $Name: release_3_5_19 $
58
59
60#ifndef __DJVU_MESSAGE_H__
61#define __DJVU_MESSAGE_H__
62#ifdef HAVE_CONFIG_H
63#include "config.h"
64#endif
65#if NEED_GNUG_PRAGMAS
66# pragma interface
67#endif
68
69// From: Leon Bottou, 1/31/2002
70// All these I18N XML messages are Lizardtech innovations.
71// For DjvuLibre, I changed the path extraction logic
72// and added support for non I18N messages.
73
74
75#include "DjVuMessageLite.h"
76
77#ifdef HAVE_NAMESPACES
78namespace DJVU {
79# ifdef NOT_DEFINED // Just to fool emacs c++ mode
80}
81#endif
82#endif
83
84class GURL;
85
86class DjVuMessage : public DjVuMessageLite
87{
88protected:
89  void init(void);
90  DjVuMessage(void);
91
92public:
93  /// Use the locale info and find the XML files on disk.
94  static void use_language(void);
95
96  /// Set the program name used when searching for XML files on disk.
97  static void set_programname(const GUTF8String &programname);
98  static GUTF8String &programname(void);
99
100  /// creates this class specifically.
101  static const DjVuMessageLite &create_full(void);
102
103  /** Adds a byte stream to be parsed whenever the next DjVuMessage::create()
104      call is made. */
105  static void AddByteStreamLater(const GP<ByteStream> &bs)
106  { use_language(); DjVuMessageLite::AddByteStreamLater(bs); }
107
108  /** Destructor: Does any necessary cleanup. Actions depend on how the message
109      file is implemented. */
110  ~DjVuMessage();
111
112  //// Same as LookUp, but this is a static method.
113  static GUTF8String LookUpUTF8( const GUTF8String & MessageList )
114  { use_language();return DjVuMessageLite::LookUpUTF8(MessageList); }
115
116  /** Same as Lookup, but returns a multibyte character string in the
117      current locale. */
118  static GNativeString LookUpNative( const GUTF8String & MessageList )
119  { use_language();return DjVuMessageLite::LookUpNative(MessageList); }
120
121  /// This is a simple alias to the above class, but does an fprintf to stderr.
122  static void perror( const GUTF8String & MessageList )
123  { use_language();DjVuMessageLite::perror(MessageList); }
124
125  static GList<GURL> GetProfilePaths(void);
126};
127
128
129
130#ifdef HAVE_NAMESPACES
131}
132# ifndef NOT_USING_DJVU_NAMESPACE
133using namespace DJVU;
134# endif
135#endif
136#endif /* __DJVU_MESSAGE_H__ */
137
Note: See TracBrowser for help on using the repository browser.