libwps_tools_win.h Source File documentation

- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

libwps_tools_win.h
Go to the documentation of this file.
1 /* -*- Mode: C++; c-default-style: "k&r"; indent-tabs-mode: nil; tab-width: 2; c-basic-offset: 2 -*- */
2 /* libwps
3 * Version: MPL 2.0 / LGPLv2.1+
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 *
9 * Major Contributor(s):
10 * Copyright (C) 2009, 2011 Alonso Laurent (alonso@loria.fr)
11 * Copyright (C) 2006, 2007 Andrew Ziem
12 * Copyright (C) 2004-2006 Fridrich Strba (fridrich.strba@bluewin.ch)
13 * Copyright (C) 2004 Marc Maurer (uwog@uwog.net)
14 * Copyright (C) 2003-2005 William Lachance (william.lachance@sympatico.ca)
15 *
16 * For minor contributions see the git repository.
17 *
18 * Alternatively, the contents of this file may be used under the terms
19 * of the GNU Lesser General Public License Version 2.1 or later
20 * (LGPLv2.1+), in which case the provisions of the LGPLv2.1+ are
21 * applicable instead of those above.
22 *
23 * For further information visit http://libwps.sourceforge.net
24 */
25
26 /* This header contains code specific to windows file :
27 * - a class used to convert DOS/Win3 font characters in unicode
28 * - a class used to defined the text Language
29 */
30
31 #ifndef WPS_WIN
32 # define WPS_WIN
33
34 # include <string>
35
36 # include "libwps_internal.h"
37
39 namespace libwps_tools_win
40 {
42 class Font
43 {
44 public:
46 enum Type { CP_037, CP_424, CP_437, CP_500, CP_737, CP_775,
47 DOS_850, CP_852, CP_855, CP_856, CP_857, CP_860,
48 CP_861, CP_862, CP_863, CP_864, CP_865, CP_866,
49 CP_869, CP_874, CP_875, CP_932, CP_950, CP_1006,
50 CP_1026, WIN3_ARABIC, WIN3_BALTIC, WIN3_CEUROPE,
51 WIN3_CYRILLIC, WIN3_GREEK, WIN3_HEBREW, WIN3_TURKISH,
52 WIN3_VIETNAMESE, WIN3_WEUROPE,
53
54 MAC_ARABIC, MAC_CELTIC, MAC_CEUROPE, MAC_CROATIAN,
55 MAC_CYRILLIC, MAC_DEVANAGA, MAC_FARSI, MAC_GAELIC,
56 MAC_GREEK, MAC_GUJARATI, MAC_GURMUKHI, MAC_HEBREW,
57 MAC_ICELAND, MAC_INUIT, MAC_ROMAN, MAC_ROMANIAN,
58 MAC_THAI, MAC_TURKISH,
59
60 MAC_SYMBOL, WIN3_WINGDINGS,
61 UNKNOWN
62 };
63 // CP_10006, CP_10007, CP_10029, CP_10079, CP_10081
65 static unsigned long unicode(unsigned char c, Type type);
67 static unsigned long LICSunicode(unsigned char c, Type type);
69 static Type getTypeForOEM(int oem);
71 static Type getTypeForString(char const *encoding);
77 static Type getFontType(librevenge::RVNGString &name);
79 static librevenge::RVNGString getTypeName(Type type);
80 static librevenge::RVNGString unicodeString(const unsigned char *p, unsigned long size, Type type);
81 protected:
82 };
83
84 // see http://msdn.microsoft.com/en-us/library/bb213877.aspx (Community Content)
86 namespace Language
87 {
89 std::string name(long id);
91 std::string localeName(long id);
93 void addLocaleName(long id, librevenge::RVNGPropertyList &propList);
95 long getDefault();
96 }
97
98 }
99
100
101 #endif
102 // vim: set filetype=cpp tabstop=2 shiftwidth=2 cindent autoindent smartindent noexpandtab:
libwps_tools_win::Font::getFontType
static Type getFontType(librevenge::RVNGString &name)
returns the type of the font using the fontName
Definition: libwps_tools_win.cpp:39
libwps_tools_win::Font::WIN3_WINGDINGS
Definition: libwps_tools_win.h:60
libwps_tools_win::Language::getDefault
long getDefault()
returns the default language: 0x409 : english(US)
Definition: libwps_tools_win.cpp:7291
libwps_tools_win::Font::unicodeString
static librevenge::RVNGString unicodeString(const unsigned char *p, unsigned long size, Type type)
Definition: libwps_tools_win.cpp:7268
libwps_tools_win::Font::WIN3_BALTIC
Definition: libwps_tools_win.h:50
libwps_tools_win::Font::CP_855
Definition: libwps_tools_win.h:47
libwps_tools_win::Font::MAC_ROMAN
Definition: libwps_tools_win.h:57
libwps_tools_win::Font::WIN3_VIETNAMESE
Definition: libwps_tools_win.h:52
libwps_tools_win::Font::MAC_FARSI
Definition: libwps_tools_win.h:55
libwps_tools_win::Font::MAC_GREEK
Definition: libwps_tools_win.h:56
libwps_tools_win::Font::WIN3_TURKISH
Definition: libwps_tools_win.h:51
libwps_tools_win::Font::CP_869
Definition: libwps_tools_win.h:49
libwps_tools_win::Font::CP_862
Definition: libwps_tools_win.h:48
libwps_tools_win::Font::CP_1006
Definition: libwps_tools_win.h:49
libwps_tools_win::Font::MAC_HEBREW
Definition: libwps_tools_win.h:56
libwps_tools_win::Font::CP_865
Definition: libwps_tools_win.h:48
libwps_tools_win::Font::WIN3_ARABIC
Definition: libwps_tools_win.h:50
libwps_tools_win::Font::WIN3_CYRILLIC
Definition: libwps_tools_win.h:51
libwps_tools_win::Font::CP_875
Definition: libwps_tools_win.h:49
libwps_tools_win::Font::Type
Type
enum Type
Definition: libwps_tools_win.h:46
libwps_tools_win::Font::CP_932
Definition: libwps_tools_win.h:49
libwps_tools_win::Font::MAC_DEVANAGA
Definition: libwps_tools_win.h:55
libwps_tools_win::Font::MAC_SYMBOL
Definition: libwps_tools_win.h:60
libwps_tools_win::Font::MAC_ROMANIAN
Definition: libwps_tools_win.h:57
libwps_tools_win::Font::CP_852
Definition: libwps_tools_win.h:47
libwps_tools_win::Font::CP_950
Definition: libwps_tools_win.h:49
libwps_tools_win::Font::MAC_CEUROPE
Definition: libwps_tools_win.h:54
libwps_tools_win::Font::getTypeForOEM
static Type getTypeForOEM(int oem)
Definition: libwps_tools_win.cpp:112
libwps_tools_win::Font::MAC_THAI
Definition: libwps_tools_win.h:58
libwps_tools_win::Font::CP_437
Definition: libwps_tools_win.h:46
libwps_tools_win::Font::WIN3_GREEK
Definition: libwps_tools_win.h:51
libwps_internal.h
libwps_tools_win::Font::WIN3_HEBREW
Definition: libwps_tools_win.h:51
libwps_tools_win::Font::CP_861
Definition: libwps_tools_win.h:48
libwps_tools_win::Language::name
std::string name(long id)
returns the name given Windows© id
Definition: libwps_tools_win.cpp:7296
libwps_tools_win::Font::CP_037
Definition: libwps_tools_win.h:46
libwps_tools_win::Font::CP_866
Definition: libwps_tools_win.h:48
libwps_tools_win::Font::CP_857
Definition: libwps_tools_win.h:47
libwps_tools_win::Font::unicode
static unsigned long unicode(unsigned char c, Type type)
converts a character in unicode, knowing the character and the font type
Definition: libwps_tools_win.cpp:7148
libwps_tools_win::Font::UNKNOWN
Definition: libwps_tools_win.h:61
libwps_tools_win::Font::CP_737
Definition: libwps_tools_win.h:46
libwps_tools_win::Font::CP_860
Definition: libwps_tools_win.h:47
libwps_tools_win::Font::getTypeName
static librevenge::RVNGString getTypeName(Type type)
return the type name
Definition: libwps_tools_win.cpp:258
libwps_tools_win::Font::MAC_GAELIC
Definition: libwps_tools_win.h:55
libwps_tools_win::Font::MAC_CYRILLIC
Definition: libwps_tools_win.h:55
libwps_tools_win::Font::CP_775
Definition: libwps_tools_win.h:46
libwps_tools_win::Font::MAC_GUJARATI
Definition: libwps_tools_win.h:56
libwps_tools_win::Font
a class to convert a DOS© or Windows3© character in unicode
Definition: libwps_tools_win.h:42
libwps_tools_win::Font::MAC_ARABIC
Definition: libwps_tools_win.h:54
libwps_tools_win::Font::LICSunicode
static unsigned long LICSunicode(unsigned char c, Type type)
converts a LICS character in unicode, knowing the character and the font type
Definition: libwps_tools_win.cpp:7131
libwps_tools_win::Font::getTypeForString
static Type getTypeForString(char const *encoding)
Definition: libwps_tools_win.cpp:194
libwps_tools_win::Font::CP_500
Definition: libwps_tools_win.h:46
libwps_tools_win::Font::CP_856
Definition: libwps_tools_win.h:47
libwps_tools_win::Font::CP_1026
Definition: libwps_tools_win.h:50
libwps_tools_win::Font::MAC_ICELAND
Definition: libwps_tools_win.h:57
libwps_tools_win::Font::DOS_850
Definition: libwps_tools_win.h:47
libwps_tools_win
some Windows© classes and tools
Definition: libwps_tools_win.cpp:31
libwps_tools_win::Font::MAC_INUIT
Definition: libwps_tools_win.h:57
libwps_tools_win::Font::CP_874
Definition: libwps_tools_win.h:49
libwps_tools_win::Font::MAC_CELTIC
Definition: libwps_tools_win.h:54
libwps_tools_win::Language::addLocaleName
void addLocaleName(long id, librevenge::RVNGPropertyList &propList)
add locale name (ie. fo:language,fo:country ) to propList
Definition: libwps_tools_win.cpp:7474
libwps_tools_win::Font::CP_864
Definition: libwps_tools_win.h:48
libwps_tools_win::Font::WIN3_CEUROPE
Definition: libwps_tools_win.h:50
libwps_tools_win::Font::MAC_TURKISH
Definition: libwps_tools_win.h:58
libwps_tools_win::Font::WIN3_WEUROPE
Definition: libwps_tools_win.h:52
libwps_tools_win::Font::CP_424
Definition: libwps_tools_win.h:46
libwps_tools_win::Font::MAC_CROATIAN
Definition: libwps_tools_win.h:54
libwps_tools_win::Font::CP_863
Definition: libwps_tools_win.h:48
libwps_tools_win::Language::localeName
std::string localeName(long id)
returns the simplified locale name
Definition: libwps_tools_win.cpp:7387
libwps_tools_win::Font::MAC_GURMUKHI
Definition: libwps_tools_win.h:56