Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*
3 : : * This file is part of the LibreOffice project.
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 : : * This file incorporates work covered by the following license notice:
10 : : *
11 : : * Licensed to the Apache Software Foundation (ASF) under one or more
12 : : * contributor license agreements. See the NOTICE file distributed
13 : : * with this work for additional information regarding copyright
14 : : * ownership. The ASF licenses this file to you under the Apache
15 : : * License, Version 2.0 (the "License"); you may not use this file
16 : : * except in compliance with the License. You may obtain a copy of
17 : : * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 : : */
19 : :
20 : : #ifndef INCLUDED_SVTOOLS_NFKEYTAB_HXX
21 : : #define INCLUDED_SVTOOLS_NFKEYTAB_HXX
22 : :
23 : : #include <vector>
24 : : #include <tools/string.hxx>
25 : :
26 : : //! For ImpSvNumberformatScan: first the short symbols, then the long symbols!
27 : : //! e.g. first TT then TTTT
28 : : //! The internal order is essentially for the format code string scanner!
29 : : //! New keywords MUST NOT be inserted, only the NF_KEY_UNUSEDn may be used,
30 : : //! NF_KEY_LASTKEYWORD must be adjusted accordingly. Otherwise old versions
31 : : //! will fail upon reading these entries. Nevertheless, old versions are NOT
32 : : //! able to display those new keywords => blank display.
33 : : //
34 : : // Note: 2005-09-02: the above applies to the binary file format.
35 : : //
36 : : // ER 15.12.99: This table is externally only to be used with method
37 : : // String SvNumberformat::GetMappedFormatstring( const NfKeywordTable&, const LocaleDataWrapper& );
38 : : // and method
39 : : // void SvNumberFormatter::FillKeywordTable( NfKeywordTable&, LanguageType );
40 : : enum NfKeywordIndex
41 : : {
42 : : NF_KEY_NONE = 0,
43 : : NF_KEY_E, // exponential symbol
44 : : NF_KEY_AMPM, // AM/PM
45 : : NF_KEY_AP, // a/p
46 : : NF_KEY_MI, // minute (!)
47 : : NF_KEY_MMI, // minute 02 (!)
48 : : NF_KEY_M, // month (!)
49 : : NF_KEY_MM, // month 02 (!)
50 : : NF_KEY_MMM, // month short name
51 : : NF_KEY_MMMM, // month long name
52 : : NF_KEY_H, // hour
53 : : NF_KEY_HH, // hour 02
54 : : NF_KEY_S, // second
55 : : NF_KEY_SS, // second 02
56 : : NF_KEY_Q, // quarter
57 : : NF_KEY_QQ, // quarter 02
58 : : NF_KEY_D, // day of month
59 : : NF_KEY_DD, // day of month 02
60 : : NF_KEY_DDD, // day of week short
61 : : NF_KEY_DDDD, // day of week long
62 : : NF_KEY_YY, // year two digits
63 : : NF_KEY_YYYY, // year four digits
64 : : NF_KEY_NN, // day of week short
65 : : NF_KEY_NNNN, // day of week long with separator
66 : : NF_KEY_CCC, // currency bank symbol (old version)
67 : : NF_KEY_GENERAL, // General / Standard
68 : : NF_KEY_LASTOLDKEYWORD = NF_KEY_GENERAL,
69 : : NF_KEY_NNN, // day of week long without separator, as of version 6, 10.10.97
70 : : NF_KEY_WW, // week of year, as of version 8, 19.06.98
71 : : NF_KEY_MMMMM, // first letter of month name
72 : : NF_KEY_LASTKEYWORD = NF_KEY_MMMMM,
73 : : NF_KEY_UNUSED4,
74 : : NF_KEY_QUARTER, // was quarter word, not used anymore from SRC631 on (26.04.01)
75 : : NF_KEY_TRUE, // boolean true
76 : : NF_KEY_FALSE, // boolean false
77 : : NF_KEY_BOOLEAN, // boolean
78 : : NF_KEY_COLOR, // color
79 : : NF_KEY_FIRSTCOLOR,
80 : : NF_KEY_BLACK = NF_KEY_FIRSTCOLOR, // you do know colors, don't you?
81 : : NF_KEY_BLUE,
82 : : NF_KEY_GREEN,
83 : : NF_KEY_CYAN,
84 : : NF_KEY_RED,
85 : : NF_KEY_MAGENTA,
86 : : NF_KEY_BROWN,
87 : : NF_KEY_GREY,
88 : : NF_KEY_YELLOW,
89 : : NF_KEY_WHITE,
90 : : NF_KEY_LASTCOLOR = NF_KEY_WHITE,
91 : : NF_KEY_LASTKEYWORD_SO5 = NF_KEY_LASTCOLOR,
92 : : //! Keys from here on can't be saved in SO5 file format and MUST be
93 : : //! converted to string which means losing any information.
94 : : NF_KEY_AAA, // abbreviated day name from Japanese Xcl, same as DDD or NN English
95 : : NF_KEY_AAAA, // full day name from Japanese Xcl, same as DDDD or NNN English
96 : : NF_KEY_EC, // E non-gregorian calendar year without preceding 0
97 : : NF_KEY_EEC, // EE non-gregorian calendar year with preceding 0 (two digit)
98 : : NF_KEY_G, // abbreviated era name, latin characters M T S or H for Gengou calendar
99 : : NF_KEY_GG, // abbreviated era name
100 : : NF_KEY_GGG, // full era name
101 : : NF_KEY_R, // acts as EE (Xcl) => GR==GEE, GGR==GGEE, GGGR==GGGEE
102 : : NF_KEY_RR, // acts as GGGEE (Xcl)
103 : : NF_KEY_THAI_T, // Thai T modifier, speciality of Thai Excel, only used with Thai locale and converted to [NatNum1]
104 : : NF_KEYWORD_ENTRIES_COUNT
105 : : };
106 : :
107 : : class NfKeywordTable
108 : : {
109 : : typedef ::std::vector<String> Keywords_t;
110 : : Keywords_t m_keywords;
111 : :
112 : : public:
113 : 2191 : NfKeywordTable() : m_keywords(NF_KEYWORD_ENTRIES_COUNT) {};
114 [ - + ]: 1990 : virtual ~NfKeywordTable() {}
115 : :
116 : 1555571 : String & operator[] (Keywords_t::size_type n) { return m_keywords[n]; }
117 : 12834325 : const String & operator[] (Keywords_t::size_type n) const { return m_keywords[n]; }
118 : : };
119 : :
120 : : #endif // INCLUDED_SVTOOLS_NFKEYTAB_HXX
121 : :
122 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|