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 2006 Martin Pfeiffer <hubipete@gmx.net> 00005 00006 This library is free software; you can redistribute it and/or 00007 modify it under the terms of the GNU Library General Public 00008 License as published by the Free Software Foundation; either 00009 version 2 of the License, or (at your option) any later version. 00010 00011 This library is distributed in the hope that it will be useful, 00012 but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00014 Library General Public License for more details. 00015 00016 You should have received a copy of the GNU Library General Public License 00017 along with this library; see the file COPYING.LIB. If not, write to 00018 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 00019 Boston, MA 02110-1301, USA. 00020 */ 00021 00022 #ifndef SEQUENCEELEMENT_H 00023 #define SEQUENCEELEMENT_H 00024 00025 #include "BasicElement.h" 00026 00027 namespace KFormula { 00028 00033 class SequenceElement : public BasicElement { 00034 public: 00036 SequenceElement( BasicElement* parent = 0 ); 00037 00039 ~SequenceElement(); 00040 00045 virtual void paint( QPainter& painter ) const; 00046 00047 virtual void calculateSize(); 00048 00054 virtual void insertChild( FormulaCursor* cursor, BasicElement* child ); 00055 00060 virtual void removeChild( BasicElement* element ); 00061 00067 virtual const QList<BasicElement*> childElements(); 00068 00070 BasicElement* childAt( int index ); 00071 00073 int indexOfElement( const BasicElement* element ) const; 00074 00080 virtual void moveLeft( FormulaCursor* cursor, BasicElement* from ); 00081 00087 virtual void moveRight( FormulaCursor* cursor, BasicElement* from ); 00088 00089 virtual void readMathML( const QDomElement& element ); 00090 00091 virtual void writeMathML( KoXmlWriter* writer, bool oasisFormat = false ); 00092 00093 00094 00095 00096 00097 00101 void getChildrenDom( QDomDocument& doc, QDomElement elem, uint from, uint to); 00102 00108 bool buildChildrenFromDom(QList<BasicElement*>& list, QDomNode n); 00109 00110 protected: 00114 virtual QString getTagName() const { return "SEQUENCE"; } 00115 00119 virtual void writeDom(QDomElement element); 00120 00125 virtual bool readAttributesFromDom(QDomElement element); 00126 00132 virtual bool readContentFromDom(QDomNode& node); 00133 00134 private: 00136 QList<BasicElement*> m_sequenceElements; 00137 }; 00138 00139 } // namespace KFormula 00140 00141 #endif // SEQUENCEELEMENT_H