Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
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/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
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 .
18 : */
19 :
20 : #ifndef _WW8PAR2_HXX
21 : #define _WW8PAR2_HXX
22 :
23 : #include <swtypes.hxx> // enum RndStdIds
24 : #include <fmtfsize.hxx>
25 : #include <fmtornt.hxx>
26 : #include <fmtsrnd.hxx>
27 : #include <editeng/lrspitem.hxx>
28 :
29 : #include "ww8scan.hxx" // class WW8Style
30 : #include "ww8par.hxx" // WW8_BRC5
31 :
32 : class WW8RStyle;
33 :
34 94 : class WW8DupProperties
35 : {
36 : public:
37 : WW8DupProperties(SwDoc &rDoc, SwWW8FltControlStack *pStk);
38 : void Insert(const SwPosition &rPos);
39 : private:
40 : //No copying
41 : WW8DupProperties(const WW8DupProperties&);
42 : WW8DupProperties& operator=(const WW8DupProperties&);
43 : SwWW8FltControlStack* pCtrlStck;
44 : SfxItemSet aChrSet,aParSet;
45 : };
46 :
47 :
48 : struct WW8SwFlyPara
49 : {
50 : SwFlyFrmFmt* pFlyFmt;
51 :
52 : // 1. Teil: daraus abgeleitete Sw-Attribute
53 : sal_Int16 nXPos, nYPos; // Position
54 : sal_Int16 nLeMgn, nRiMgn; // Raender
55 : sal_Int16 nUpMgn, nLoMgn; // Raender
56 : sal_Int16 nWidth, nHeight; // Groesse
57 : sal_Int16 nNettoWidth;
58 :
59 : SwFrmSize eHeightFix; // Hoehe Fix oder Min
60 : RndStdIds eAnchor; // Bindung
61 : short eHRel; // Seite oder Seitenrand
62 : short eVRel; // Seite oder Seitenrand
63 : sal_Int16 eVAlign; // Oben, unten, mittig
64 : sal_Int16 eHAlign; // links, rechts, mittig
65 : SwSurround eSurround; // Wrap-Mode
66 :
67 : sal_uInt8 nXBind, nYBind; // relativ zu was gebunden
68 :
69 : // 2.Teil: sich waehrend des Einlesens ergebende AEnderungen
70 : long nNewNettoWidth;
71 : SwPosition* pMainTextPos; // um nach Apo in Haupttext zurueckzukehren
72 : sal_uInt16 nLineSpace; // LineSpace in tw fuer Graf-Apos
73 : bool bAutoWidth;
74 : bool bToggelPos;
75 :
76 : // add parameter <nWWPgTop> - WW8's page top margin
77 : WW8SwFlyPara( SwPaM& rPaM,
78 : WW8FlyPara& rWW,
79 : const sal_uInt32 nWWPgTop,
80 : const sal_uInt32 nPgLeft,
81 : const sal_uInt32 nPgWidth,
82 : const sal_Int32 nIniFlyDx,
83 : const sal_Int32 nIniFlyDy );
84 :
85 : void BoxUpWidth( long nWidth );
86 : SwWW8FltAnchorStack *pOldAnchorStck;
87 : };
88 :
89 : class WW8RStyle: public WW8Style
90 : {
91 : friend class SwWW8ImplReader;
92 : wwSprmParser maSprmParser;
93 : SwWW8ImplReader* pIo; // Parser-Klasse
94 : SvStream* pStStrm; // Input-File
95 :
96 : SwNumRule* pStyRule; // Bullets und Aufzaehlungen in Styles
97 :
98 : sal_uInt8* pParaSprms; // alle ParaSprms des UPX falls UPX.Papx
99 : sal_uInt16 nSprmsLen; // Laenge davon
100 :
101 : sal_uInt8 nWwNumLevel; // fuer Bullets und Aufzaehlungen in Styles
102 :
103 : bool bTxtColChanged;
104 : bool bFontChanged; // For Simulating Default-Font
105 : bool bCJKFontChanged; // For Simulating Default-CJK Font
106 : bool bCTLFontChanged; // For Simulating Default-CTL Font
107 : bool bFSizeChanged; // For Simulating Default-FontSize
108 : bool bFCTLSizeChanged; // For Simulating Default-CTL FontSize
109 : bool bWidowsChanged; // For Simulating Default-Widows / Orphans
110 :
111 : void ImportSprms(sal_Size nPosFc, short nLen, bool bPap);
112 : void ImportSprms(sal_uInt8 *pSprms, short nLen, bool bPap);
113 : void ImportGrupx(short nLen, bool bPara, bool bOdd);
114 : short ImportUPX(short nLen, bool bPAP, bool bOdd);
115 :
116 : void Set1StyleDefaults();
117 : void Import1Style(sal_uInt16 nNr);
118 : void RecursiveReg(sal_uInt16 nNr);
119 :
120 : void ImportStyles();
121 :
122 : void ImportNewFormatStyles();
123 : void ScanStyles();
124 : void ImportOldFormatStyles();
125 :
126 : bool PrepareStyle(SwWW8StyInf &rSI, ww::sti eSti, sal_uInt16 nThisStyle, sal_uInt16 nNextStyle);
127 : void PostStyle(SwWW8StyInf &rSI, bool bOldNoImp);
128 :
129 : //No copying
130 : WW8RStyle(const WW8RStyle&);
131 : WW8RStyle& operator=(const WW8RStyle&);
132 : public:
133 : WW8RStyle( WW8Fib& rFib, SwWW8ImplReader* pI );
134 : void Import();
135 : void PostProcessStyles();
136 : const sal_uInt8* HasParaSprm( sal_uInt16 nId ) const;
137 : };
138 :
139 17 : class WW8FlySet: public SfxItemSet
140 : {
141 : private:
142 : //No copying
143 : const WW8FlySet& operator=(const WW8FlySet&);
144 : void Init(const SwWW8ImplReader& rReader, const SwPaM* pPaM);
145 : public:
146 : WW8FlySet(SwWW8ImplReader& rReader, const WW8FlyPara* pFW,
147 : const WW8SwFlyPara* pFS, bool bGraf);
148 : WW8FlySet(SwWW8ImplReader& rReader, const SwPaM* pPaM, const WW8_PIC& rPic,
149 : long nWidth, long nHeight);
150 : };
151 :
152 : enum WW8LvlType {WW8_None, WW8_Outline, WW8_Numbering, WW8_Sequence, WW8_Pause};
153 :
154 : WW8LvlType GetNumType(sal_uInt8 nWwLevelNo);
155 : #endif
156 :
157 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|