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