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# include <utility>
36# include <vector>
37
38# include "libwps_internal.h"
39
41namespace libwps_tools_win
42{
44class Font
45{
46public:
48 enum Type { MIK,
56
58
64
67 };
68 // CP_10006, CP_10007, CP_10029, CP_10079, CP_10081
70 static unsigned long unicode(unsigned char c, Type type);
72 static librevenge::RVNGString unicodeString(const unsigned char *p, unsigned long size, Type type, bool skipUnknown=true);
74 static librevenge::RVNGString unicodeString(std::string const &text, Type type);
76 static librevenge::RVNGString unicodeString(librevenge::RVNGInputStream *stream, unsigned long size, Type type);
78 static Type getTypeForOEM(int oem);
80 static Type getTypeForString(char const *encoding);
86 static Type getFontType(librevenge::RVNGString &name);
88 static std::vector<std::pair<std::string, std::string> > getFontTypeList();
89
91 static librevenge::RVNGString getTypeName(Type type);
92protected:
93};
94
95// see http://msdn.microsoft.com/en-us/library/bb213877.aspx (Community Content)
97namespace Language
98{
100std::string name(long id);
102std::string localeName(long id);
104void addLocaleName(long id, librevenge::RVNGPropertyList &propList);
106long getDefault();
107}
108
109}
110
111
112#endif
113// vim: set filetype=cpp tabstop=2 shiftwidth=2 cindent autoindent smartindent noexpandtab:
a class to convert a DOS or Windows3 character in unicode
Definition libwps_tools_win.h:45
static librevenge::RVNGString unicodeString(const unsigned char *p, unsigned long size, Type type, bool skipUnknown=true)
converts a list of character in unicode
Definition libwps_tools_win.cpp:7370
Type
enum Type
Definition libwps_tools_win.h:48
@ MAC_ROMANIAN
Definition libwps_tools_win.h:62
@ MAC_TURKISH
Definition libwps_tools_win.h:63
@ WIN3_WINGDINGS
Definition libwps_tools_win.h:65
@ WIN3_BALTIC
Definition libwps_tools_win.h:53
@ MAC_DEVANAGA
Definition libwps_tools_win.h:60
@ MAC_CEUROPE
Definition libwps_tools_win.h:59
@ CP_424
Definition libwps_tools_win.h:49
@ CP_857
Definition libwps_tools_win.h:50
@ CP_874
Definition libwps_tools_win.h:52
@ CP_775
Definition libwps_tools_win.h:49
@ CP_869
Definition libwps_tools_win.h:52
@ CP_437
Definition libwps_tools_win.h:49
@ MAC_SYMBOL
Definition libwps_tools_win.h:65
@ MIK
Definition libwps_tools_win.h:48
@ CP_865
Definition libwps_tools_win.h:51
@ MAC_THAI
Definition libwps_tools_win.h:63
@ MAC_ICELAND
Definition libwps_tools_win.h:62
@ UNKNOWN
Definition libwps_tools_win.h:66
@ CP_950
Definition libwps_tools_win.h:52
@ CP_932
Definition libwps_tools_win.h:52
@ CP_737
Definition libwps_tools_win.h:49
@ WIN3_CYRILLIC
Definition libwps_tools_win.h:54
@ CP_855
Definition libwps_tools_win.h:50
@ MAC_ARABIC
Definition libwps_tools_win.h:59
@ MAC_ROMAN
Definition libwps_tools_win.h:62
@ MAC_GAELIC
Definition libwps_tools_win.h:60
@ CP_856
Definition libwps_tools_win.h:50
@ CP_862
Definition libwps_tools_win.h:51
@ CP_1006
Definition libwps_tools_win.h:52
@ LICS
Definition libwps_tools_win.h:57
@ CP_860
Definition libwps_tools_win.h:50
@ MAC_CELTIC
Definition libwps_tools_win.h:59
@ MAC_GURMUKHI
Definition libwps_tools_win.h:61
@ WIN3_TURKISH
Definition libwps_tools_win.h:54
@ CP_861
Definition libwps_tools_win.h:51
@ WIN3_VIETNAMESE
Definition libwps_tools_win.h:55
@ CP_875
Definition libwps_tools_win.h:52
@ MAC_GUJARATI
Definition libwps_tools_win.h:61
@ MAC_FARSI
Definition libwps_tools_win.h:60
@ WIN3_CEUROPE
Definition libwps_tools_win.h:53
@ WIN3_HEBREW
Definition libwps_tools_win.h:54
@ MAC_GREEK
Definition libwps_tools_win.h:61
@ WIN3_WEUROPE
Definition libwps_tools_win.h:55
@ CP_500
Definition libwps_tools_win.h:49
@ WIN3_GREEK
Definition libwps_tools_win.h:54
@ CP_866
Definition libwps_tools_win.h:51
@ CP_1026
Definition libwps_tools_win.h:53
@ CP_864
Definition libwps_tools_win.h:51
@ MAC_CYRILLIC
Definition libwps_tools_win.h:60
@ MAC_INUIT
Definition libwps_tools_win.h:62
@ MAC_HEBREW
Definition libwps_tools_win.h:61
@ CP_037
Definition libwps_tools_win.h:49
@ CP_852
Definition libwps_tools_win.h:50
@ WIN3_ARABIC
Definition libwps_tools_win.h:53
@ CP_863
Definition libwps_tools_win.h:51
@ DOS_850
Definition libwps_tools_win.h:50
@ MAC_CROATIAN
Definition libwps_tools_win.h:59
static Type getFontType(librevenge::RVNGString &name)
returns the type of the font using the fontName
Definition libwps_tools_win.cpp:39
static Type getTypeForOEM(int oem)
Definition libwps_tools_win.cpp:112
static std::vector< std::pair< std::string, std::string > > getFontTypeList()
returns the list of font type: a pair composed of the font type name and a help string
Definition libwps_tools_win.cpp:388
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:7244
static librevenge::RVNGString getTypeName(Type type)
return the type name
Definition libwps_tools_win.cpp:263
static Type getTypeForString(char const *encoding)
Definition libwps_tools_win.cpp:195
an enum used to define the language in Windows for spell check
Definition libwps_tools_win.h:98
std::string name(long id)
returns the name given Windows id
Definition libwps_tools_win.cpp:7419
long getDefault()
returns the default language: 0x409 : english(US)
Definition libwps_tools_win.cpp:7414
std::string localeName(long id)
returns the simplified locale name
Definition libwps_tools_win.cpp:7510
void addLocaleName(long id, librevenge::RVNGPropertyList &propList)
add locale name (ie. fo:language,fo:country ) to propList
Definition libwps_tools_win.cpp:7597
some Windows classes and tools
Definition libwps_tools_win.cpp:32

Generated on for libwps by doxygen 1.17.0