Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*************************************************************************
3 : *
4 : * The Contents of this file are made available subject to the terms of
5 : * either of the following licenses
6 : *
7 : * - GNU Lesser General Public License Version 2.1
8 : * - Sun Industry Standards Source License Version 1.1
9 : *
10 : * Sun Microsystems Inc., October, 2000
11 : *
12 : * GNU Lesser General Public License Version 2.1
13 : * =============================================
14 : * Copyright 2000 by Sun Microsystems, Inc.
15 : * 901 San Antonio Road, Palo Alto, CA 94303, USA
16 : *
17 : * This library is free software; you can redistribute it and/or
18 : * modify it under the terms of the GNU Lesser General Public
19 : * License version 2.1, as published by the Free Software Foundation.
20 : *
21 : * This library is distributed in the hope that it will be useful,
22 : * but WITHOUT ANY WARRANTY; without even the implied warranty of
23 : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
24 : * Lesser General Public License for more details.
25 : *
26 : * You should have received a copy of the GNU Lesser General Public
27 : * License along with this library; if not, write to the Free Software
28 : * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
29 : * MA 02111-1307 USA
30 : *
31 : *
32 : * Sun Industry Standards Source License Version 1.1
33 : * =================================================
34 : * The contents of this file are subject to the Sun Industry Standards
35 : * Source License Version 1.1 (the "License"); You may not use this file
36 : * except in compliance with the License. You may obtain a copy of the
37 : * License at http://www.openoffice.org/license.html.
38 : *
39 : * Software provided under this License is provided on an "AS IS" basis,
40 : * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
41 : * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
42 : * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
43 : * See the License for the specific provisions governing your rights and
44 : * obligations concerning the Software.
45 : *
46 : * The Initial Developer of the Original Code is: IBM Corporation
47 : *
48 : * Copyright: 2008 by IBM Corporation
49 : *
50 : * All Rights Reserved.
51 : *
52 : * Contributor(s): _______________________________________
53 : *
54 : *
55 : ************************************************************************/
56 : /*************************************************************************
57 : * @file
58 : * For LWP filter architecture prototype
59 : ************************************************************************/
60 : /*************************************************************************
61 : * Change History
62 : Jan 2005 Created
63 : ************************************************************************/
64 :
65 : #ifndef INCLUDED_LOTUSWORDPRO_SOURCE_FILTER_LWPFOUNDRY_HXX
66 : #define INCLUDED_LOTUSWORDPRO_SOURCE_FILTER_LWPFOUNDRY_HXX
67 :
68 : #include "lwpheader.hxx"
69 : #include "lwpobjid.hxx"
70 : #include "lwpobjstrm.hxx"
71 : #include "lwpcolor.hxx"
72 : #include "lwpbasetype.hxx"
73 : #include "lwpfont.hxx"
74 : #include "lwpdropcapmgr.hxx"
75 :
76 : class LwpDocument;
77 : class LwpBookMark;
78 :
79 : #include <vector>
80 : #define TAG_USER_VERSION 0x72655655UL // "UVer"
81 :
82 : class LwpVersionManager
83 : {
84 : public:
85 18 : LwpVersionManager(){}
86 18 : ~LwpVersionManager(){}
87 : public:
88 : void Read(LwpObjectStream *pStrm);
89 : void Skip(LwpObjectStream *pStrm);
90 : };
91 :
92 : class LwpObjectManager
93 : {
94 : public:
95 18 : LwpObjectManager(){}
96 18 : ~LwpObjectManager(){}
97 : private:
98 : LwpObjectID m_Division;
99 : public:
100 : void Read(LwpObjectStream *pStrm);
101 : };
102 :
103 : class LwpNumberManager
104 : {
105 : public:
106 18 : LwpNumberManager(){}
107 18 : ~LwpNumberManager(){}
108 : private:
109 : LwpObjectID m_TableRange;
110 : public:
111 : void Read(LwpObjectStream *pStrm);
112 2 : LwpObjectID GetTableRangeID(){ return m_TableRange;}
113 : };
114 :
115 : class LwpBulletManager
116 : {
117 : public:
118 18 : LwpBulletManager(){}
119 18 : ~LwpBulletManager(){}
120 : private:
121 : LwpObjectID m_Head;
122 : public:
123 : void Read(LwpObjectStream *pStrm);
124 16 : LwpObjectID& GetHeadID() { return m_Head;}
125 : };
126 :
127 : class LwpContent;
128 : class LwpContentManager
129 : {
130 : public:
131 18 : LwpContentManager(){}
132 18 : ~LwpContentManager(){}
133 : private:
134 : LwpObjectID m_ContentList;
135 : LwpObjectID m_EnumHead;
136 : LwpObjectID m_EnumTail;
137 : LwpObjectID m_OleObjCount;
138 :
139 : LwpObjectID m_GrapHead;
140 : LwpObjectID m_GrapTail;
141 : LwpObjectID m_OleHead;
142 : LwpObjectID m_OleTail;
143 : public:
144 16 : inline LwpObjectID& GetContentList() { return m_ContentList; }
145 16 : inline LwpObjectID& GetGraphicListHead() { return m_GrapHead; }
146 : LwpContent* EnumContents(LwpContent* pContent);
147 :
148 : public:
149 : void Read(LwpObjectStream *pStrm);
150 : };
151 :
152 : class LwpPieceManager
153 : {
154 : public:
155 10 : LwpPieceManager(){}
156 10 : ~LwpPieceManager(){}
157 : private:
158 : LwpObjectID m_GeometryPieceList;
159 : LwpObjectID m_ScalePieceList;
160 : LwpObjectID m_MarginsPieceList;
161 : LwpObjectID m_ColumnsPieceList;
162 : LwpObjectID m_BorderStuffPieceList;
163 : LwpObjectID m_GutterStuffPieceList;
164 : LwpObjectID m_BackgroundStuffPieceList;
165 : LwpObjectID m_JoinStuffPieceList;
166 : LwpObjectID m_ShadowPieceList;
167 : LwpObjectID m_NumericsPieceList;
168 : LwpObjectID m_RelativityPieceList;
169 : LwpObjectID m_AlignmentPieceList;
170 : LwpObjectID m_IndentPieceList;
171 : LwpObjectID m_ParaBorderPieceList;
172 : LwpObjectID m_SpacingPieceList;
173 : LwpObjectID m_BreaksPieceList;
174 : LwpObjectID m_NumberingPieceList;
175 : LwpObjectID m_TabPieceList;
176 : LwpObjectID m_CharacterBorderPieceList;
177 : LwpObjectID m_AmikakePieceList;
178 :
179 : LwpObjectID m_ParaBackgroundPieceList;
180 : LwpObjectID m_ExternalBorderStuffPieceList;
181 : LwpObjectID m_ExternalJoinStuffPieceList;
182 :
183 : public:
184 : void Read(LwpObjectStream *pStrm);
185 : };
186 :
187 : class LwpOrderedObject;
188 : class LwpListList;
189 : class LwpOrderedObjectManager
190 : {
191 : public:
192 18 : LwpOrderedObjectManager(){}
193 18 : ~LwpOrderedObjectManager(){}
194 : protected:
195 : LwpObjectID m_Head;
196 : public:
197 : void Read(LwpObjectStream *pStrm);
198 : LwpObjectID& GetHeadID() { return m_Head;}
199 : LwpOrderedObject* Enumerate(LwpOrderedObject* pLast);
200 : protected:
201 : LwpListList* GetNextActiveListList(LwpListList* pLast);
202 : };
203 :
204 : class LwpStyleManager;
205 : class LwpSection;
206 : class LwpBulletStyleMgr;
207 : class LwpFoundry
208 : {
209 : public:
210 : LwpFoundry( LwpObjectStream *pStrm, LwpDocument* pDoc );
211 : ~LwpFoundry();
212 : void Read(LwpObjectStream *pStrm);
213 : void RegisterAllLayouts();
214 : private:
215 : LwpDocument* m_pDoc;
216 : bool m_bRegisteredAll;
217 : private: //file members
218 : LwpVersionManager m_VerMgr;
219 : LwpObjectManager m_ObjMgr;
220 : LwpObjectID m_MarkerHead;
221 : LwpObjectID m_FootnoteMgr;
222 : LwpNumberManager m_NumMgr;
223 : LwpBulletManager m_BulMgr;
224 : LwpOrderedObjectManager m_SectionList;
225 :
226 : LwpObjectID m_Layout; //The head layout
227 : LwpObjectID m_TextStyle;
228 : LwpObjectID m_DefaultTextStyle;
229 : LwpObjectID m_DefaultClickStyle;
230 : LwpObjectID m_PageStyle;
231 : LwpObjectID m_FrameStyle;
232 : LwpObjectID m_TableStyle;
233 : LwpObjectID m_CellStyle;
234 : LwpObjectID m_DftFrameStyle;
235 : LwpObjectID m_DftPageStyle;
236 : LwpObjectID m_DftTableStyle;
237 : LwpObjectID m_DftCellStyle;
238 : LwpObjectID m_DftColumnStyle;
239 : LwpObjectID m_DftLeftColumnStyle;
240 : LwpObjectID m_DftRighColumnStyle;
241 :
242 : LwpObjectID m_BookMarkHead;
243 : LwpObjectID m_DdeLinkHead;
244 : LwpObjectID m_DirtBagHead;
245 : LwpObjectID m_NamedOutlineSeqHead;
246 : LwpObjectID m_EnumLayoutHead;
247 : LwpObjectID m_EnumLayoutTail;
248 :
249 : LwpObjectID m_NamedObjects;
250 : sal_uInt32 m_nLastClickHere;
251 :
252 : LwpObjectID m_SmartTextMgr;
253 :
254 : LwpContentManager m_ContentMgr;
255 : LwpFontManager m_FontMgr;
256 : LwpPieceManager* m_pPieceMgr;
257 :
258 : LwpObjectID m_DftDropCapStyle;
259 : LwpObjectID m_DftHeaderStyle;
260 :
261 : LwpObjectID m_DftFooterStyle;
262 : private:
263 : void ReadStyles(LwpObjectStream *pStrm);
264 : public:
265 16 : inline LwpContentManager& GetContentManager() { return m_ContentMgr; }
266 16 : inline LwpObjectID& GetGraphicListHead() { return m_ContentMgr.GetGraphicListHead(); }
267 516 : inline LwpFontManager& GetFontManger() { return m_FontMgr;}
268 16 : inline LwpObjectID& GetTextStyleHead() { return m_TextStyle;}
269 14 : inline LwpObjectID& GetLayout() {return m_Layout;}
270 16 : inline LwpObjectID& GetBulletManagerID() { return m_BulMgr.GetHeadID();}
271 452 : inline LwpDocument* GetDocument(){ return m_pDoc;}
272 2 : inline LwpNumberManager& GetNumberManager() { return m_NumMgr;}
273 : LwpObjectID * GetDefaultTextStyle() ;
274 : private:
275 : LwpStyleManager* m_pStyleMgr;
276 : LwpDropcapMgr* m_pDropcapMgr;
277 : LwpBulletStyleMgr* m_pBulletStyleMgr;
278 : public:
279 654 : inline LwpStyleManager* GetStyleManager() { return m_pStyleMgr;}
280 : LwpBookMark* GetBookMark(LwpObjectID objMarker);
281 0 : LwpDropcapMgr* GetDropcapMgr(){return m_pDropcapMgr;}
282 : LwpContent* EnumContents(LwpContent* pContent);
283 : LwpSection* EnumSections(LwpSection* pSection);
284 810 : LwpBulletStyleMgr* GetBulletStyleMgr(){return m_pBulletStyleMgr;}
285 :
286 : LwpObjectID* FindParaStyleByName(const OUString& name);
287 : OUString FindActuralStyleName(const OUString& name);
288 : };
289 :
290 : class LwpStyleManager
291 : {
292 : public:
293 : LwpStyleManager();
294 : ~LwpStyleManager();
295 : private:
296 : LwpFoundry* m_pFoundry;
297 : struct hashFunc
298 : {
299 654 : size_t operator()( const LwpObjectID& rName ) const
300 : {
301 654 : return rName.HashCode();
302 : }
303 : };
304 : struct eqFunc
305 : {
306 522 : bool operator()( const LwpObjectID& rKey1, const LwpObjectID& rKey2 ) const
307 : {
308 522 : return(rKey1==rKey2);
309 : }
310 : };
311 :
312 : typedef boost::unordered_map<LwpObjectID, IXFStyle*, hashFunc, eqFunc> LwpStyleMap;
313 : LwpStyleMap m_StyleList;
314 : public:
315 18 : void SetFoundry(LwpFoundry* pFoundry){m_pFoundry = pFoundry;}
316 : IXFStyle* AddStyle(LwpObjectID styleObjID, IXFStyle* pStyle);
317 : IXFStyle* GetStyle(const LwpObjectID &styleObjID);
318 : };
319 : #endif
320 :
321 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|