Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*************************************************************************
3 : : *
4 : : * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 : : *
6 : : * Copyright 2000, 2010 Oracle and/or its affiliates.
7 : : *
8 : : * OpenOffice.org - a multi-platform office productivity suite
9 : : *
10 : : * This file is part of OpenOffice.org.
11 : : *
12 : : * OpenOffice.org is free software: you can redistribute it and/or modify
13 : : * it under the terms of the GNU Lesser General Public License version 3
14 : : * only, as published by the Free Software Foundation.
15 : : *
16 : : * OpenOffice.org is distributed in the hope that it will be useful,
17 : : * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 : : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 : : * GNU Lesser General Public License version 3 for more details
20 : : * (a copy is included in the LICENSE file that accompanied this code).
21 : : *
22 : : * You should have received a copy of the GNU Lesser General Public License
23 : : * version 3 along with OpenOffice.org. If not, see
24 : : * <http://www.openoffice.org/license.html>
25 : : * for a copy of the LGPLv3 License.
26 : : *
27 : : ************************************************************************/
28 : :
29 : : #ifndef _WW8PAR2_HXX
30 : : #define _WW8PAR2_HXX
31 : :
32 : : #include <swtypes.hxx> // enum RndStdIds
33 : : #include <fmtfsize.hxx>
34 : : #include <fmtornt.hxx>
35 : : #include <fmtsrnd.hxx>
36 : : #include <editeng/lrspitem.hxx>
37 : :
38 : : #include "ww8scan.hxx" // class WW8Style
39 : : #include "ww8par.hxx" // WW8_BRC5
40 : :
41 : : class WW8RStyle;
42 : :
43 [ + - ]: 204 : class WW8DupProperties
44 : : {
45 : : public:
46 : : WW8DupProperties(SwDoc &rDoc, SwWW8FltControlStack *pStk);
47 : : void Insert(const SwPosition &rPos);
48 : : private:
49 : : //No copying
50 : : WW8DupProperties(const WW8DupProperties&);
51 : : WW8DupProperties& operator=(const WW8DupProperties&);
52 : : SwWW8FltControlStack* pCtrlStck;
53 : : SfxItemSet aChrSet,aParSet;
54 : : };
55 : :
56 : :
57 : : struct WW8SwFlyPara
58 : : {
59 : : SwFlyFrmFmt* pFlyFmt;
60 : :
61 : : // 1. Teil: daraus abgeleitete Sw-Attribute
62 : : sal_Int16 nXPos, nYPos; // Position
63 : : sal_Int16 nLeMgn, nRiMgn; // Raender
64 : : sal_Int16 nUpMgn, nLoMgn; // Raender
65 : : sal_Int16 nWidth, nHeight; // Groesse
66 : : sal_Int16 nNettoWidth;
67 : :
68 : : SwFrmSize eHeightFix; // Hoehe Fix oder Min
69 : : RndStdIds eAnchor; // Bindung
70 : : short eHRel; // Seite oder Seitenrand
71 : : short eVRel; // Seite oder Seitenrand
72 : : sal_Int16 eVAlign; // Oben, unten, mittig
73 : : sal_Int16 eHAlign; // links, rechts, mittig
74 : : SwSurround eSurround; // Wrap-Mode
75 : :
76 : : sal_uInt8 nXBind, nYBind; // relativ zu was gebunden
77 : :
78 : : // 2.Teil: sich waehrend des Einlesens ergebende AEnderungen
79 : : long nNewNettoWidth;
80 : : SwPosition* pMainTextPos; // um nach Apo in Haupttext zurueckzukehren
81 : : sal_uInt16 nLineSpace; // LineSpace in tw fuer Graf-Apos
82 : : bool bAutoWidth;
83 : : bool bToggelPos;
84 : :
85 : : // add parameter <nWWPgTop> - WW8's page top margin
86 : : WW8SwFlyPara( SwPaM& rPaM,
87 : : WW8FlyPara& rWW,
88 : : const sal_uInt32 nWWPgTop,
89 : : const sal_uInt32 nPgLeft,
90 : : const sal_uInt32 nPgWidth,
91 : : const sal_Int32 nIniFlyDx,
92 : : const sal_Int32 nIniFlyDy );
93 : :
94 : : void BoxUpWidth( long nWidth );
95 : : SwWW8FltAnchorStack *pOldAnchorStck;
96 : : };
97 : :
98 : : class WW8RStyle: public WW8Style
99 : : {
100 : : friend class SwWW8ImplReader;
101 : : wwSprmParser maSprmParser;
102 : : SwWW8ImplReader* pIo; // Parser-Klasse
103 : : SvStream* pStStrm; // Input-File
104 : :
105 : : SwNumRule* pStyRule; // Bullets und Aufzaehlungen in Styles
106 : :
107 : : sal_uInt8* pParaSprms; // alle ParaSprms des UPX falls UPX.Papx
108 : : sal_uInt16 nSprmsLen; // Laenge davon
109 : :
110 : : sal_uInt8 nWwNumLevel; // fuer Bullets und Aufzaehlungen in Styles
111 : :
112 : : bool bTxtColChanged;
113 : : bool bFontChanged; // For Simulating Default-Font
114 : : bool bCJKFontChanged; // For Simulating Default-CJK Font
115 : : bool bCTLFontChanged; // For Simulating Default-CTL Font
116 : : bool bFSizeChanged; // For Simulating Default-FontSize
117 : : bool bFCTLSizeChanged; // For Simulating Default-CTL FontSize
118 : : bool bWidowsChanged; // For Simulating Default-Widows / Orphans
119 : :
120 : : void ImportSprms(sal_Size nPosFc, short nLen, bool bPap);
121 : : void ImportSprms(sal_uInt8 *pSprms, short nLen, bool bPap);
122 : : void ImportGrupx(short nLen, bool bPara, bool bOdd);
123 : : short ImportUPX(short nLen, bool bPAP, bool bOdd);
124 : :
125 : : void Set1StyleDefaults();
126 : : void Import1Style(sal_uInt16 nNr);
127 : : void RecursiveReg(sal_uInt16 nNr);
128 : :
129 : : void ImportStyles();
130 : :
131 : : void ImportNewFormatStyles();
132 : : void ScanStyles();
133 : : void ImportOldFormatStyles();
134 : :
135 : : bool PrepareStyle(SwWW8StyInf &rSI, ww::sti eSti, sal_uInt16 nThisStyle, sal_uInt16 nNextStyle);
136 : : void PostStyle(SwWW8StyInf &rSI, bool bOldNoImp);
137 : :
138 : : //No copying
139 : : WW8RStyle(const WW8RStyle&);
140 : : WW8RStyle& operator=(const WW8RStyle&);
141 : : public:
142 : : WW8RStyle( WW8Fib& rFib, SwWW8ImplReader* pI );
143 : : void Import();
144 : : void PostProcessStyles();
145 : : const sal_uInt8* HasParaSprm( sal_uInt16 nId ) const;
146 : : };
147 : :
148 [ - + ]: 27 : class WW8FlySet: public SfxItemSet
149 : : {
150 : : private:
151 : : //No copying
152 : : const WW8FlySet& operator=(const WW8FlySet&);
153 : : void Init(const SwWW8ImplReader& rReader, const SwPaM* pPaM);
154 : : public:
155 : : WW8FlySet(SwWW8ImplReader& rReader, const WW8FlyPara* pFW,
156 : : const WW8SwFlyPara* pFS, bool bGraf);
157 : : WW8FlySet(SwWW8ImplReader& rReader, const SwPaM* pPaM, const WW8_PIC& rPic,
158 : : long nWidth, long nHeight);
159 : : };
160 : :
161 : : enum WW8LvlType {WW8_None, WW8_Outline, WW8_Numbering, WW8_Sequence, WW8_Pause};
162 : :
163 : : WW8LvlType GetNumType(sal_uInt8 nWwLevelNo);
164 : : #endif
165 : :
166 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|