1 // Copyright (C) 2000-2007, Luca Padovani <padovani@sti.uniurb.it>.
2 //
3 // This file is part of GtkMathView, a flexible, high-quality rendering
4 // engine for MathML documents.
5 //
6 // GtkMathView is free software; you can redistribute it and/or modify it
7 // under the terms of the GNU Lesser General Public License as published
8 // by the Free Software Foundation; either version 3 of the License, or
9 // (at your option) any later version.
10 //
11 // GtkMathView is distributed in the hope that it will be useful, but
12 // WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14 // Lesser General Public License for more details.
15 //
16 // You should have received a copy of the GNU Lesser General Public License
17 // along with this program.  If not, see <http://www.gnu.org/licenses/>.
18 
19 #ifndef __MathMLScriptElement_hh__
20 #define __MathMLScriptElement_hh__
21 
22 #include "MathMLEmbellishment.hh"
23 #include "MathMLContainerElement.hh"
24 #include "BinContainerTemplate.hh"
25 
26 class GMV_MathView_EXPORT MathMLScriptElement
27   : public MathMLContainerElement, public MathMLEmbellishment
28 {
29 protected:
30   MathMLScriptElement(const SmartPtr<class MathMLNamespaceContext>&);
31   virtual ~MathMLScriptElement();
32 
33 public:
create(const SmartPtr<class MathMLNamespaceContext> & view)34   static SmartPtr<MathMLScriptElement> create(const SmartPtr<class MathMLNamespaceContext>& view)
35   { return new MathMLScriptElement(view); }
36 
setBase(const SmartPtr<MathMLElement> & child)37   void setBase(const SmartPtr<MathMLElement>& child) { base.setChild(this, child); }
setSubScript(const SmartPtr<MathMLElement> & child)38   void setSubScript(const SmartPtr<MathMLElement>& child) { subScript.setChild(this, child); }
setSuperScript(const SmartPtr<MathMLElement> & child)39   void setSuperScript(const SmartPtr<MathMLElement>& child) { superScript.setChild(this, child); }
getBase(void) const40   SmartPtr<MathMLElement> getBase(void) const { return base.getChild(); }
getSubScript(void) const41   SmartPtr<MathMLElement> getSubScript(void) const { return subScript.getChild(); }
getSuperScript(void) const42   SmartPtr<MathMLElement> getSuperScript(void) const { return superScript.getChild(); }
43 
44   virtual AreaRef format(class FormattingContext&);
45 
46   virtual void setFlagDown(Flags);
47   virtual void resetFlagDown(Flags);
48   virtual SmartPtr<class MathMLOperatorElement> getCoreOperator(void);
49 
50 private:
51   BinContainerTemplate<MathMLScriptElement,MathMLElement> base;
52   BinContainerTemplate<MathMLScriptElement,MathMLElement> subScript;
53   BinContainerTemplate<MathMLScriptElement,MathMLElement> superScript;
54 };
55 
56 #endif // __MathMLScriptElement_hh__
57