1*cdf0e10cSrcweir /************************************************************************* 2*cdf0e10cSrcweir * 3*cdf0e10cSrcweir * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4*cdf0e10cSrcweir * 5*cdf0e10cSrcweir * Copyright 2000, 2010 Oracle and/or its affiliates. 6*cdf0e10cSrcweir * 7*cdf0e10cSrcweir * OpenOffice.org - a multi-platform office productivity suite 8*cdf0e10cSrcweir * 9*cdf0e10cSrcweir * This file is part of OpenOffice.org. 10*cdf0e10cSrcweir * 11*cdf0e10cSrcweir * OpenOffice.org is free software: you can redistribute it and/or modify 12*cdf0e10cSrcweir * it under the terms of the GNU Lesser General Public License version 3 13*cdf0e10cSrcweir * only, as published by the Free Software Foundation. 14*cdf0e10cSrcweir * 15*cdf0e10cSrcweir * OpenOffice.org is distributed in the hope that it will be useful, 16*cdf0e10cSrcweir * but WITHOUT ANY WARRANTY; without even the implied warranty of 17*cdf0e10cSrcweir * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18*cdf0e10cSrcweir * GNU Lesser General Public License version 3 for more details 19*cdf0e10cSrcweir * (a copy is included in the LICENSE file that accompanied this code). 20*cdf0e10cSrcweir * 21*cdf0e10cSrcweir * You should have received a copy of the GNU Lesser General Public License 22*cdf0e10cSrcweir * version 3 along with OpenOffice.org. If not, see 23*cdf0e10cSrcweir * <http://www.openoffice.org/license.html> 24*cdf0e10cSrcweir * for a copy of the LGPLv3 License. 25*cdf0e10cSrcweir * 26*cdf0e10cSrcweir ************************************************************************/ 27*cdf0e10cSrcweir 28*cdf0e10cSrcweir 29*cdf0e10cSrcweir #ifndef NODE_HXX 30*cdf0e10cSrcweir #define NODE_HXX 31*cdf0e10cSrcweir 32*cdf0e10cSrcweir 33*cdf0e10cSrcweir #include <vector> 34*cdf0e10cSrcweir 35*cdf0e10cSrcweir #include "parse.hxx" 36*cdf0e10cSrcweir #include "types.hxx" 37*cdf0e10cSrcweir #include "rect.hxx" 38*cdf0e10cSrcweir #include "format.hxx" 39*cdf0e10cSrcweir 40*cdf0e10cSrcweir 41*cdf0e10cSrcweir #define ATTR_BOLD 0x0001 42*cdf0e10cSrcweir #define ATTR_ITALIC 0x0002 43*cdf0e10cSrcweir 44*cdf0e10cSrcweir #define FNTSIZ_ABSOLUT 1 45*cdf0e10cSrcweir #define FNTSIZ_PLUS 2 46*cdf0e10cSrcweir #define FNTSIZ_MINUS 3 47*cdf0e10cSrcweir #define FNTSIZ_MULTIPLY 4 48*cdf0e10cSrcweir #define FNTSIZ_DIVIDE 5 49*cdf0e10cSrcweir 50*cdf0e10cSrcweir // flags to interdict respective status changes 51*cdf0e10cSrcweir #define FLG_FONT 0x0001 52*cdf0e10cSrcweir #define FLG_SIZE 0x0002 53*cdf0e10cSrcweir #define FLG_BOLD 0x0004 54*cdf0e10cSrcweir #define FLG_ITALIC 0x0008 55*cdf0e10cSrcweir #define FLG_COLOR 0x0010 56*cdf0e10cSrcweir #define FLG_VISIBLE 0x0020 57*cdf0e10cSrcweir #define FLG_HORALIGN 0x0040 58*cdf0e10cSrcweir 59*cdf0e10cSrcweir 60*cdf0e10cSrcweir extern SmFormat *pActiveFormat; 61*cdf0e10cSrcweir 62*cdf0e10cSrcweir class SmDocShell; 63*cdf0e10cSrcweir class SmNode; 64*cdf0e10cSrcweir class SmStructureNode; 65*cdf0e10cSrcweir 66*cdf0e10cSrcweir typedef std::vector< SmNode * > SmNodeArray; 67*cdf0e10cSrcweir typedef std::vector< SmStructureNode * > SmStructureNodeArray; 68*cdf0e10cSrcweir 69*cdf0e10cSrcweir 70*cdf0e10cSrcweir //////////////////////////////////////////////////////////////////////////////// 71*cdf0e10cSrcweir 72*cdf0e10cSrcweir enum SmScaleMode { SCALE_NONE, SCALE_WIDTH, SCALE_HEIGHT }; 73*cdf0e10cSrcweir 74*cdf0e10cSrcweir enum SmNodeType 75*cdf0e10cSrcweir { 76*cdf0e10cSrcweir NTABLE, NBRACE, NBRACEBODY, NOPER, NALIGN, 77*cdf0e10cSrcweir NATTRIBUT, NFONT, NUNHOR, NBINHOR, NBINVER, 78*cdf0e10cSrcweir NBINDIAGONAL, NSUBSUP, NMATRIX, NPLACE, NTEXT, 79*cdf0e10cSrcweir NSPECIAL, NGLYPH_SPECIAL, NMATH, NBLANK, NERROR, 80*cdf0e10cSrcweir NLINE, NEXPRESSION, NPOLYLINE, NROOT, NROOTSYMBOL, 81*cdf0e10cSrcweir NRECTANGLE, NVERTICAL_BRACE 82*cdf0e10cSrcweir }; 83*cdf0e10cSrcweir 84*cdf0e10cSrcweir 85*cdf0e10cSrcweir //////////////////////////////////////////////////////////////////////////////// 86*cdf0e10cSrcweir 87*cdf0e10cSrcweir 88*cdf0e10cSrcweir class SmNode : public SmRect 89*cdf0e10cSrcweir { 90*cdf0e10cSrcweir SmFace aFace; 91*cdf0e10cSrcweir 92*cdf0e10cSrcweir SmToken aNodeToken; 93*cdf0e10cSrcweir SmNodeType eType; 94*cdf0e10cSrcweir SmScaleMode eScaleMode; 95*cdf0e10cSrcweir RectHorAlign eRectHorAlign; 96*cdf0e10cSrcweir sal_uInt16 nFlags, 97*cdf0e10cSrcweir nAttributes; 98*cdf0e10cSrcweir sal_Bool bIsPhantom, 99*cdf0e10cSrcweir bIsDebug; 100*cdf0e10cSrcweir protected: 101*cdf0e10cSrcweir SmNode(SmNodeType eNodeType, const SmToken &rNodeToken); 102*cdf0e10cSrcweir 103*cdf0e10cSrcweir // index in accessible text -1 if not (yet) applicable 104*cdf0e10cSrcweir sal_Int32 nAccIndex; 105*cdf0e10cSrcweir 106*cdf0e10cSrcweir public: 107*cdf0e10cSrcweir virtual ~SmNode(); 108*cdf0e10cSrcweir 109*cdf0e10cSrcweir virtual sal_Bool IsVisible() const; 110*cdf0e10cSrcweir 111*cdf0e10cSrcweir virtual sal_uInt16 GetNumSubNodes() const; 112*cdf0e10cSrcweir virtual SmNode * GetSubNode(sal_uInt16 nIndex); 113*cdf0e10cSrcweir const SmNode * GetSubNode(sal_uInt16 nIndex) const 114*cdf0e10cSrcweir { 115*cdf0e10cSrcweir return ((SmNode *) this)->GetSubNode(nIndex); 116*cdf0e10cSrcweir } 117*cdf0e10cSrcweir 118*cdf0e10cSrcweir virtual SmNode * GetLeftMost(); 119*cdf0e10cSrcweir const SmNode * GetLeftMost() const 120*cdf0e10cSrcweir { 121*cdf0e10cSrcweir return ((SmNode *) this)->GetLeftMost(); 122*cdf0e10cSrcweir } 123*cdf0e10cSrcweir 124*cdf0e10cSrcweir sal_uInt16 & Flags() { return nFlags; } 125*cdf0e10cSrcweir sal_uInt16 & Attributes() { return nAttributes; } 126*cdf0e10cSrcweir 127*cdf0e10cSrcweir sal_Bool IsDebug() const { return bIsDebug; } 128*cdf0e10cSrcweir sal_Bool IsPhantom() const { return bIsPhantom; } 129*cdf0e10cSrcweir void SetPhantom(sal_Bool bIsPhantom); 130*cdf0e10cSrcweir void SetColor(const Color &rColor); 131*cdf0e10cSrcweir 132*cdf0e10cSrcweir void SetAttribut(sal_uInt16 nAttrib); 133*cdf0e10cSrcweir void ClearAttribut(sal_uInt16 nAttrib); 134*cdf0e10cSrcweir 135*cdf0e10cSrcweir const SmFace & GetFont() const { return aFace; }; 136*cdf0e10cSrcweir SmFace & GetFont() { return aFace; }; 137*cdf0e10cSrcweir 138*cdf0e10cSrcweir void SetFont(const SmFace &rFace); 139*cdf0e10cSrcweir void SetFontSize(const Fraction &rRelSize, sal_uInt16 nType); 140*cdf0e10cSrcweir void SetSize(const Fraction &rScale); 141*cdf0e10cSrcweir 142*cdf0e10cSrcweir virtual void Prepare(const SmFormat &rFormat, const SmDocShell &rDocShell); 143*cdf0e10cSrcweir virtual void PrepareAttributes(); 144*cdf0e10cSrcweir 145*cdf0e10cSrcweir #if OSL_DEBUG_LEVEL 146*cdf0e10cSrcweir void ToggleDebug() const; 147*cdf0e10cSrcweir #endif 148*cdf0e10cSrcweir 149*cdf0e10cSrcweir void SetRectHorAlign(RectHorAlign eHorAlign, sal_Bool bApplyToSubTree = sal_True ); 150*cdf0e10cSrcweir RectHorAlign GetRectHorAlign() const { return eRectHorAlign; } 151*cdf0e10cSrcweir 152*cdf0e10cSrcweir const SmRect & GetRect() const { return *this; } 153*cdf0e10cSrcweir SmRect & GetRect() { return *this; } 154*cdf0e10cSrcweir 155*cdf0e10cSrcweir virtual void Move(const Point &rPosition); 156*cdf0e10cSrcweir void MoveTo(const Point &rPosition) { Move(rPosition - GetTopLeft()); } 157*cdf0e10cSrcweir virtual void Arrange(const OutputDevice &rDev, const SmFormat &rFormat); 158*cdf0e10cSrcweir virtual void CreateTextFromNode(String &rText); 159*cdf0e10cSrcweir 160*cdf0e10cSrcweir #ifdef SM_RECT_DEBUG 161*cdf0e10cSrcweir using SmRect::Draw; 162*cdf0e10cSrcweir #endif 163*cdf0e10cSrcweir virtual void Draw(OutputDevice &rDev, const Point &rPosition) const; 164*cdf0e10cSrcweir 165*cdf0e10cSrcweir virtual void GetAccessibleText( String &rText ) const; 166*cdf0e10cSrcweir sal_Int32 GetAccessibleIndex() const { return nAccIndex; } 167*cdf0e10cSrcweir const SmNode * FindNodeWithAccessibleIndex(xub_StrLen nAccIndex) const; 168*cdf0e10cSrcweir 169*cdf0e10cSrcweir sal_uInt16 GetRow() const { return (sal_uInt16)aNodeToken.nRow; } 170*cdf0e10cSrcweir sal_uInt16 GetColumn() const { return (sal_uInt16)aNodeToken.nCol; } 171*cdf0e10cSrcweir 172*cdf0e10cSrcweir SmScaleMode GetScaleMode() const { return eScaleMode; } 173*cdf0e10cSrcweir void SetScaleMode(SmScaleMode eMode) { eScaleMode = eMode; } 174*cdf0e10cSrcweir 175*cdf0e10cSrcweir virtual void AdaptToX(const OutputDevice &rDev, sal_uLong nWidth); 176*cdf0e10cSrcweir virtual void AdaptToY(const OutputDevice &rDev, sal_uLong nHeight); 177*cdf0e10cSrcweir 178*cdf0e10cSrcweir SmNodeType GetType() const { return eType; } 179*cdf0e10cSrcweir const SmToken & GetToken() const { return aNodeToken; } 180*cdf0e10cSrcweir 181*cdf0e10cSrcweir const SmNode * FindTokenAt(sal_uInt16 nRow, sal_uInt16 nCol) const; 182*cdf0e10cSrcweir const SmNode * FindRectClosestTo(const Point &rPoint) const; 183*cdf0e10cSrcweir 184*cdf0e10cSrcweir // --> 4.7.2010 #i972# 185*cdf0e10cSrcweir virtual long GetFormulaBaseline() const; 186*cdf0e10cSrcweir // <-- 187*cdf0e10cSrcweir }; 188*cdf0e10cSrcweir 189*cdf0e10cSrcweir 190*cdf0e10cSrcweir //////////////////////////////////////////////////////////////////////////////// 191*cdf0e10cSrcweir 192*cdf0e10cSrcweir 193*cdf0e10cSrcweir class SmStructureNode : public SmNode 194*cdf0e10cSrcweir { 195*cdf0e10cSrcweir SmNodeArray aSubNodes; 196*cdf0e10cSrcweir 197*cdf0e10cSrcweir protected: 198*cdf0e10cSrcweir SmStructureNode(SmNodeType eNodeType, const SmToken &rNodeToken) 199*cdf0e10cSrcweir : SmNode(eNodeType, rNodeToken) 200*cdf0e10cSrcweir {} 201*cdf0e10cSrcweir 202*cdf0e10cSrcweir public: 203*cdf0e10cSrcweir SmStructureNode( const SmStructureNode &rNode ); 204*cdf0e10cSrcweir virtual ~SmStructureNode(); 205*cdf0e10cSrcweir 206*cdf0e10cSrcweir virtual sal_Bool IsVisible() const; 207*cdf0e10cSrcweir 208*cdf0e10cSrcweir virtual sal_uInt16 GetNumSubNodes() const; 209*cdf0e10cSrcweir void SetNumSubNodes(sal_uInt16 nSize) { aSubNodes.resize(nSize); } 210*cdf0e10cSrcweir 211*cdf0e10cSrcweir using SmNode::GetSubNode; 212*cdf0e10cSrcweir virtual SmNode * GetSubNode(sal_uInt16 nIndex); 213*cdf0e10cSrcweir void SetSubNodes(SmNode *pFirst, SmNode *pSecond, SmNode *pThird = NULL); 214*cdf0e10cSrcweir void SetSubNodes(const SmNodeArray &rNodeArray); 215*cdf0e10cSrcweir 216*cdf0e10cSrcweir virtual SmStructureNode & operator = ( const SmStructureNode &rNode ); 217*cdf0e10cSrcweir 218*cdf0e10cSrcweir virtual void GetAccessibleText( String &rText ) const; 219*cdf0e10cSrcweir }; 220*cdf0e10cSrcweir 221*cdf0e10cSrcweir 222*cdf0e10cSrcweir //////////////////////////////////////////////////////////////////////////////// 223*cdf0e10cSrcweir 224*cdf0e10cSrcweir 225*cdf0e10cSrcweir class SmVisibleNode : public SmNode 226*cdf0e10cSrcweir { 227*cdf0e10cSrcweir protected: 228*cdf0e10cSrcweir SmVisibleNode(SmNodeType eNodeType, const SmToken &rNodeToken) 229*cdf0e10cSrcweir : SmNode(eNodeType, rNodeToken) 230*cdf0e10cSrcweir {} 231*cdf0e10cSrcweir 232*cdf0e10cSrcweir public: 233*cdf0e10cSrcweir 234*cdf0e10cSrcweir virtual sal_Bool IsVisible() const; 235*cdf0e10cSrcweir virtual sal_uInt16 GetNumSubNodes() const; 236*cdf0e10cSrcweir using SmNode::GetSubNode; 237*cdf0e10cSrcweir virtual SmNode * GetSubNode(sal_uInt16 nIndex); 238*cdf0e10cSrcweir }; 239*cdf0e10cSrcweir 240*cdf0e10cSrcweir 241*cdf0e10cSrcweir //////////////////////////////////////////////////////////////////////////////// 242*cdf0e10cSrcweir 243*cdf0e10cSrcweir 244*cdf0e10cSrcweir class SmGraphicNode : public SmVisibleNode 245*cdf0e10cSrcweir { 246*cdf0e10cSrcweir protected: 247*cdf0e10cSrcweir SmGraphicNode(SmNodeType eNodeType, const SmToken &rNodeToken) 248*cdf0e10cSrcweir : SmVisibleNode(eNodeType, rNodeToken) 249*cdf0e10cSrcweir {} 250*cdf0e10cSrcweir 251*cdf0e10cSrcweir public: 252*cdf0e10cSrcweir 253*cdf0e10cSrcweir virtual void GetAccessibleText( String &rText ) const; 254*cdf0e10cSrcweir }; 255*cdf0e10cSrcweir 256*cdf0e10cSrcweir 257*cdf0e10cSrcweir //////////////////////////////////////////////////////////////////////////////// 258*cdf0e10cSrcweir 259*cdf0e10cSrcweir 260*cdf0e10cSrcweir class SmRectangleNode : public SmGraphicNode 261*cdf0e10cSrcweir { 262*cdf0e10cSrcweir Size aToSize; 263*cdf0e10cSrcweir 264*cdf0e10cSrcweir public: 265*cdf0e10cSrcweir SmRectangleNode(const SmToken &rNodeToken) 266*cdf0e10cSrcweir : SmGraphicNode(NRECTANGLE, rNodeToken) 267*cdf0e10cSrcweir {} 268*cdf0e10cSrcweir 269*cdf0e10cSrcweir virtual void AdaptToX(const OutputDevice &rDev, sal_uLong nWidth); 270*cdf0e10cSrcweir virtual void AdaptToY(const OutputDevice &rDev, sal_uLong nHeight); 271*cdf0e10cSrcweir 272*cdf0e10cSrcweir virtual void Arrange(const OutputDevice &rDev, const SmFormat &rFormat); 273*cdf0e10cSrcweir 274*cdf0e10cSrcweir #ifdef SM_RECT_DEBUG 275*cdf0e10cSrcweir using SmRect::Draw; 276*cdf0e10cSrcweir #endif 277*cdf0e10cSrcweir virtual void Draw(OutputDevice &rDev, const Point &rPosition) const; 278*cdf0e10cSrcweir 279*cdf0e10cSrcweir void CreateTextFromNode(String &rText); 280*cdf0e10cSrcweir }; 281*cdf0e10cSrcweir 282*cdf0e10cSrcweir 283*cdf0e10cSrcweir //////////////////////////////////////////////////////////////////////////////// 284*cdf0e10cSrcweir 285*cdf0e10cSrcweir 286*cdf0e10cSrcweir class SmPolyLineNode : public SmGraphicNode 287*cdf0e10cSrcweir { 288*cdf0e10cSrcweir Polygon aPoly; 289*cdf0e10cSrcweir Size aToSize; 290*cdf0e10cSrcweir long nWidth; 291*cdf0e10cSrcweir 292*cdf0e10cSrcweir public: 293*cdf0e10cSrcweir SmPolyLineNode(const SmToken &rNodeToken); 294*cdf0e10cSrcweir 295*cdf0e10cSrcweir long GetWidth() const { return nWidth; } 296*cdf0e10cSrcweir 297*cdf0e10cSrcweir virtual void AdaptToX(const OutputDevice &rDev, sal_uLong nWidth); 298*cdf0e10cSrcweir virtual void AdaptToY(const OutputDevice &rDev, sal_uLong nHeight); 299*cdf0e10cSrcweir 300*cdf0e10cSrcweir virtual void Arrange(const OutputDevice &rDev, const SmFormat &rFormat); 301*cdf0e10cSrcweir 302*cdf0e10cSrcweir #ifdef SM_RECT_DEBUG 303*cdf0e10cSrcweir using SmRect::Draw; 304*cdf0e10cSrcweir #endif 305*cdf0e10cSrcweir virtual void Draw(OutputDevice &rDev, const Point &rPosition) const; 306*cdf0e10cSrcweir }; 307*cdf0e10cSrcweir 308*cdf0e10cSrcweir 309*cdf0e10cSrcweir //////////////////////////////////////////////////////////////////////////////// 310*cdf0e10cSrcweir 311*cdf0e10cSrcweir 312*cdf0e10cSrcweir class SmTextNode : public SmVisibleNode 313*cdf0e10cSrcweir { 314*cdf0e10cSrcweir XubString aText; 315*cdf0e10cSrcweir sal_uInt16 nFontDesc; 316*cdf0e10cSrcweir 317*cdf0e10cSrcweir protected: 318*cdf0e10cSrcweir SmTextNode(SmNodeType eNodeType, const SmToken &rNodeToken, sal_uInt16 nFontDescP ); 319*cdf0e10cSrcweir 320*cdf0e10cSrcweir public: 321*cdf0e10cSrcweir SmTextNode(const SmToken &rNodeToken, sal_uInt16 nFontDescP ); 322*cdf0e10cSrcweir 323*cdf0e10cSrcweir sal_uInt16 GetFontDesc() const { return nFontDesc; } 324*cdf0e10cSrcweir void SetText(const XubString &rText) { aText = rText; } 325*cdf0e10cSrcweir const XubString & GetText() const { return aText; } 326*cdf0e10cSrcweir 327*cdf0e10cSrcweir virtual void Prepare(const SmFormat &rFormat, const SmDocShell &rDocShell); 328*cdf0e10cSrcweir virtual void Arrange(const OutputDevice &rDev, const SmFormat &rFormat); 329*cdf0e10cSrcweir virtual void CreateTextFromNode(String &rText); 330*cdf0e10cSrcweir 331*cdf0e10cSrcweir #ifdef SM_RECT_DEBUG 332*cdf0e10cSrcweir using SmRect::Draw; 333*cdf0e10cSrcweir #endif 334*cdf0e10cSrcweir virtual void Draw(OutputDevice &rDev, const Point &rPosition) const; 335*cdf0e10cSrcweir 336*cdf0e10cSrcweir virtual void GetAccessibleText( String &rText ) const; 337*cdf0e10cSrcweir }; 338*cdf0e10cSrcweir 339*cdf0e10cSrcweir 340*cdf0e10cSrcweir //////////////////////////////////////////////////////////////////////////////// 341*cdf0e10cSrcweir 342*cdf0e10cSrcweir 343*cdf0e10cSrcweir class SmSpecialNode : public SmTextNode 344*cdf0e10cSrcweir { 345*cdf0e10cSrcweir bool bIsFromGreekSymbolSet; 346*cdf0e10cSrcweir 347*cdf0e10cSrcweir protected: 348*cdf0e10cSrcweir SmSpecialNode(SmNodeType eNodeType, const SmToken &rNodeToken, sal_uInt16 _nFontDesc); 349*cdf0e10cSrcweir 350*cdf0e10cSrcweir public: 351*cdf0e10cSrcweir SmSpecialNode(const SmToken &rNodeToken); 352*cdf0e10cSrcweir 353*cdf0e10cSrcweir virtual void Prepare(const SmFormat &rFormat, const SmDocShell &rDocShell); 354*cdf0e10cSrcweir virtual void Arrange(const OutputDevice &rDev, const SmFormat &rFormat); 355*cdf0e10cSrcweir 356*cdf0e10cSrcweir #ifdef SM_RECT_DEBUG 357*cdf0e10cSrcweir using SmRect::Draw; 358*cdf0e10cSrcweir #endif 359*cdf0e10cSrcweir virtual void Draw(OutputDevice &rDev, const Point &rPosition) const; 360*cdf0e10cSrcweir }; 361*cdf0e10cSrcweir 362*cdf0e10cSrcweir 363*cdf0e10cSrcweir //////////////////////////////////////////////////////////////////////////////// 364*cdf0e10cSrcweir 365*cdf0e10cSrcweir 366*cdf0e10cSrcweir class SmGlyphSpecialNode : public SmSpecialNode 367*cdf0e10cSrcweir { 368*cdf0e10cSrcweir public: 369*cdf0e10cSrcweir SmGlyphSpecialNode(const SmToken &rNodeToken) 370*cdf0e10cSrcweir : SmSpecialNode(NGLYPH_SPECIAL, rNodeToken, FNT_MATH) 371*cdf0e10cSrcweir {} 372*cdf0e10cSrcweir 373*cdf0e10cSrcweir virtual void Arrange(const OutputDevice &rDev, const SmFormat &rFormat); 374*cdf0e10cSrcweir }; 375*cdf0e10cSrcweir 376*cdf0e10cSrcweir 377*cdf0e10cSrcweir //////////////////////////////////////////////////////////////////////////////// 378*cdf0e10cSrcweir 379*cdf0e10cSrcweir 380*cdf0e10cSrcweir class SmMathSymbolNode : public SmSpecialNode 381*cdf0e10cSrcweir { 382*cdf0e10cSrcweir protected: 383*cdf0e10cSrcweir SmMathSymbolNode(SmNodeType eNodeType, const SmToken &rNodeToken) 384*cdf0e10cSrcweir : SmSpecialNode(eNodeType, rNodeToken, FNT_MATH) 385*cdf0e10cSrcweir { 386*cdf0e10cSrcweir xub_Unicode cChar = GetToken().cMathChar; 387*cdf0e10cSrcweir if ((xub_Unicode) '\0' != cChar) 388*cdf0e10cSrcweir SetText( cChar ); 389*cdf0e10cSrcweir } 390*cdf0e10cSrcweir 391*cdf0e10cSrcweir public: 392*cdf0e10cSrcweir SmMathSymbolNode(const SmToken &rNodeToken); 393*cdf0e10cSrcweir 394*cdf0e10cSrcweir virtual void AdaptToX(const OutputDevice &rDev, sal_uLong nWidth); 395*cdf0e10cSrcweir virtual void AdaptToY(const OutputDevice &rDev, sal_uLong nHeight); 396*cdf0e10cSrcweir 397*cdf0e10cSrcweir virtual void Prepare(const SmFormat &rFormat, const SmDocShell &rDocShell); 398*cdf0e10cSrcweir virtual void Arrange(const OutputDevice &rDev, const SmFormat &rFormat); 399*cdf0e10cSrcweir void CreateTextFromNode(String &rText); 400*cdf0e10cSrcweir }; 401*cdf0e10cSrcweir 402*cdf0e10cSrcweir 403*cdf0e10cSrcweir //////////////////////////////////////////////////////////////////////////////// 404*cdf0e10cSrcweir 405*cdf0e10cSrcweir 406*cdf0e10cSrcweir class SmRootSymbolNode : public SmMathSymbolNode 407*cdf0e10cSrcweir { 408*cdf0e10cSrcweir sal_uLong nBodyWidth; // width of body (argument) of root sign 409*cdf0e10cSrcweir 410*cdf0e10cSrcweir public: 411*cdf0e10cSrcweir SmRootSymbolNode(const SmToken &rNodeToken) 412*cdf0e10cSrcweir : SmMathSymbolNode(NROOTSYMBOL, rNodeToken) 413*cdf0e10cSrcweir {} 414*cdf0e10cSrcweir 415*cdf0e10cSrcweir virtual void AdaptToX(const OutputDevice &rDev, sal_uLong nWidth); 416*cdf0e10cSrcweir virtual void AdaptToY(const OutputDevice &rDev, sal_uLong nHeight); 417*cdf0e10cSrcweir 418*cdf0e10cSrcweir #ifdef SM_RECT_DEBUG 419*cdf0e10cSrcweir using SmRect::Draw; 420*cdf0e10cSrcweir #endif 421*cdf0e10cSrcweir virtual void Draw(OutputDevice &rDev, const Point &rPosition) const; 422*cdf0e10cSrcweir }; 423*cdf0e10cSrcweir 424*cdf0e10cSrcweir 425*cdf0e10cSrcweir //////////////////////////////////////////////////////////////////////////////// 426*cdf0e10cSrcweir 427*cdf0e10cSrcweir 428*cdf0e10cSrcweir class SmPlaceNode : public SmMathSymbolNode 429*cdf0e10cSrcweir { 430*cdf0e10cSrcweir public: 431*cdf0e10cSrcweir SmPlaceNode(const SmToken &rNodeToken) 432*cdf0e10cSrcweir : SmMathSymbolNode(NPLACE, rNodeToken) 433*cdf0e10cSrcweir { 434*cdf0e10cSrcweir } 435*cdf0e10cSrcweir 436*cdf0e10cSrcweir virtual void Prepare(const SmFormat &rFormat, const SmDocShell &rDocShell); 437*cdf0e10cSrcweir virtual void Arrange(const OutputDevice &rDev, const SmFormat &rFormat); 438*cdf0e10cSrcweir }; 439*cdf0e10cSrcweir 440*cdf0e10cSrcweir 441*cdf0e10cSrcweir //////////////////////////////////////////////////////////////////////////////// 442*cdf0e10cSrcweir 443*cdf0e10cSrcweir 444*cdf0e10cSrcweir class SmErrorNode : public SmMathSymbolNode 445*cdf0e10cSrcweir { 446*cdf0e10cSrcweir public: 447*cdf0e10cSrcweir SmErrorNode(SmParseError /*eError*/, const SmToken &rNodeToken) 448*cdf0e10cSrcweir : SmMathSymbolNode(NERROR, rNodeToken) 449*cdf0e10cSrcweir { 450*cdf0e10cSrcweir SetText((xub_Unicode) MS_ERROR); 451*cdf0e10cSrcweir } 452*cdf0e10cSrcweir 453*cdf0e10cSrcweir virtual void Prepare(const SmFormat &rFormat, const SmDocShell &rDocShell); 454*cdf0e10cSrcweir virtual void Arrange(const OutputDevice &rDev, const SmFormat &rFormat); 455*cdf0e10cSrcweir }; 456*cdf0e10cSrcweir 457*cdf0e10cSrcweir 458*cdf0e10cSrcweir //////////////////////////////////////////////////////////////////////////////// 459*cdf0e10cSrcweir 460*cdf0e10cSrcweir 461*cdf0e10cSrcweir class SmTableNode : public SmStructureNode 462*cdf0e10cSrcweir { 463*cdf0e10cSrcweir // --> 4.7.2010 #i972# 464*cdf0e10cSrcweir long nFormulaBaseline; 465*cdf0e10cSrcweir // <-- 466*cdf0e10cSrcweir public: 467*cdf0e10cSrcweir SmTableNode(const SmToken &rNodeToken) 468*cdf0e10cSrcweir : SmStructureNode(NTABLE, rNodeToken) 469*cdf0e10cSrcweir {} 470*cdf0e10cSrcweir 471*cdf0e10cSrcweir using SmNode::GetLeftMost; 472*cdf0e10cSrcweir virtual SmNode * GetLeftMost(); 473*cdf0e10cSrcweir 474*cdf0e10cSrcweir virtual void Arrange(const OutputDevice &rDev, const SmFormat &rFormat); 475*cdf0e10cSrcweir virtual long GetFormulaBaseline() const; 476*cdf0e10cSrcweir }; 477*cdf0e10cSrcweir 478*cdf0e10cSrcweir 479*cdf0e10cSrcweir //////////////////////////////////////////////////////////////////////////////// 480*cdf0e10cSrcweir 481*cdf0e10cSrcweir 482*cdf0e10cSrcweir class SmLineNode : public SmStructureNode 483*cdf0e10cSrcweir { 484*cdf0e10cSrcweir sal_Bool bUseExtraSpaces; 485*cdf0e10cSrcweir 486*cdf0e10cSrcweir protected: 487*cdf0e10cSrcweir SmLineNode(SmNodeType eNodeType, const SmToken &rNodeToken) 488*cdf0e10cSrcweir : SmStructureNode(eNodeType, rNodeToken) 489*cdf0e10cSrcweir { 490*cdf0e10cSrcweir bUseExtraSpaces = sal_True; 491*cdf0e10cSrcweir } 492*cdf0e10cSrcweir 493*cdf0e10cSrcweir public: 494*cdf0e10cSrcweir SmLineNode(const SmToken &rNodeToken) 495*cdf0e10cSrcweir : SmStructureNode(NLINE, rNodeToken) 496*cdf0e10cSrcweir { 497*cdf0e10cSrcweir bUseExtraSpaces = sal_True; 498*cdf0e10cSrcweir } 499*cdf0e10cSrcweir 500*cdf0e10cSrcweir void SetUseExtraSpaces(sal_Bool bVal) { bUseExtraSpaces = bVal; } 501*cdf0e10cSrcweir sal_Bool IsUseExtraSpaces() const { return bUseExtraSpaces; }; 502*cdf0e10cSrcweir 503*cdf0e10cSrcweir virtual void Prepare(const SmFormat &rFormat, const SmDocShell &rDocShell); 504*cdf0e10cSrcweir virtual void Arrange(const OutputDevice &rDev, const SmFormat &rFormat); 505*cdf0e10cSrcweir }; 506*cdf0e10cSrcweir 507*cdf0e10cSrcweir 508*cdf0e10cSrcweir //////////////////////////////////////////////////////////////////////////////// 509*cdf0e10cSrcweir 510*cdf0e10cSrcweir 511*cdf0e10cSrcweir class SmExpressionNode : public SmLineNode 512*cdf0e10cSrcweir { 513*cdf0e10cSrcweir public: 514*cdf0e10cSrcweir SmExpressionNode(const SmToken &rNodeToken) 515*cdf0e10cSrcweir : SmLineNode(NEXPRESSION, rNodeToken) 516*cdf0e10cSrcweir {} 517*cdf0e10cSrcweir 518*cdf0e10cSrcweir virtual void Arrange(const OutputDevice &rDev, const SmFormat &rFormat); 519*cdf0e10cSrcweir void CreateTextFromNode(String &rText); 520*cdf0e10cSrcweir }; 521*cdf0e10cSrcweir 522*cdf0e10cSrcweir 523*cdf0e10cSrcweir //////////////////////////////////////////////////////////////////////////////// 524*cdf0e10cSrcweir 525*cdf0e10cSrcweir 526*cdf0e10cSrcweir class SmUnHorNode : public SmStructureNode 527*cdf0e10cSrcweir { 528*cdf0e10cSrcweir public: 529*cdf0e10cSrcweir SmUnHorNode(const SmToken &rNodeToken) 530*cdf0e10cSrcweir : SmStructureNode(NUNHOR, rNodeToken) 531*cdf0e10cSrcweir { 532*cdf0e10cSrcweir SetNumSubNodes(2); 533*cdf0e10cSrcweir } 534*cdf0e10cSrcweir 535*cdf0e10cSrcweir virtual void Arrange(const OutputDevice &rDev, const SmFormat &rFormat); 536*cdf0e10cSrcweir }; 537*cdf0e10cSrcweir 538*cdf0e10cSrcweir 539*cdf0e10cSrcweir //////////////////////////////////////////////////////////////////////////////// 540*cdf0e10cSrcweir 541*cdf0e10cSrcweir 542*cdf0e10cSrcweir class SmRootNode : public SmStructureNode 543*cdf0e10cSrcweir { 544*cdf0e10cSrcweir protected: 545*cdf0e10cSrcweir void GetHeightVerOffset(const SmRect &rRect, 546*cdf0e10cSrcweir long &rHeight, long &rVerOffset) const; 547*cdf0e10cSrcweir Point GetExtraPos(const SmRect &rRootSymbol, const SmRect &rExtra) const; 548*cdf0e10cSrcweir 549*cdf0e10cSrcweir public: 550*cdf0e10cSrcweir SmRootNode(const SmToken &rNodeToken) 551*cdf0e10cSrcweir : SmStructureNode(NROOT, rNodeToken) 552*cdf0e10cSrcweir { 553*cdf0e10cSrcweir SetNumSubNodes(3); 554*cdf0e10cSrcweir } 555*cdf0e10cSrcweir 556*cdf0e10cSrcweir virtual void Arrange(const OutputDevice &rDev, const SmFormat &rFormat); 557*cdf0e10cSrcweir void CreateTextFromNode(String &rText); 558*cdf0e10cSrcweir }; 559*cdf0e10cSrcweir 560*cdf0e10cSrcweir 561*cdf0e10cSrcweir //////////////////////////////////////////////////////////////////////////////// 562*cdf0e10cSrcweir 563*cdf0e10cSrcweir 564*cdf0e10cSrcweir class SmBinHorNode : public SmStructureNode 565*cdf0e10cSrcweir { 566*cdf0e10cSrcweir public: 567*cdf0e10cSrcweir SmBinHorNode(const SmToken &rNodeToken) 568*cdf0e10cSrcweir : SmStructureNode(NBINHOR, rNodeToken) 569*cdf0e10cSrcweir { 570*cdf0e10cSrcweir SetNumSubNodes(3); 571*cdf0e10cSrcweir } 572*cdf0e10cSrcweir 573*cdf0e10cSrcweir virtual void Arrange(const OutputDevice &rDev, const SmFormat &rFormat); 574*cdf0e10cSrcweir }; 575*cdf0e10cSrcweir 576*cdf0e10cSrcweir 577*cdf0e10cSrcweir //////////////////////////////////////////////////////////////////////////////// 578*cdf0e10cSrcweir 579*cdf0e10cSrcweir 580*cdf0e10cSrcweir class SmBinVerNode : public SmStructureNode 581*cdf0e10cSrcweir { 582*cdf0e10cSrcweir public: 583*cdf0e10cSrcweir SmBinVerNode(const SmToken &rNodeToken) 584*cdf0e10cSrcweir : SmStructureNode(NBINVER, rNodeToken) 585*cdf0e10cSrcweir { 586*cdf0e10cSrcweir SetNumSubNodes(3); 587*cdf0e10cSrcweir } 588*cdf0e10cSrcweir 589*cdf0e10cSrcweir using SmNode::GetLeftMost; 590*cdf0e10cSrcweir virtual SmNode * GetLeftMost(); 591*cdf0e10cSrcweir 592*cdf0e10cSrcweir virtual void Arrange(const OutputDevice &rDev, const SmFormat &rFormat); 593*cdf0e10cSrcweir void CreateTextFromNode(String &rText); 594*cdf0e10cSrcweir }; 595*cdf0e10cSrcweir 596*cdf0e10cSrcweir 597*cdf0e10cSrcweir //////////////////////////////////////////////////////////////////////////////// 598*cdf0e10cSrcweir 599*cdf0e10cSrcweir 600*cdf0e10cSrcweir class SmBinDiagonalNode : public SmStructureNode 601*cdf0e10cSrcweir { 602*cdf0e10cSrcweir sal_Bool bAscending; 603*cdf0e10cSrcweir 604*cdf0e10cSrcweir void GetOperPosSize(Point &rPos, Size &rSize, 605*cdf0e10cSrcweir const Point &rDiagPoint, double fAngleDeg) const; 606*cdf0e10cSrcweir 607*cdf0e10cSrcweir public: 608*cdf0e10cSrcweir SmBinDiagonalNode(const SmToken &rNodeToken); 609*cdf0e10cSrcweir 610*cdf0e10cSrcweir sal_Bool IsAscending() const { return bAscending; } 611*cdf0e10cSrcweir void SetAscending(sal_Bool bVal) { bAscending = bVal; } 612*cdf0e10cSrcweir 613*cdf0e10cSrcweir virtual void Arrange(const OutputDevice &rDev, const SmFormat &rFormat); 614*cdf0e10cSrcweir }; 615*cdf0e10cSrcweir 616*cdf0e10cSrcweir 617*cdf0e10cSrcweir //////////////////////////////////////////////////////////////////////////////// 618*cdf0e10cSrcweir 619*cdf0e10cSrcweir 620*cdf0e10cSrcweir // enums used to index sub-/supscripts in the 'aSubNodes' array 621*cdf0e10cSrcweir // in 'SmSubSupNode' 622*cdf0e10cSrcweir // See graphic for positions at char: 623*cdf0e10cSrcweir // 624*cdf0e10cSrcweir // CSUP 625*cdf0e10cSrcweir // 626*cdf0e10cSrcweir // LSUP H H RSUP 627*cdf0e10cSrcweir // H H 628*cdf0e10cSrcweir // HHHH 629*cdf0e10cSrcweir // H H 630*cdf0e10cSrcweir // LSUB H H RSUB 631*cdf0e10cSrcweir // 632*cdf0e10cSrcweir // CSUB 633*cdf0e10cSrcweir // 634*cdf0e10cSrcweir enum SmSubSup 635*cdf0e10cSrcweir { CSUB, CSUP, RSUB, RSUP, LSUB, LSUP 636*cdf0e10cSrcweir }; 637*cdf0e10cSrcweir 638*cdf0e10cSrcweir // numbers of entries in the above enum (that is: the number of possible 639*cdf0e10cSrcweir // sub-/supscripts) 640*cdf0e10cSrcweir #define SUBSUP_NUM_ENTRIES 6 641*cdf0e10cSrcweir 642*cdf0e10cSrcweir 643*cdf0e10cSrcweir class SmSubSupNode : public SmStructureNode 644*cdf0e10cSrcweir { 645*cdf0e10cSrcweir sal_Bool bUseLimits; 646*cdf0e10cSrcweir 647*cdf0e10cSrcweir public: 648*cdf0e10cSrcweir SmSubSupNode(const SmToken &rNodeToken) 649*cdf0e10cSrcweir : SmStructureNode(NSUBSUP, rNodeToken) 650*cdf0e10cSrcweir { 651*cdf0e10cSrcweir SetNumSubNodes(1 + SUBSUP_NUM_ENTRIES); 652*cdf0e10cSrcweir bUseLimits = sal_False; 653*cdf0e10cSrcweir } 654*cdf0e10cSrcweir 655*cdf0e10cSrcweir SmNode * GetBody() { return GetSubNode(0); } 656*cdf0e10cSrcweir const SmNode * GetBody() const 657*cdf0e10cSrcweir { 658*cdf0e10cSrcweir return ((SmSubSupNode *) this)->GetBody(); 659*cdf0e10cSrcweir } 660*cdf0e10cSrcweir 661*cdf0e10cSrcweir void SetUseLimits(sal_Bool bVal) { bUseLimits = bVal; } 662*cdf0e10cSrcweir sal_Bool IsUseLimits() const { return bUseLimits; }; 663*cdf0e10cSrcweir 664*cdf0e10cSrcweir SmNode * GetSubSup(SmSubSup eSubSup) { return GetSubNode( sal::static_int_cast< sal_uInt16 >(1 + eSubSup) ); }; 665*cdf0e10cSrcweir 666*cdf0e10cSrcweir virtual void Arrange(const OutputDevice &rDev, const SmFormat &rFormat); 667*cdf0e10cSrcweir void CreateTextFromNode(String &rText); 668*cdf0e10cSrcweir 669*cdf0e10cSrcweir }; 670*cdf0e10cSrcweir 671*cdf0e10cSrcweir 672*cdf0e10cSrcweir //////////////////////////////////////////////////////////////////////////////// 673*cdf0e10cSrcweir 674*cdf0e10cSrcweir 675*cdf0e10cSrcweir class SmBraceNode : public SmStructureNode 676*cdf0e10cSrcweir { 677*cdf0e10cSrcweir public: 678*cdf0e10cSrcweir SmBraceNode(const SmToken &rNodeToken) 679*cdf0e10cSrcweir : SmStructureNode(NBRACE, rNodeToken) 680*cdf0e10cSrcweir { 681*cdf0e10cSrcweir SetNumSubNodes(3); 682*cdf0e10cSrcweir } 683*cdf0e10cSrcweir 684*cdf0e10cSrcweir virtual void Arrange(const OutputDevice &rDev, const SmFormat &rFormat); 685*cdf0e10cSrcweir void CreateTextFromNode(String &rText); 686*cdf0e10cSrcweir }; 687*cdf0e10cSrcweir 688*cdf0e10cSrcweir 689*cdf0e10cSrcweir //////////////////////////////////////////////////////////////////////////////// 690*cdf0e10cSrcweir 691*cdf0e10cSrcweir 692*cdf0e10cSrcweir class SmBracebodyNode : public SmStructureNode 693*cdf0e10cSrcweir { 694*cdf0e10cSrcweir long nBodyHeight; 695*cdf0e10cSrcweir 696*cdf0e10cSrcweir public: 697*cdf0e10cSrcweir inline SmBracebodyNode(const SmToken &rNodeToken); 698*cdf0e10cSrcweir 699*cdf0e10cSrcweir virtual void Arrange(const OutputDevice &rDev, const SmFormat &rFormat); 700*cdf0e10cSrcweir long GetBodyHeight() const { return nBodyHeight; } 701*cdf0e10cSrcweir }; 702*cdf0e10cSrcweir 703*cdf0e10cSrcweir 704*cdf0e10cSrcweir inline SmBracebodyNode::SmBracebodyNode(const SmToken &rNodeToken) : 705*cdf0e10cSrcweir SmStructureNode(NBRACEBODY, rNodeToken) 706*cdf0e10cSrcweir { 707*cdf0e10cSrcweir nBodyHeight = 0; 708*cdf0e10cSrcweir } 709*cdf0e10cSrcweir 710*cdf0e10cSrcweir 711*cdf0e10cSrcweir //////////////////////////////////////////////////////////////////////////////// 712*cdf0e10cSrcweir 713*cdf0e10cSrcweir 714*cdf0e10cSrcweir class SmVerticalBraceNode : public SmStructureNode 715*cdf0e10cSrcweir { 716*cdf0e10cSrcweir public: 717*cdf0e10cSrcweir inline SmVerticalBraceNode(const SmToken &rNodeToken); 718*cdf0e10cSrcweir 719*cdf0e10cSrcweir virtual void Arrange(const OutputDevice &rDev, const SmFormat &rFormat); 720*cdf0e10cSrcweir }; 721*cdf0e10cSrcweir 722*cdf0e10cSrcweir 723*cdf0e10cSrcweir inline SmVerticalBraceNode::SmVerticalBraceNode(const SmToken &rNodeToken) : 724*cdf0e10cSrcweir SmStructureNode(NVERTICAL_BRACE, rNodeToken) 725*cdf0e10cSrcweir { 726*cdf0e10cSrcweir SetNumSubNodes(3); 727*cdf0e10cSrcweir } 728*cdf0e10cSrcweir 729*cdf0e10cSrcweir 730*cdf0e10cSrcweir //////////////////////////////////////////////////////////////////////////////// 731*cdf0e10cSrcweir 732*cdf0e10cSrcweir 733*cdf0e10cSrcweir class SmOperNode : public SmStructureNode 734*cdf0e10cSrcweir { 735*cdf0e10cSrcweir public: 736*cdf0e10cSrcweir SmOperNode(const SmToken &rNodeToken) 737*cdf0e10cSrcweir : SmStructureNode(NOPER, rNodeToken) 738*cdf0e10cSrcweir { 739*cdf0e10cSrcweir SetNumSubNodes(2); 740*cdf0e10cSrcweir } 741*cdf0e10cSrcweir 742*cdf0e10cSrcweir SmNode * GetSymbol(); 743*cdf0e10cSrcweir const SmNode * GetSymbol() const 744*cdf0e10cSrcweir { 745*cdf0e10cSrcweir return ((SmOperNode *) this)->GetSymbol(); 746*cdf0e10cSrcweir } 747*cdf0e10cSrcweir 748*cdf0e10cSrcweir long CalcSymbolHeight(const SmNode &rSymbol, const SmFormat &rFormat) const; 749*cdf0e10cSrcweir 750*cdf0e10cSrcweir virtual void Arrange(const OutputDevice &rDev, const SmFormat &rFormat); 751*cdf0e10cSrcweir }; 752*cdf0e10cSrcweir 753*cdf0e10cSrcweir 754*cdf0e10cSrcweir //////////////////////////////////////////////////////////////////////////////// 755*cdf0e10cSrcweir 756*cdf0e10cSrcweir 757*cdf0e10cSrcweir class SmAlignNode : public SmStructureNode 758*cdf0e10cSrcweir { 759*cdf0e10cSrcweir public: 760*cdf0e10cSrcweir SmAlignNode(const SmToken &rNodeToken) 761*cdf0e10cSrcweir : SmStructureNode(NALIGN, rNodeToken) 762*cdf0e10cSrcweir {} 763*cdf0e10cSrcweir 764*cdf0e10cSrcweir virtual void Arrange(const OutputDevice &rDev, const SmFormat &rFormat); 765*cdf0e10cSrcweir }; 766*cdf0e10cSrcweir 767*cdf0e10cSrcweir 768*cdf0e10cSrcweir //////////////////////////////////////////////////////////////////////////////// 769*cdf0e10cSrcweir 770*cdf0e10cSrcweir 771*cdf0e10cSrcweir class SmAttributNode : public SmStructureNode 772*cdf0e10cSrcweir { 773*cdf0e10cSrcweir public: 774*cdf0e10cSrcweir SmAttributNode(const SmToken &rNodeToken) 775*cdf0e10cSrcweir : SmStructureNode(NATTRIBUT, rNodeToken) 776*cdf0e10cSrcweir {} 777*cdf0e10cSrcweir 778*cdf0e10cSrcweir virtual void Arrange(const OutputDevice &rDev, const SmFormat &rFormat); 779*cdf0e10cSrcweir void CreateTextFromNode(String &rText); 780*cdf0e10cSrcweir }; 781*cdf0e10cSrcweir 782*cdf0e10cSrcweir 783*cdf0e10cSrcweir //////////////////////////////////////////////////////////////////////////////// 784*cdf0e10cSrcweir 785*cdf0e10cSrcweir 786*cdf0e10cSrcweir class SmFontNode : public SmStructureNode 787*cdf0e10cSrcweir { 788*cdf0e10cSrcweir sal_uInt16 nSizeType; 789*cdf0e10cSrcweir Fraction aFontSize; 790*cdf0e10cSrcweir 791*cdf0e10cSrcweir public: 792*cdf0e10cSrcweir SmFontNode(const SmToken &rNodeToken) 793*cdf0e10cSrcweir : SmStructureNode(NFONT, rNodeToken) 794*cdf0e10cSrcweir { 795*cdf0e10cSrcweir nSizeType = FNTSIZ_MULTIPLY; 796*cdf0e10cSrcweir aFontSize = Fraction(1L); 797*cdf0e10cSrcweir } 798*cdf0e10cSrcweir 799*cdf0e10cSrcweir void SetSizeParameter(const Fraction &rValue, sal_uInt16 nType); 800*cdf0e10cSrcweir const Fraction & GetSizeParameter() const {return aFontSize;} 801*cdf0e10cSrcweir const sal_uInt16& GetSizeType() const {return nSizeType;} 802*cdf0e10cSrcweir 803*cdf0e10cSrcweir virtual void Prepare(const SmFormat &rFormat, const SmDocShell &rDocShell); 804*cdf0e10cSrcweir virtual void Arrange(const OutputDevice &rDev, const SmFormat &rFormat); 805*cdf0e10cSrcweir void CreateTextFromNode(String &rText); 806*cdf0e10cSrcweir }; 807*cdf0e10cSrcweir 808*cdf0e10cSrcweir 809*cdf0e10cSrcweir //////////////////////////////////////////////////////////////////////////////// 810*cdf0e10cSrcweir 811*cdf0e10cSrcweir 812*cdf0e10cSrcweir class SmMatrixNode : public SmStructureNode 813*cdf0e10cSrcweir { 814*cdf0e10cSrcweir sal_uInt16 nNumRows, 815*cdf0e10cSrcweir nNumCols; 816*cdf0e10cSrcweir 817*cdf0e10cSrcweir public: 818*cdf0e10cSrcweir SmMatrixNode(const SmToken &rNodeToken) 819*cdf0e10cSrcweir : SmStructureNode(NMATRIX, rNodeToken) 820*cdf0e10cSrcweir { 821*cdf0e10cSrcweir nNumRows = nNumCols = 0; 822*cdf0e10cSrcweir } 823*cdf0e10cSrcweir 824*cdf0e10cSrcweir sal_uInt16 GetNumRows() const {return nNumRows;} 825*cdf0e10cSrcweir sal_uInt16 GetNumCols() const {return nNumCols;} 826*cdf0e10cSrcweir void SetRowCol(sal_uInt16 nMatrixRows, sal_uInt16 nMatrixCols); 827*cdf0e10cSrcweir 828*cdf0e10cSrcweir using SmNode::GetLeftMost; 829*cdf0e10cSrcweir virtual SmNode * GetLeftMost(); 830*cdf0e10cSrcweir 831*cdf0e10cSrcweir virtual void Arrange(const OutputDevice &rDev, const SmFormat &rFormat); 832*cdf0e10cSrcweir void CreateTextFromNode(String &rText); 833*cdf0e10cSrcweir }; 834*cdf0e10cSrcweir 835*cdf0e10cSrcweir 836*cdf0e10cSrcweir //////////////////////////////////////////////////////////////////////////////// 837*cdf0e10cSrcweir 838*cdf0e10cSrcweir 839*cdf0e10cSrcweir class SmBlankNode : public SmGraphicNode 840*cdf0e10cSrcweir { 841*cdf0e10cSrcweir sal_uInt16 nNum; 842*cdf0e10cSrcweir 843*cdf0e10cSrcweir public: 844*cdf0e10cSrcweir SmBlankNode(const SmToken &rNodeToken) 845*cdf0e10cSrcweir : SmGraphicNode(NBLANK, rNodeToken) 846*cdf0e10cSrcweir { 847*cdf0e10cSrcweir nNum = 0; 848*cdf0e10cSrcweir } 849*cdf0e10cSrcweir 850*cdf0e10cSrcweir void IncreaseBy(const SmToken &rToken); 851*cdf0e10cSrcweir void Clear() { nNum = 0; } 852*cdf0e10cSrcweir 853*cdf0e10cSrcweir virtual void Prepare(const SmFormat &rFormat, const SmDocShell &rDocShell); 854*cdf0e10cSrcweir virtual void Arrange(const OutputDevice &rDev, const SmFormat &rFormat); 855*cdf0e10cSrcweir }; 856*cdf0e10cSrcweir 857*cdf0e10cSrcweir 858*cdf0e10cSrcweir //////////////////////////////////////////////////////////////////////////////// 859*cdf0e10cSrcweir 860*cdf0e10cSrcweir #endif 861*cdf0e10cSrcweir 862*cdf0e10cSrcweir 863