source: trunk/libdjvu/DjVuMessage.h @ 15

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

needed libs update

File size: 5.0 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, Version 2. The license should have
9//C- accompanied the software or you may obtain a copy of the license
10//C- from the Free Software Foundation at http://www.fsf.org .
11//C-
12//C- This program is distributed in the hope that it will be useful,
13//C- but WITHOUT ANY WARRANTY; without even the implied warranty of
14//C- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15//C- GNU General Public License for more details.
16//C-
17//C- DjVuLibre-3.5 is derived from the DjVu(r) Reference Library
18//C- distributed by Lizardtech Software.  On July 19th 2002, Lizardtech
19//C- Software authorized us to replace the original DjVu(r) Reference
20//C- Library notice by the following text (see doc/lizard2002.djvu):
21//C-
22//C-  ------------------------------------------------------------------
23//C- | DjVu (r) Reference Library (v. 3.5)
24//C- | Copyright (c) 1999-2001 LizardTech, Inc. All Rights Reserved.
25//C- | The DjVu Reference Library is protected by U.S. Pat. No.
26//C- | 6,058,214 and patents pending.
27//C- |
28//C- | This software is subject to, and may be distributed under, the
29//C- | GNU General Public License, Version 2. The license should have
30//C- | accompanied the software or you may obtain a copy of the license
31//C- | from the Free Software Foundation at http://www.fsf.org .
32//C- |
33//C- | The computer code originally released by LizardTech under this
34//C- | license and unmodified by other parties is deemed "the LIZARDTECH
35//C- | ORIGINAL CODE."  Subject to any third party intellectual property
36//C- | claims, LizardTech grants recipient a worldwide, royalty-free,
37//C- | non-exclusive license to make, use, sell, or otherwise dispose of
38//C- | the LIZARDTECH ORIGINAL CODE or of programs derived from the
39//C- | LIZARDTECH ORIGINAL CODE in compliance with the terms of the GNU
40//C- | General Public License.   This grant only confers the right to
41//C- | infringe patent claims underlying the LIZARDTECH ORIGINAL CODE to
42//C- | the extent such infringement is reasonably necessary to enable
43//C- | recipient to make, have made, practice, sell, or otherwise dispose
44//C- | of the LIZARDTECH ORIGINAL CODE (or portions thereof) and not to
45//C- | any greater extent that may be necessary to utilize further
46//C- | modifications or combinations.
47//C- |
48//C- | The LIZARDTECH ORIGINAL CODE is provided "AS IS" WITHOUT WARRANTY
49//C- | OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
50//C- | TO ANY WARRANTY OF NON-INFRINGEMENT, OR ANY IMPLIED WARRANTY OF
51//C- | MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
52//C- +------------------------------------------------------------------
53//
54// $Id: DjVuMessage.h,v 1.9 2003/11/07 22:08:21 leonb Exp $
55// $Name: release_3_5_16 $
56
57
58#ifndef __DJVU_MESSAGE_H__
59#define __DJVU_MESSAGE_H__
60#ifdef HAVE_CONFIG_H
61#include "config.h"
62#endif
63#if NEED_GNUG_PRAGMAS
64# pragma interface
65#endif
66
67// From: Leon Bottou, 1/31/2002
68// All these I18N XML messages are Lizardtech innovations.
69// For DjvuLibre, I changed the path extraction logic
70// and added support for non I18N messages.
71
72
73#include "DjVuMessageLite.h"
74
75#ifdef HAVE_NAMESPACES
76namespace DJVU {
77# ifdef NOT_DEFINED // Just to fool emacs c++ mode
78}
79#endif
80#endif
81
82class GURL;
83
84class DjVuMessage : public DjVuMessageLite
85{
86protected:
87  void init(void);
88  DjVuMessage(void);
89
90public:
91  /// Use the locale info and find the XML files on disk.
92  static void use_language(void);
93
94  /// Set the program name used when searching for XML files on disk.
95  static void set_programname(const GUTF8String &programname);
96  static GUTF8String &programname(void);
97
98  /// creates this class specifically.
99  static const DjVuMessageLite &create_full(void);
100
101  /** Adds a byte stream to be parsed whenever the next DjVuMessage::create()
102      call is made. */
103  static void AddByteStreamLater(const GP<ByteStream> &bs)
104  { use_language(); DjVuMessageLite::AddByteStreamLater(bs); }
105
106  /** Destructor: Does any necessary cleanup. Actions depend on how the message
107      file is implemented. */
108  ~DjVuMessage();
109
110  //// Same as LookUp, but this is a static method.
111  static GUTF8String LookUpUTF8( const GUTF8String & MessageList )
112  { use_language();return DjVuMessageLite::LookUpUTF8(MessageList); }
113
114  /** Same as Lookup, but returns a multibyte character string in the
115      current locale. */
116  static GNativeString LookUpNative( const GUTF8String & MessageList )
117  { use_language();return DjVuMessageLite::LookUpNative(MessageList); }
118
119  /// This is a simple alias to the above class, but does an fprintf to stderr.
120  static void perror( const GUTF8String & MessageList )
121  { use_language();DjVuMessageLite::perror(MessageList); }
122
123  static GList<GURL> GetProfilePaths(void);
124};
125
126
127
128#ifdef HAVE_NAMESPACES
129}
130# ifndef NOT_USING_DJVU_NAMESPACE
131using namespace DJVU;
132# endif
133#endif
134#endif /* __DJVU_MESSAGE_H__ */
135
Note: See TracBrowser for help on using the repository browser.