F:/KPlato/koffice/libs/kformula/SpaceElement.h

Aller à la documentation de ce fichier.
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    Copyright (C) 2006 Martin Pfeiffer <hubipete@gmx.net>
00005    Copyright (C) 2006 Alfredo Beaumont Sainz <alfredo.beaumont@gmail.com>
00006 
00007    This library is free software; you can redistribute it and/or
00008    modify it under the terms of the GNU Library General Public
00009    License as published by the Free Software Foundation; either
00010    version 2 of the License, or (at your option) any later version.
00011 
00012    This library is distributed in the hope that it will be useful,
00013    but WITHOUT ANY WARRANTY; without even the implied warranty of
00014    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00015    Library General Public License for more details.
00016 
00017    You should have received a copy of the GNU Library General Public License
00018    along with this library; see the file COPYING.LIB.  If not, write to
00019    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00020    Boston, MA 02110-1301, USA.
00021 */
00022 
00023 #ifndef SPACEELEMENT_H
00024 #define SPACEELEMENT_H
00025 
00026 #include "BasicElement.h"
00027 
00028 namespace KFormula {
00029 
00033 class SpaceElement : public BasicElement {
00034     enum LineBreakType {
00035         NoBreakType,
00036         AutoBreak,
00037         NewLineBreak,
00038         IndentingNewLineBreak,
00039         NoBreak,
00040         GoodBreak,
00041         BadBreak
00042     };
00043 public:
00045     SpaceElement( BasicElement* parent = 0 );
00046 
00052     virtual void calcSizes( const ContextStyle& style,
00053                                                     ContextStyle::TextStyle tstyle,
00054                                                     ContextStyle::IndexStyle istyle,
00055                                                         StyleAttributes& style );
00056 
00063     virtual void draw( QPainter& painter, const LuPixelRect& r,
00064                        const ContextStyle& context,
00065                        ContextStyle::TextStyle tstyle,
00066                        ContextStyle::IndexStyle istyle,
00067                                            StyleAttributes& style,
00068                        const LuPixelPoint& parentOrigin );
00069 
00074     void paint( QPainter& painter ) const;
00075     
00077     void calculateSize();
00078 
00080     void readMathML( const QDomElement& element );
00081 
00083     void writeMathML( KoXmlWriter* writer, bool oasisFormat = false );
00084 
00085 protected:
00089     virtual QString getTagName() const { return "SPACE"; }
00090 
00094     virtual void writeDom(QDomElement element);
00095 
00100     virtual bool readAttributesFromDom(QDomElement element);
00101 
00107     virtual bool readContentFromDom(QDomNode& node);
00112         virtual bool readAttributesFromMathMLDom(const QDomElement& element);
00113 
00114 private:
00115 
00116     virtual QString getElementName() const { return "mspace"; }
00117     virtual void writeMathMLAttributes( QDomElement& element ) const ;
00118 
00122     bool m_tab;
00123 
00124     // MathML Attributes, Section 3.2.7.2
00125     SizeType m_widthType;
00126     double m_width;
00127     SizeType m_heightType;
00128     double m_height;
00129     SizeType m_depthType;
00130     double m_depth;
00131     LineBreakType m_lineBreak;
00132 };
00133 
00134 } // namespace KFormula
00135 
00136 #endif // SPACEELEMENT_H

Généré le Wed Nov 22 23:41:01 2006 pour KPlato par  doxygen 1.5.1-p1