lib

kformulamathmlread.h

00001 /* This file is part of the KDE project
00002    Copyright (C) 2001 Andrea Rizzi <rizzi@kde.org>
00003                   Ulrich Kuettler <ulrich.kuettler@mailbox.tu-dresden.de>
00004 
00005    This library is free software; you can redistribute it and/or
00006    modify it under the terms of the GNU Library General Public
00007    License as published by the Free Software Foundation; either
00008    version 2 of the License, or (at your option) any later version.
00009 
00010    This library is distributed in the hope that it will be useful,
00011    but WITHOUT ANY WARRANTY; without even the implied warranty of
00012    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013    Library General Public License for more details.
00014 
00015    You should have received a copy of the GNU Library General Public License
00016    along with this library; see the file COPYING.LIB.  If not, write to
00017    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00018  * Boston, MA 02110-1301, USA.
00019 */
00020 
00021 #ifndef KFORMULAMATHMLREAD_H
00022 #define KFORMULAMATHMLREAD_H
00023 
00024 #include <qobject.h>
00025 #include <qdom.h>
00026 #include "kformulainputfilter.h"
00027 #include "contextstyle.h"
00028 
00029 KFORMULA_NAMESPACE_BEGIN
00030 
00031 class MathML2KFormulaPrivate;
00032 
00037 class MathML2KFormula : public KFInputFilter
00038 {
00039     Q_OBJECT
00040 
00041     friend class MathML2KFormulaPrivate;
00042 
00043 public:
00044 
00051     MathML2KFormula( const QDomDocument& mmldoc, const ContextStyle &contextStyle, bool oasisFormat = false );
00052 
00057     MathML2KFormula( const QDomElement& mmelm, const ContextStyle &contextStyle, bool oasisFormat = false );
00058 
00059     /*
00060      * Get the just created DOM.
00061      */
00062     virtual QDomDocument getKFormulaDom();
00063 
00064 
00065 public slots:
00066     virtual void startConversion();
00067 
00068 public:
00070     bool m_error;
00071 
00072 private:
00073 
00074     bool processElement( QDomNode node, QDomDocument& doc,
00075                          QDomNode docnode );
00076 
00077     QDomElement orig_element;
00078     QDomDocument formuladoc;
00079     bool oasisFormat;
00080     const ContextStyle& context;
00081 
00082     MathML2KFormulaPrivate* impl;
00083 
00084     enum Type {
00085         // Presentation Markup
00086         UNKNOWN = 1,
00087         TOKEN   = 2, // Token Elements
00088         LAYOUT  = 3, // General Layout Schemata
00089         SCRIPT  = 4, // Script and Limit Schemata
00090         TABLE   = 5, // Tables and Matrices
00091         EE      = 6, // Enlivening Expressions
00092 
00093         // Content Markup
00094         CONTENT = 12
00095     };
00096 };
00097 
00098 KFORMULA_NAMESPACE_END
00099 
00100 #endif // KFORMULAMATHMLREAD_H
KDE Home | KDE Accessibility Home | Description of Access Keys