lib

operatordictionary.h
1//
2// Created: Sat Aug 26 20:12:37 2006
3// by: oper-dict.py
4// from: appendixf.html
5//
6// WARNING! All changes made in this file will be lost!
7
8/* This file is part of the KDE project
9 Copyright (C) 2006 Alfredo Beaumont Sainz <alfredo.beaumont@gmail.com>
10
11 This library is free software; you can redistribute it and/or
12 modify it under the terms of the GNU Library General Public
13 License as published by the Free Software Foundation; either
14 version 2 of the License, or (at your option) any later version.
15
16 This library is distributed in the hope that it will be useful,
17 but WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 Library General Public License for more details.
20
21 You should have received a copy of the GNU Library General Public License
22 along with this library; see the file COPYING.LIB. If not, write to
23 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
24 * Boston, MA 02110-1301, USA.
25*/
26
27
28#ifndef OPERATORDICTIONARY_H
29#define OPERATORDICTIONARY_H
30
31#include "kformuladefs.h"
32
33KFORMULA_NAMESPACE_BEGIN
34
35struct DictionaryKey
36{
37 int operator==( const DictionaryKey& right ) const {
38 if ( qstrcmp( name, right.name ) || qstrcmp( form, right.form ) ) {
39 return false;
40 }
41 return true;
42 }
43 const char* name;
44 const char* form;
45};
46
47struct OperatorDictionary {
48 static int size();
49 int operator<( const DictionaryKey& right ) const {
50 int equal = qstrcmp( key.name, right.name );
51 if ( equal != 0 ) {
52 return equal < 0;
53 }
54 return qstrcmp( key.form, right.form ) < 0;
55 }
56 const DictionaryKey key;
57 const char* lspace;
58 const char* rspace;
59 const char* maxsize;
60 const char* minsize;
61 bool fence;
62 bool separator;
63 bool stretchy;
64 bool symmetric;
65 bool largeop;
66 bool movablelimits;
67 bool accent;
68};
69
70extern const OperatorDictionary operators[];
71
72KFORMULA_NAMESPACE_END
73
74#endif // OPERATORDICTIONARY_H
75