lib Library API Documentation

spaceelement.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., 59 Temple Place - Suite 330,
00018    Boston, MA 02111-1307, USA.
00019 */
00020 
00021 #ifndef SPACEELEMENT_H
00022 #define SPACEELEMENT_H
00023 
00024 #include <qfont.h>
00025 #include <qstring.h>
00026 
00027 #include "basicelement.h"
00028 
00029 class SymbolTable;
00030 
00031 
00032 KFORMULA_NAMESPACE_BEGIN
00033 
00037 class SpaceElement : public BasicElement {
00038     SpaceElement operator=( const SpaceElement& ) { return *this; }
00039 public:
00040 
00041     SpaceElement( SpaceWidth space = THIN, bool tab=false, BasicElement* parent = 0 );
00042     SpaceElement( const SpaceElement& );
00043 
00044     virtual SpaceElement* clone() {
00045         return new SpaceElement( *this );
00046     }
00047 
00048     virtual bool accept( ElementVisitor* visitor );
00049 
00054     //virtual TokenType getTokenType() const;
00055 
00060     virtual QChar getCharacter() const { return ' '; }
00061 
00062     // drawing
00063     //
00064     // Drawing depends on a conspace which knows the required properties like
00065     // fonts, spaces and such.
00066     // It is essential to calculate elements size with the same conspace
00067     // before you draw.
00068 
00073     virtual void calcSizes( const ContextStyle& context,
00074                             ContextStyle::TextStyle tstyle,
00075                             ContextStyle::IndexStyle istyle );
00076 
00082     virtual void draw( QPainter& painter, const LuPixelRect& r,
00083                        const ContextStyle& context,
00084                        ContextStyle::TextStyle tstyle,
00085                        ContextStyle::IndexStyle istyle,
00086                        const LuPixelPoint& parentOrigin );
00087 
00092     //virtual void childWillVanish(FormulaCursor*, BasicElement*) {}
00093 
00098     virtual QString toLatex();
00099 
00100     virtual void writeMathML( QDomDocument doc, QDomNode parent );
00101 
00102 protected:
00103 
00104     //Save/load support
00105 
00109     virtual QString getTagName() const { return "SPACE"; }
00110 
00114     virtual void writeDom(QDomElement element);
00115 
00120     virtual bool readAttributesFromDom(QDomElement element);
00121 
00127     virtual bool readContentFromDom(QDomNode& node);
00128 
00129 private:
00130 
00131     SpaceWidth spaceWidth;
00132 
00136     bool m_tab;
00137 };
00138 
00139 KFORMULA_NAMESPACE_END
00140 
00141 #endif // SPACEELEMENT_H
KDE Logo
This file is part of the documentation for lib Library Version 1.3.5.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Wed Nov 17 13:19:28 2004 by doxygen 1.3.5 written by Dimitri van Heesch, © 1997-2003