lib

symboltable.h
1/* This file is part of the KDE project
2 Copyright (C) 2001 Andrea Rizzi <rizzi@kde.org>
3 Ulrich Kuettler <ulrich.kuettler@mailbox.tu-dresden.de>
4 Copyright (C) 2006 Alfredo Beaumont Sainz <alfredo.beaumont@gmail.com>
5
6 This library is free software; you can redistribute it and/or
7 modify it under the terms of the GNU Library General Public
8 License as published by the Free Software Foundation; either
9 version 2 of the License, or (at your option) any later version.
10
11 This library is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 Library General Public License for more details.
15
16 You should have received a copy of the GNU Library General Public License
17 along with this library; see the file COPYING.LIB. If not, write to
18 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19 * Boston, MA 02110-1301, USA.
20*/
21
22#ifndef SYMBOLTABLE_H
23#define SYMBOLTABLE_H
24
25#include <tqfont.h>
26#include <tqmap.h>
27#include <tqstring.h>
28#include <tqstringlist.h>
29#include <tqvaluevector.h>
30
31#include "kformuladefs.h"
32
33class TDEConfig;
34
35KFORMULA_NAMESPACE_BEGIN
36
37class ContextStyle;
38struct UnicodeNameTable;
39
43class SymbolFontHelper {
44public:
45
46 SymbolFontHelper();
47
51 TQString greekLetters() const { return greek; }
52
56 TQChar unicodeFromSymbolFont( TQChar pos ) const;
57
58private:
59
63 TQMap<TQChar, TQChar> compatibility;
64
68 TQString greek;
69};
70
71
77class KOFORMULA_EXPORT SymbolTable {
78public:
79
80 SymbolTable();
81
86 void init( const TQFont& font );
87
88 bool contains( TQString name ) const;
89
94 TQChar unicode( TQString name ) const;
95 TQString name( TQChar symbol ) const;
96
97 TQFont font( TQChar symbol, const TQFont& f ) const;
98
99 CharClass charClass( TQChar symbol ) const;
100
104 TQString greekLetters() const;
105
109 TQChar unicodeFromSymbolFont( TQChar pos ) const;
110
114 TQStringList allNames() const;
115
116 typedef TQMap<TQChar, TQString> NameTable;
117 typedef TQMap<TQString, TQChar> EntryTable;
118
119private:
120
121 TQString get_name( UnicodeNameTable entry ) const;
122
126 NameTable names;
127
131 EntryTable entries;
132
136 SymbolFontHelper symbolFontHelper;
137
143 TQFont backupFont;
144};
145
146KFORMULA_NAMESPACE_END
147
148#endif // SYMBOLTABLE_H
Contains all the style information for the formela.
We expect to always have the symbol font.
Definition symboltable.h:43
TQChar unicodeFromSymbolFont(TQChar pos) const
TQString greekLetters() const
Definition symboltable.h:51
void init(const TQFont &font)
lazy init support.
TQChar unicodeFromSymbolFont(TQChar pos) const
TQStringList allNames() const
TQString greekLetters() const
TQChar unicode(TQString name) const