1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef INCLUDED_SW_SOURCE_FILTER_WW8_WW8PAR2_HXX
21 #define INCLUDED_SW_SOURCE_FILTER_WW8_WW8PAR2_HXX
23 #include <swtypes.hxx>
24 #include <fmtfsize.hxx>
25 #include <fmtornt.hxx>
26 #include <fmtsrnd.hxx>
27 #include <editeng/lrspitem.hxx>
29 #include "ww8scan.hxx"
34 class WW8DupProperties
37 WW8DupProperties(SwDoc
&rDoc
, SwWW8FltControlStack
*pStack
);
38 void Insert(const SwPosition
&rPos
);
40 WW8DupProperties(const WW8DupProperties
&) = delete;
41 WW8DupProperties
& operator=(const WW8DupProperties
&) = delete;
42 SwWW8FltControlStack
* pCtrlStck
;
43 SfxItemSet aChrSet
,aParSet
;
48 SwFlyFrameFormat
* pFlyFormat
;
50 // part 1: directly derived Sw attributes
51 sal_Int16 nXPos
, nYPos
; // Position
52 sal_Int16 nLeMgn
, nRiMgn
; // borders
53 sal_Int16 nUpMgn
, nLoMgn
; // borders
54 sal_Int16 nWidth
, nHeight
; // size
57 SwFrameSize eHeightFix
; // height fixed or min
58 RndStdIds eAnchor
; // binding
59 short eHRel
; // page or page border
60 short eVRel
; // page or page border
61 sal_Int16 eVAlign
; // up, down, centered
62 sal_Int16 eHAlign
; // left, right, centered
63 SwSurround eSurround
; // wrap mode
65 sal_uInt8 nXBind
, nYBind
; // bound relative to what
67 // part 2: changes found during reading
69 SwPosition
* pMainTextPos
; // to return to main text after apo
70 sal_uInt16 nLineSpace
; // line space in tw for graf apos
74 // add parameter <nWWPgTop> - WW8's page top margin
75 WW8SwFlyPara( SwPaM
& rPaM
,
78 const sal_uInt32 nWWPgTop
,
79 const sal_uInt32 nPgLeft
,
80 const sal_uInt32 nPgWidth
,
81 const sal_Int32 nIniFlyDx
,
82 const sal_Int32 nIniFlyDy
);
84 void BoxUpWidth( long nWidth
);
85 SwWW8FltAnchorStack
*pOldAnchorStck
;
88 class WW8RStyle
: public WW8Style
90 friend class SwWW8ImplReader
;
91 wwSprmParser maSprmParser
;
92 SwWW8ImplReader
* pIo
; // parser class
93 SvStream
* pStStrm
; // input file
95 SwNumRule
* pStyRule
; // bullets and enumerations in styles
97 sal_uInt8
* pParaSprms
; // all ParaSprms of the UPX if UPX.Papx
98 sal_uInt16 nSprmsLen
; // its length
100 sal_uInt8 nWwNumLevel
; // for bullets and enumerations in styles
102 bool bTextColChanged
;
103 bool bFontChanged
; // For Simulating Default-Font
104 bool bCJKFontChanged
; // For Simulating Default-CJK Font
105 bool bCTLFontChanged
; // For Simulating Default-CTL Font
106 bool bFSizeChanged
; // For Simulating Default-FontSize
107 bool bFCTLSizeChanged
; // For Simulating Default-CTL FontSize
108 bool bWidowsChanged
; // For Simulating Default-Widows / Orphans
110 void ImportSprms(std::size_t nPosFc
, short nLen
, bool bPap
);
111 void ImportSprms(sal_uInt8
*pSprms
, short nLen
, bool bPap
);
112 void ImportGrupx(short nLen
, bool bPara
, bool bOdd
);
113 short ImportUPX(short nLen
, bool bPAP
, bool bOdd
);
115 void Set1StyleDefaults();
116 void Import1Style(sal_uInt16 nNr
);
117 void RecursiveReg(sal_uInt16 nNr
);
119 void ImportNewFormatStyles();
121 void ImportOldFormatStyles();
123 bool PrepareStyle(SwWW8StyInf
&rSI
, ww::sti eSti
, sal_uInt16 nThisStyle
, sal_uInt16 nNextStyle
);
124 void PostStyle(SwWW8StyInf
&rSI
, bool bOldNoImp
);
126 WW8RStyle(const WW8RStyle
&) = delete;
127 WW8RStyle
& operator=(const WW8RStyle
&) = delete;
129 WW8RStyle( WW8Fib
& rFib
, SwWW8ImplReader
* pI
);
131 void PostProcessStyles();
132 const sal_uInt8
* HasParaSprm( sal_uInt16 nId
) const;
135 class WW8FlySet
: public SfxItemSet
138 const WW8FlySet
& operator=(const WW8FlySet
&) = delete;
139 void Init(const SwWW8ImplReader
& rReader
, const SwPaM
* pPaM
);
141 WW8FlySet(SwWW8ImplReader
& rReader
, const WW8FlyPara
* pFW
,
142 const WW8SwFlyPara
* pFS
, bool bGraf
);
143 WW8FlySet(SwWW8ImplReader
& rReader
, const SwPaM
* pPaM
, const WW8_PIC
& rPic
,
144 long nWidth
, long nHeight
);
147 enum WW8LvlType
{WW8_None
, WW8_Outline
, WW8_Numbering
, WW8_Sequence
, WW8_Pause
};
149 WW8LvlType
GetNumType(sal_uInt8 nWwLevelNo
);
152 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */