// Copyright (C) 2000-2007, Luca Padovani . // // This file is part of GtkMathView, a flexible, high-quality rendering // engine for MathML documents. // // GtkMathView is free software; you can redistribute it and/or modify it // under the terms of the GNU Lesser General Public License as published // by the Free Software Foundation; either version 3 of the License, or // (at your option) any later version. // // GtkMathView is distributed in the hope that it will be useful, but // WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public License // along with this program. If not, see . #ifndef __MathMLMultiScriptsElement_hh__ #define __MathMLMultiScriptsElement_hh__ #include "MathMLEmbellishment.hh" #include "MathMLContainerElement.hh" #include "BinContainerTemplate.hh" #include "LinearContainerTemplate.hh" class GMV_MathView_EXPORT MathMLMultiScriptsElement : public MathMLContainerElement, public MathMLEmbellishment { protected: MathMLMultiScriptsElement(const SmartPtr&); virtual ~MathMLMultiScriptsElement(); public: static SmartPtr create(const SmartPtr& view) { return new MathMLMultiScriptsElement(view); } unsigned getScriptsSize(void) const { return subScript.getSize(); } void setScriptsSize(unsigned size) { subScript.setSize(this, size); } unsigned getPreScriptsSize(void) const { return preSubScript.getSize(); } void setPreScriptsSize(unsigned size) { preSubScript.setSize(this, size); } void setBase(const SmartPtr& child) { base.setChild(this, child); } void setSubScript(unsigned i, const SmartPtr& child) { subScript.setChild(this, i, child); } void setSuperScript(unsigned i, const SmartPtr& child) { superScript.setChild(this, i, child); } void setPreSubScript(unsigned i, const SmartPtr& child) { preSubScript.setChild(this, i, child); } void setPreSuperScript(unsigned i, const SmartPtr& child) { preSuperScript.setChild(this, i, child); } SmartPtr getBase(void) const { return base.getChild(); } SmartPtr getSubScript(unsigned i) const { return subScript.getChild(i); } SmartPtr getSuperScript(unsigned i) const { return superScript.getChild(i); } SmartPtr getPreSubScript(unsigned i) const { return preSubScript.getChild(i); } SmartPtr getPreSuperScript(unsigned i) const { return preSuperScript.getChild(i); } virtual AreaRef format(class FormattingContext&); virtual void setFlagDown(Flags); virtual void resetFlagDown(Flags); virtual SmartPtr getCoreOperator(void); private: static void formatScripts(class FormattingContext&, const std::vector >::const_iterator&, const std::vector >::const_iterator&, std::vector&); BinContainerTemplate base; LinearContainerTemplate subScript; LinearContainerTemplate superScript; LinearContainerTemplate preSubScript; LinearContainerTemplate preSuperScript; scaled subShiftX; scaled subShiftY; scaled superShiftX; scaled superShiftY; }; #endif // __MathMLMultiScriptsElement_hh__