/Users/ericb/Desktop/SRC680_m247/starmath/inc/node.hxx

Go to the documentation of this file.
00001 /*************************************************************************
00002  *
00003  *  OpenOffice.org - a multi-platform office productivity suite
00004  *
00005  *  $RCSfile: node.hxx,v $
00006  *
00007  *  $Revision: 1.17 $
00008  *
00009  *  last change: $Author: vg $ $Date: 2007/05/25 12:09:37 $
00010  *
00011  *  The Contents of this file are made available subject to
00012  *  the terms of GNU Lesser General Public License Version 2.1.
00013  *
00014  *
00015  *    GNU Lesser General Public License Version 2.1
00016  *    =============================================
00017  *    Copyright 2005 by Sun Microsystems, Inc.
00018  *    901 San Antonio Road, Palo Alto, CA 94303, USA
00019  *
00020  *    This library is free software; you can redistribute it and/or
00021  *    modify it under the terms of the GNU Lesser General Public
00022  *    License version 2.1, as published by the Free Software Foundation.
00023  *
00024  *    This library is distributed in the hope that it will be useful,
00025  *    but WITHOUT ANY WARRANTY; without even the implied warranty of
00026  *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00027  *    Lesser General Public License for more details.
00028  *
00029  *    You should have received a copy of the GNU Lesser General Public
00030  *    License along with this library; if not, write to the Free Software
00031  *    Foundation, Inc., 59 Temple Place, Suite 330, Boston,
00032  *    MA  02111-1307  USA
00033  *
00034  ************************************************************************/
00035 
00036 
00037 #ifndef NODE_HXX
00038 #define NODE_HXX
00039 
00040 
00041 #ifndef _DYNARY_HXX //autogen
00042 #include <tools/dynary.hxx>
00043 #endif
00044 
00045 #include "parse.hxx"
00046 #include "types.hxx"
00047 #include "rect.hxx"
00048 #include "format.hxx"
00049 
00050 
00051 #define ATTR_BOLD               0x0001
00052 #define ATTR_ITALIC             0x0002
00053 
00054 #define FNTSIZ_ABSOLUT  1
00055 #define FNTSIZ_PLUS     2
00056 #define FNTSIZ_MINUS    3
00057 #define FNTSIZ_MULTIPLY 4
00058 #define FNTSIZ_DIVIDE   5
00059 
00060 // flags to interdict respective status changes
00061 #define FLG_FONT                0x0001
00062 #define FLG_SIZE                0x0002
00063 #define FLG_BOLD                0x0004
00064 #define FLG_ITALIC              0x0008
00065 #define FLG_COLOR               0x0010
00066 #define FLG_VISIBLE             0x0020
00067 #define FLG_HORALIGN    0x0040
00068 
00069 
00070 extern SmFormat *pActiveFormat;
00071 
00072 class SmDocShell;
00073 
00074 class SmNode;
00075 DECLARE_DYNARRAY(SmNodeArray, SmNode *)
00076 
00077 
00078 
00079 enum SmScaleMode        { SCALE_NONE, SCALE_WIDTH, SCALE_HEIGHT };
00080 
00081 enum SmNodeType
00082 {
00083         NTABLE,                 NBRACE,                 NBRACEBODY,             NOPER,                  NALIGN,
00084         NATTRIBUT,              NFONT,                  NUNHOR,                 NBINHOR,                NBINVER,
00085         NBINDIAGONAL,   NSUBSUP,                NMATRIX,                NPLACE,                 NTEXT,
00086         NSPECIAL,               NGLYPH_SPECIAL, NMATH,                  NBLANK,                 NERROR,
00087     NLINE,          NEXPRESSION,    NPOLYLINE,      NROOT,          NROOTSYMBOL,    
00088     NRECTANGLE,     NVERTICAL_BRACE
00089 };
00090 
00091 
00093 
00094 
00095 class SmNode : public SmRect
00096 {
00097     SmFace          aFace;
00098 
00099         SmToken                 aNodeToken;
00100         SmNodeType              eType;
00101         SmScaleMode             eScaleMode;
00102         RectHorAlign    eRectHorAlign;
00103         USHORT                  nFlags,
00104                                         nAttributes;
00105         BOOL                    bIsPhantom,
00106                                         bIsDebug;
00107 protected:
00108         SmNode(SmNodeType eNodeType, const SmToken &rNodeToken);
00109 
00110     // index in accessible text -1 if not (yet) applicable
00111     sal_Int32       nAccIndex;
00112 
00113 public:
00114         virtual                         ~SmNode();
00115 
00116     virtual BOOL        IsVisible() const;
00117 
00118     virtual USHORT      GetNumSubNodes() const;
00119     virtual SmNode *    GetSubNode(USHORT nIndex);
00120                         const SmNode * GetSubNode(USHORT nIndex) const
00121                         {
00122                                 return ((SmNode *) this)->GetSubNode(nIndex);
00123                         }
00124 
00125         virtual SmNode *           GetLeftMost();
00126                         const SmNode * GetLeftMost() const
00127                         {
00128                                 return ((SmNode *) this)->GetLeftMost();
00129                         }
00130 
00131                         USHORT &        Flags() { return nFlags; }
00132                         USHORT &        Attributes() { return nAttributes; }
00133 
00134                         BOOL IsDebug() const { return bIsDebug; }
00135                         BOOL IsPhantom() const { return bIsPhantom; }
00136                         void SetPhantom(BOOL bIsPhantom);
00137                         void SetColor(const Color &rColor);
00138 
00139                         void SetAttribut(USHORT nAttrib);
00140                         void ClearAttribut(USHORT nAttrib);
00141 
00142                         const SmFace & GetFont() const { return aFace; };
00143                                   SmFace & GetFont()       { return aFace; };
00144 
00145                         void SetFont(const SmFace &rFace);
00146                         void SetFontSize(const Fraction &rRelSize, USHORT nType);
00147                         void SetSize(const Fraction &rScale);
00148 
00149         virtual void Prepare(const SmFormat &rFormat, const SmDocShell &rDocShell);
00150         virtual void PrepareAttributes();
00151 
00152 #if OSL_DEBUG_LEVEL
00153                         void ToggleDebug() const;
00154 #endif
00155 
00156     void         SetRectHorAlign(RectHorAlign eHorAlign, BOOL bApplyToSubTree = TRUE );
00157         RectHorAlign GetRectHorAlign() const { return eRectHorAlign; }
00158 
00159         const SmRect & GetRect() const { return *this; }
00160                   SmRect & GetRect()       { return *this; }
00161 
00162         virtual void Move(const Point &rPosition);
00163         void MoveTo(const Point &rPosition) { Move(rPosition - GetTopLeft()); }
00164         virtual void Arrange(const OutputDevice &rDev, const SmFormat &rFormat);
00165         virtual void CreateTextFromNode(String &rText);
00166 
00167     using   SmRect::Draw;
00168         virtual void Draw(OutputDevice &rDev, const Point &rPosition) const;
00169 
00170     virtual void    GetAccessibleText( String &rText ) const;
00171     sal_Int32       GetAccessibleIndex() const { return nAccIndex; }
00172     const SmNode *  FindNodeWithAccessibleIndex(xub_StrLen nAccIndex) const;
00173 
00174         USHORT  GetRow() const    { return (USHORT)aNodeToken.nRow; }
00175         USHORT  GetColumn() const { return (USHORT)aNodeToken.nCol; }
00176 
00177         SmScaleMode             GetScaleMode() const { return eScaleMode; }
00178         void                    SetScaleMode(SmScaleMode eMode) { eScaleMode = eMode; }
00179 
00180         virtual void AdaptToX(const OutputDevice &rDev, ULONG nWidth);
00181         virtual void AdaptToY(const OutputDevice &rDev, ULONG nHeight);
00182 
00183         SmNodeType              GetType() const  { return eType; }
00184         const SmToken & GetToken() const { return aNodeToken; }
00185 
00186         const SmNode *  FindTokenAt(USHORT nRow, USHORT nCol) const;
00187         const SmNode *  FindRectClosestTo(const Point &rPoint) const;
00188 };
00189 
00190 
00192 
00193 class SmStructureNode;
00194 
00195 DECLARE_DYNARRAY(SmStructureNodeArray, SmStructureNode *)
00196 
00197 class SmStructureNode : public SmNode
00198 {
00199         SmNodeArray  aSubNodes;
00200 
00201 protected:
00202         SmStructureNode(SmNodeType eNodeType, const SmToken &rNodeToken)
00203         :       SmNode(eNodeType, rNodeToken)
00204         {}
00205 
00206 public:
00207             SmStructureNode( const SmStructureNode &rNode );
00208         virtual ~SmStructureNode();
00209 
00210         virtual BOOL            IsVisible() const;
00211 
00212         virtual USHORT          GetNumSubNodes() const;
00213                         void            SetNumSubNodes(USHORT nSize) { aSubNodes.SetSize(nSize); }
00214 
00215     using   SmNode::GetSubNode;
00216         virtual SmNode *        GetSubNode(USHORT nIndex);
00217                         void SetSubNodes(SmNode *pFirst, SmNode *pSecond,
00218                                                                 SmNode *pThird = NULL);
00219                         void SetSubNodes(const SmNodeArray &rNodeArray);
00220 
00221     virtual SmStructureNode & operator = ( const SmStructureNode &rNode );
00222 
00223     virtual void  GetAccessibleText( String &rText ) const;
00224 };
00225 
00226 
00228 
00229 
00230 class SmVisibleNode : public SmNode
00231 {
00232 protected:
00233         SmVisibleNode(SmNodeType eNodeType, const SmToken &rNodeToken)
00234         :       SmNode(eNodeType, rNodeToken)
00235         {}
00236 
00237 public:
00238 
00239         virtual BOOL            IsVisible() const;
00240         virtual USHORT          GetNumSubNodes() const;
00241     using   SmNode::GetSubNode;
00242         virtual SmNode *        GetSubNode(USHORT nIndex);
00243 };
00244 
00245 
00247 
00248 
00249 class SmGraphicNode : public SmVisibleNode
00250 {
00251 protected:
00252         SmGraphicNode(SmNodeType eNodeType, const SmToken &rNodeToken)
00253         :       SmVisibleNode(eNodeType, rNodeToken)
00254         {}
00255 
00256 public:
00257 
00258     virtual void  GetAccessibleText( String &rText ) const;
00259 };
00260 
00261 
00263 
00264 
00265 class SmRectangleNode : public SmGraphicNode
00266 {
00267         Size  aToSize;
00268 
00269 public:
00270         SmRectangleNode(const SmToken &rNodeToken)
00271         :       SmGraphicNode(NRECTANGLE, rNodeToken)
00272         {}
00273 
00274         virtual void AdaptToX(const OutputDevice &rDev, ULONG nWidth);
00275         virtual void AdaptToY(const OutputDevice &rDev, ULONG nHeight);
00276 
00277         virtual void Arrange(const OutputDevice &rDev, const SmFormat &rFormat);
00278     using   SmRect::Draw;
00279         virtual void Draw(OutputDevice &rDev, const Point &rPosition) const;
00280         void CreateTextFromNode(String &rText);
00281 };
00282 
00283 
00285 
00286 
00287 class SmPolyLineNode : public SmGraphicNode
00288 {
00289         Polygon         aPoly;
00290         Size            aToSize;
00291         long            nWidth;
00292 
00293 public:
00294         SmPolyLineNode(const SmToken &rNodeToken);
00295 
00296         long             GetWidth() const { return nWidth; }
00297 
00298         virtual void AdaptToX(const OutputDevice &rDev, ULONG nWidth);
00299         virtual void AdaptToY(const OutputDevice &rDev, ULONG nHeight);
00300 
00301         virtual void Arrange(const OutputDevice &rDev, const SmFormat &rFormat);
00302     using   SmRect::Draw;
00303         virtual void Draw(OutputDevice &rDev, const Point &rPosition) const;
00304 };
00305 
00306 
00308 
00309 
00310 class SmTextNode : public SmVisibleNode
00311 {
00312     XubString   aText;
00313     USHORT      nFontDesc;
00314 
00315 protected:
00316         SmTextNode(SmNodeType eNodeType, const SmToken &rNodeToken, USHORT nFontDescP)
00317         :       SmVisibleNode(eNodeType, rNodeToken)
00318         {
00319         nFontDesc = nFontDescP;
00320         }
00321 
00322 public:
00323         SmTextNode(const SmToken &rNodeToken, USHORT nFontDescP)
00324         :       SmVisibleNode(NTEXT, rNodeToken)
00325         {
00326                 nFontDesc = nFontDescP;
00327         }
00328 
00329 
00330         USHORT                          GetFontDesc() const { return nFontDesc; }
00331         void                            SetText(const XubString &rText) { aText = rText; }
00332         const XubString &       GetText() const { return aText; }
00333 
00334         virtual void Prepare(const SmFormat &rFormat, const SmDocShell &rDocShell);
00335         virtual void Arrange(const OutputDevice &rDev, const SmFormat &rFormat);
00336         virtual void CreateTextFromNode(String &rText);
00337 
00338     using   SmRect::Draw;
00339         virtual void Draw(OutputDevice &rDev, const Point &rPosition) const;
00340 
00341     virtual void  GetAccessibleText( String &rText ) const;
00342 };
00343 
00344 
00346 
00347 
00348 class SmSpecialNode : public SmTextNode
00349 {
00350 protected:
00351     SmSpecialNode(SmNodeType eNodeType, const SmToken &rNodeToken, USHORT _nFontDesc)
00352     :   SmTextNode(eNodeType, rNodeToken, _nFontDesc)
00353         {}
00354 
00355 public:
00356         SmSpecialNode(const SmToken &rNodeToken)
00357         :       SmTextNode(NSPECIAL, rNodeToken, FNT_MATH)      
00358         {}
00359 
00360         virtual void Prepare(const SmFormat &rFormat, const SmDocShell &rDocShell);
00361         virtual void Arrange(const OutputDevice &rDev, const SmFormat &rFormat);
00362     using   SmRect::Draw;
00363         virtual void Draw(OutputDevice &rDev, const Point &rPosition) const;
00364 };
00365 
00366 
00368 
00369 
00370 class SmGlyphSpecialNode : public SmSpecialNode
00371 {
00372 public:
00373         SmGlyphSpecialNode(const SmToken &rNodeToken)
00374         :       SmSpecialNode(NGLYPH_SPECIAL, rNodeToken, FNT_MATH)
00375         {}
00376 
00377         virtual void Arrange(const OutputDevice &rDev, const SmFormat &rFormat);
00378 };
00379 
00380 
00382 
00383 
00384 class SmMathSymbolNode : public SmSpecialNode
00385 {
00386 protected:
00387         SmMathSymbolNode(SmNodeType eNodeType, const SmToken &rNodeToken)
00388         :       SmSpecialNode(eNodeType, rNodeToken, FNT_MATH)
00389     {
00390         xub_Unicode cChar = GetToken().cMathChar;
00391         if ((xub_Unicode) '\0' != cChar)
00392             SetText( cChar );
00393     }
00394 
00395 public:
00396         SmMathSymbolNode(const SmToken &rNodeToken);
00397 
00398         virtual void AdaptToX(const OutputDevice &rDev, ULONG nWidth);
00399         virtual void AdaptToY(const OutputDevice &rDev, ULONG nHeight);
00400 
00401         virtual void Prepare(const SmFormat &rFormat, const SmDocShell &rDocShell);
00402         virtual void Arrange(const OutputDevice &rDev, const SmFormat &rFormat);
00403         void CreateTextFromNode(String &rText);
00404 };
00405 
00406 
00408 
00409 
00410 class SmRootSymbolNode : public SmMathSymbolNode
00411 {
00412     ULONG  nBodyWidth;  // width of body (argument) of root sign
00413 
00414 public:
00415     SmRootSymbolNode(const SmToken &rNodeToken)
00416     :   SmMathSymbolNode(NROOTSYMBOL, rNodeToken)
00417     {}
00418 
00419     virtual void AdaptToX(const OutputDevice &rDev, ULONG nWidth);
00420     virtual void AdaptToY(const OutputDevice &rDev, ULONG nHeight);
00421 
00422     using   SmRect::Draw;
00423     virtual void Draw(OutputDevice &rDev, const Point &rPosition) const;
00424 };
00425 
00426 
00428 
00429 
00430 class SmPlaceNode : public SmMathSymbolNode
00431 {
00432 public:
00433         SmPlaceNode(const SmToken &rNodeToken)
00434         :       SmMathSymbolNode(NPLACE, rNodeToken)
00435         {
00436         }
00437 
00438         virtual void Prepare(const SmFormat &rFormat, const SmDocShell &rDocShell);
00439         virtual void Arrange(const OutputDevice &rDev, const SmFormat &rFormat);
00440 };
00441 
00442 
00444 
00445 
00446 class SmErrorNode : public SmMathSymbolNode
00447 {
00448 public:
00449     SmErrorNode(SmParseError /*eError*/, const SmToken &rNodeToken)
00450         :       SmMathSymbolNode(NERROR, rNodeToken)
00451         {
00452                 SetText((xub_Unicode) MS_ERROR);
00453         }
00454 
00455         virtual void Prepare(const SmFormat &rFormat, const SmDocShell &rDocShell);
00456         virtual void Arrange(const OutputDevice &rDev, const SmFormat &rFormat);
00457 };
00458 
00459 
00461 
00462 
00463 class SmTableNode : public SmStructureNode
00464 {
00465 public:
00466         SmTableNode(const SmToken &rNodeToken)
00467         :       SmStructureNode(NTABLE, rNodeToken)
00468         {}
00469 
00470     using   SmNode::GetLeftMost;
00471         virtual SmNode * GetLeftMost();
00472 
00473         virtual void Arrange(const OutputDevice &rDev, const SmFormat &rFormat);
00474 };
00475 
00476 
00478 
00479 
00480 class SmLineNode : public SmStructureNode
00481 {
00482 protected:
00483         SmLineNode(SmNodeType eNodeType, const SmToken &rNodeToken)
00484         :       SmStructureNode(eNodeType, rNodeToken)
00485         {}
00486 
00487 public:
00488         SmLineNode(const SmToken &rNodeToken)
00489         :       SmStructureNode(NLINE, rNodeToken)
00490         {}
00491 
00492         virtual void Prepare(const SmFormat &rFormat, const SmDocShell &rDocShell);
00493         virtual void Arrange(const OutputDevice &rDev, const SmFormat &rFormat);
00494 };
00495 
00496 
00498 
00499 
00500 class SmExpressionNode : public SmLineNode
00501 {
00502 public:
00503         SmExpressionNode(const SmToken &rNodeToken)
00504         :       SmLineNode(NEXPRESSION, rNodeToken)
00505         {}
00506 
00507         virtual void Arrange(const OutputDevice &rDev, const SmFormat &rFormat);
00508         void CreateTextFromNode(String &rText);
00509 };
00510 
00511 
00513 
00514 
00515 class SmUnHorNode : public SmStructureNode
00516 {
00517 public:
00518         SmUnHorNode(const SmToken &rNodeToken)
00519         :       SmStructureNode(NUNHOR, rNodeToken)
00520         {
00521                 SetNumSubNodes(2);
00522         }
00523 
00524         virtual void Arrange(const OutputDevice &rDev, const SmFormat &rFormat);
00525 };
00526 
00527 
00529 
00530 
00531 class SmRootNode : public SmStructureNode
00532 {
00533 protected:
00534         void   GetHeightVerOffset(const SmRect &rRect,
00535                                                           long &rHeight, long &rVerOffset) const;
00536         Point  GetExtraPos(const SmRect &rRootSymbol, const SmRect &rExtra) const;
00537 
00538 public:
00539         SmRootNode(const SmToken &rNodeToken)
00540         :       SmStructureNode(NROOT, rNodeToken)
00541         {
00542                 SetNumSubNodes(3);
00543         }
00544 
00545         virtual void Arrange(const OutputDevice &rDev, const SmFormat &rFormat);
00546         void CreateTextFromNode(String &rText);
00547 };
00548 
00549 
00551 
00552 
00553 class SmBinHorNode : public SmStructureNode
00554 {
00555 public:
00556         SmBinHorNode(const SmToken &rNodeToken)
00557         :       SmStructureNode(NBINHOR, rNodeToken)
00558         {
00559                 SetNumSubNodes(3);
00560         }
00561 
00562         virtual void Arrange(const OutputDevice &rDev, const SmFormat &rFormat);
00563 };
00564 
00565 
00567 
00568 
00569 class SmBinVerNode : public SmStructureNode
00570 {
00571 public:
00572         SmBinVerNode(const SmToken &rNodeToken)
00573         :       SmStructureNode(NBINVER, rNodeToken)
00574         {
00575                 SetNumSubNodes(3);
00576         }
00577 
00578     using   SmNode::GetLeftMost;
00579         virtual SmNode * GetLeftMost();
00580 
00581         virtual void Arrange(const OutputDevice &rDev, const SmFormat &rFormat);
00582         void CreateTextFromNode(String &rText);
00583 };
00584 
00585 
00587 
00588 
00589 class SmBinDiagonalNode : public SmStructureNode
00590 {
00591         BOOL    bAscending;
00592 
00593         void    GetOperPosSize(Point &rPos, Size &rSize,
00594                                                    const Point &rDiagPoint, double fAngleDeg) const;
00595 
00596 public:
00597         SmBinDiagonalNode(const SmToken &rNodeToken);
00598 
00599         BOOL    IsAscending() const { return bAscending; }
00600         void    SetAscending(BOOL bVal)  { bAscending = bVal; }
00601 
00602         virtual void Arrange(const OutputDevice &rDev, const SmFormat &rFormat);
00603 };
00604 
00605 
00607 
00608 
00609 // enums used to index sub-/supscripts in the 'aSubNodes' array
00610 // in 'SmSubSupNode'
00611 // See graphic for positions at char:
00612 //
00613 //              CSUP
00614 //
00615 // LSUP H  H RSUP
00616 //              H  H
00617 //              HHHH
00618 //              H  H
00619 // LSUB H  H RSUB
00620 //
00621 //              CSUB
00622 //
00623 enum SmSubSup
00624 {       CSUB, CSUP, RSUB, RSUP, LSUB, LSUP
00625 };
00626 
00627 // numbers of entries in the above enum (that is: the number of possible
00628 // sub-/supscripts)
00629 #define SUBSUP_NUM_ENTRIES 6
00630 
00631 
00632 class SmSubSupNode : public SmStructureNode
00633 {
00634         BOOL  bUseLimits;
00635 
00636 public:
00637         SmSubSupNode(const SmToken &rNodeToken)
00638         :       SmStructureNode(NSUBSUP, rNodeToken)
00639         {
00640                 SetNumSubNodes(1 + SUBSUP_NUM_ENTRIES);
00641                 bUseLimits = FALSE;
00642         }
00643 
00644         SmNode *           GetBody()    { return GetSubNode(0); }
00645         const SmNode * GetBody() const
00646         {
00647                 return ((SmSubSupNode *) this)->GetBody();
00648         }
00649 
00650         void  SetUseLimits(BOOL bVal) { bUseLimits = bVal; }
00651         BOOL  IsUseLimits() const { return bUseLimits; };
00652 
00653     SmNode * GetSubSup(SmSubSup eSubSup) { return GetSubNode( sal::static_int_cast< USHORT >(1 + eSubSup) ); };
00654 
00655         virtual void Arrange(const OutputDevice &rDev, const SmFormat &rFormat);
00656         void CreateTextFromNode(String &rText);
00657 
00658 };
00659 
00660 
00662 
00663 
00664 class SmBraceNode : public SmStructureNode
00665 {
00666 public:
00667         SmBraceNode(const SmToken &rNodeToken)
00668         :       SmStructureNode(NBRACE, rNodeToken)
00669         {
00670                 SetNumSubNodes(3);
00671         }
00672 
00673         virtual void Arrange(const OutputDevice &rDev, const SmFormat &rFormat);
00674         void CreateTextFromNode(String &rText);
00675 };
00676 
00677 
00679 
00680 
00681 class SmBracebodyNode : public SmStructureNode
00682 {
00683         long  nBodyHeight;
00684 
00685 public:
00686         inline SmBracebodyNode(const SmToken &rNodeToken);
00687 
00688         virtual void    Arrange(const OutputDevice &rDev, const SmFormat &rFormat);
00689         long                GetBodyHeight() const { return nBodyHeight; }
00690 };
00691 
00692 
00693 inline SmBracebodyNode::SmBracebodyNode(const SmToken &rNodeToken) :
00694         SmStructureNode(NBRACEBODY, rNodeToken)
00695 {
00696         nBodyHeight = 0;
00697 }
00698 
00699 
00701 
00702 
00703 class SmVerticalBraceNode : public SmStructureNode
00704 {
00705 public:
00706         inline SmVerticalBraceNode(const SmToken &rNodeToken);
00707 
00708         virtual void    Arrange(const OutputDevice &rDev, const SmFormat &rFormat);
00709 };
00710 
00711 
00712 inline SmVerticalBraceNode::SmVerticalBraceNode(const SmToken &rNodeToken) :
00713         SmStructureNode(NVERTICAL_BRACE, rNodeToken)
00714 {
00715         SetNumSubNodes(3);
00716 }
00717 
00718 
00720 
00721 
00722 class SmOperNode : public SmStructureNode
00723 {
00724 public:
00725         SmOperNode(const SmToken &rNodeToken)
00726         :       SmStructureNode(NOPER, rNodeToken)
00727         {
00728                 SetNumSubNodes(2);
00729         }
00730 
00731         SmNode *           GetSymbol();
00732         const SmNode * GetSymbol() const
00733         {
00734                 return ((SmOperNode *) this)->GetSymbol();
00735         }
00736 
00737         long CalcSymbolHeight(const SmNode &rSymbol, const SmFormat &rFormat) const;
00738 
00739         virtual void Arrange(const OutputDevice &rDev, const SmFormat &rFormat);
00740 };
00741 
00742 
00744 
00745 
00746 class SmAlignNode : public SmStructureNode
00747 {
00748 public:
00749         SmAlignNode(const SmToken &rNodeToken)
00750         :       SmStructureNode(NALIGN, rNodeToken)
00751         {}
00752 
00753         virtual void Arrange(const OutputDevice &rDev, const SmFormat &rFormat);
00754 };
00755 
00756 
00758 
00759 
00760 class SmAttributNode : public SmStructureNode
00761 {
00762 public:
00763         SmAttributNode(const SmToken &rNodeToken)
00764         :       SmStructureNode(NATTRIBUT, rNodeToken)
00765         {}
00766 
00767         virtual void Arrange(const OutputDevice &rDev, const SmFormat &rFormat);
00768         void CreateTextFromNode(String &rText);
00769 };
00770 
00771 
00773 
00774 
00775 class SmFontNode : public SmStructureNode
00776 {
00777         USHORT          nSizeType;
00778         Fraction        aFontSize;
00779 
00780 public:
00781         SmFontNode(const SmToken &rNodeToken)
00782         :       SmStructureNode(NFONT, rNodeToken)
00783         {
00784                 nSizeType = FNTSIZ_MULTIPLY;
00785                 aFontSize = Fraction(1L);
00786         }
00787 
00788         void SetSizeParameter(const Fraction &rValue, USHORT nType);
00789         const Fraction & GetSizeParameter() const {return aFontSize;}
00790         const USHORT& GetSizeType() const {return nSizeType;}
00791 
00792         virtual void Prepare(const SmFormat &rFormat, const SmDocShell &rDocShell);
00793         virtual void Arrange(const OutputDevice &rDev, const SmFormat &rFormat);
00794         void CreateTextFromNode(String &rText);
00795 };
00796 
00797 
00799 
00800 
00801 class SmMatrixNode : public SmStructureNode
00802 {
00803         USHORT  nNumRows,
00804                         nNumCols;
00805 
00806 public:
00807         SmMatrixNode(const SmToken &rNodeToken)
00808         :       SmStructureNode(NMATRIX, rNodeToken)
00809         {
00810                 nNumRows = nNumCols = 0;
00811         }
00812 
00813         USHORT GetNumRows() const {return nNumRows;}
00814         USHORT GetNumCols() const {return nNumCols;}
00815         void SetRowCol(USHORT nMatrixRows, USHORT nMatrixCols);
00816 
00817     using   SmNode::GetLeftMost;
00818         virtual SmNode * GetLeftMost();
00819 
00820         virtual void Arrange(const OutputDevice &rDev, const SmFormat &rFormat);
00821         void CreateTextFromNode(String &rText);
00822 };
00823 
00824 
00826 
00827 
00828 class SmBlankNode : public SmGraphicNode
00829 {
00830         USHORT  nNum;
00831 
00832 public:
00833         SmBlankNode(const SmToken &rNodeToken)
00834         :       SmGraphicNode(NBLANK, rNodeToken)
00835         {
00836                 nNum = 0;
00837         }
00838 
00839         void         IncreaseBy(const SmToken &rToken);
00840         void             Clear() { nNum = 0; }
00841 
00842         virtual void Prepare(const SmFormat &rFormat, const SmDocShell &rDocShell);
00843         virtual void Arrange(const OutputDevice &rDev, const SmFormat &rFormat);
00844 };
00845 
00846 
00848 
00849 #endif
00850 
00851 

Generated on Wed Feb 20 17:21:56 2008 for maths by  doxygen 1.5.1