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 _LWPFOUNDRY_HXX
66 : #define _LWPFOUNDRY_HXX
67 :
68 : #include "lwpheader.hxx"
69 :
70 : #ifndef _LWPOBJECTID_HXX
71 : #include "lwpobjid.hxx"
72 : #endif
73 :
74 : #ifndef _LWPOBJECTSTREAM_HXX
75 : #include "lwpobjstrm.hxx"
76 : #endif
77 :
78 : #include "lwpcolor.hxx"
79 : #include "lwpbasetype.hxx"
80 : #include "lwpfont.hxx"
81 : #include "lwpdropcapmgr.hxx"
82 : class LwpDocument;
83 : class LwpBookMark;
84 :
85 : #include <vector>
86 : #define TAG_USER_VERSION 0x72655655UL // "UVer"
87 :
88 :
89 : class LwpVersionManager
90 : {
91 : public:
92 9 : LwpVersionManager(){}
93 8 : ~LwpVersionManager(){}
94 : public:
95 : void Read(LwpObjectStream *pStrm);
96 : void Skip(LwpObjectStream *pStrm);
97 : };
98 :
99 : class LwpObjectManager
100 : {
101 : public:
102 9 : LwpObjectManager(){}
103 8 : ~LwpObjectManager(){}
104 : private:
105 : LwpObjectID m_Division;
106 : public:
107 : void Read(LwpObjectStream *pStrm);
108 : };
109 :
110 : class LwpNumberManager
111 : {
112 : public:
113 9 : LwpNumberManager(){}
114 8 : ~LwpNumberManager(){}
115 : private:
116 : LwpObjectID m_TableRange;
117 : public:
118 : void Read(LwpObjectStream *pStrm);
119 1 : LwpObjectID GetTableRangeID(){ return m_TableRange;}
120 : };
121 :
122 : class LwpBulletManager
123 : {
124 : public:
125 9 : LwpBulletManager(){}
126 8 : ~LwpBulletManager(){}
127 : private:
128 : LwpObjectID m_Head;
129 : public:
130 : void Read(LwpObjectStream *pStrm);
131 8 : LwpObjectID* GetHeadID() { return &m_Head;}
132 : };
133 :
134 : class LwpContent;
135 : class LwpContentManager
136 : {
137 : public:
138 9 : LwpContentManager(){}
139 8 : ~LwpContentManager(){}
140 : private:
141 : LwpObjectID m_ContentList;
142 : LwpObjectID m_EnumHead;
143 : LwpObjectID m_EnumTail;
144 : LwpObjectID m_OleObjCount;
145 :
146 : LwpObjectID m_GrapHead;
147 : LwpObjectID m_GrapTail;
148 : LwpObjectID m_OleHead;
149 : LwpObjectID m_OleTail;
150 : public:
151 8 : inline LwpObjectID* GetContentList() { return &m_ContentList; }
152 8 : inline LwpObjectID* GetGraphicListHead() { return &m_GrapHead; }
153 : LwpContent* EnumContents(LwpContent* pContent);
154 :
155 : public:
156 : void Read(LwpObjectStream *pStrm);
157 : };
158 :
159 : class LwpPieceManager
160 : {
161 : public:
162 5 : LwpPieceManager(){}
163 4 : ~LwpPieceManager(){}
164 : private:
165 : LwpObjectID m_GeometryPieceList;
166 : LwpObjectID m_ScalePieceList;
167 : LwpObjectID m_MarginsPieceList;
168 : LwpObjectID m_ColumnsPieceList;
169 : LwpObjectID m_BorderStuffPieceList;
170 : LwpObjectID m_GutterStuffPieceList;
171 : LwpObjectID m_BackgroundStuffPieceList;
172 : LwpObjectID m_JoinStuffPieceList;
173 : LwpObjectID m_ShadowPieceList;
174 : LwpObjectID m_NumericsPieceList;
175 : LwpObjectID m_RelativityPieceList;
176 : LwpObjectID m_AlignmentPieceList;
177 : LwpObjectID m_IndentPieceList;
178 : LwpObjectID m_ParaBorderPieceList;
179 : LwpObjectID m_SpacingPieceList;
180 : LwpObjectID m_BreaksPieceList;
181 : LwpObjectID m_NumberingPieceList;
182 : LwpObjectID m_TabPieceList;
183 : LwpObjectID m_CharacterBorderPieceList;
184 : LwpObjectID m_AmikakePieceList;
185 :
186 : LwpObjectID m_ParaBackgroundPieceList;
187 : LwpObjectID m_ExternalBorderStuffPieceList;
188 : LwpObjectID m_ExternalJoinStuffPieceList;
189 :
190 : public:
191 : void Read(LwpObjectStream *pStrm);
192 : };
193 :
194 : class LwpOrderedObject;
195 : class LwpListList;
196 : class LwpOrderedObjectManager
197 : {
198 : public:
199 9 : LwpOrderedObjectManager(){}
200 8 : ~LwpOrderedObjectManager(){}
201 : protected:
202 : LwpObjectID m_Head;
203 : public:
204 : void Read(LwpObjectStream *pStrm);
205 : LwpObjectID* GetHeadID() { return &m_Head;}
206 : LwpOrderedObject* Enumerate(LwpOrderedObject* pLast);
207 : protected:
208 : LwpListList* GetNextActiveListList(LwpListList* pLast);
209 : };
210 :
211 : class LwpStyleManager;
212 : class LwpSection;
213 : class LwpBulletStyleMgr;
214 : class LwpFoundry
215 : {
216 : public:
217 : LwpFoundry( LwpObjectStream *pStrm, LwpDocument* pDoc );
218 : ~LwpFoundry();
219 : void Read(LwpObjectStream *pStrm);
220 : void RegisterAllLayouts();
221 : private:
222 : LwpDocument* m_pDoc;
223 : bool m_bRegisteredAll;
224 : private: //file members
225 : LwpVersionManager m_VerMgr;
226 : LwpObjectManager m_ObjMgr;
227 : LwpObjectID m_MarkerHead;
228 : LwpObjectID m_FootnoteMgr;
229 : LwpNumberManager m_NumMgr;
230 : LwpBulletManager m_BulMgr;
231 : LwpOrderedObjectManager m_SectionList;
232 :
233 : LwpObjectID m_Layout; //The head layout
234 : LwpObjectID m_TextStyle;
235 : LwpObjectID m_DefaultTextStyle;
236 : LwpObjectID m_DefaultClickStyle;
237 : LwpObjectID m_PageStyle;
238 : LwpObjectID m_FrameStyle;
239 : LwpObjectID m_TableStyle;
240 : LwpObjectID m_CellStyle;
241 : LwpObjectID m_DftFrameStyle;
242 : LwpObjectID m_DftPageStyle;
243 : LwpObjectID m_DftTableStyle;
244 : LwpObjectID m_DftCellStyle;
245 : LwpObjectID m_DftColumnStyle;
246 : LwpObjectID m_DftLeftColumnStyle;
247 : LwpObjectID m_DftRighColumnStyle;
248 :
249 : LwpObjectID m_BookMarkHead;
250 : LwpObjectID m_DdeLinkHead;
251 : LwpObjectID m_DirtBagHead;
252 : LwpObjectID m_NamedOutlineSeqHead;
253 : LwpObjectID m_EnumLayoutHead;
254 : LwpObjectID m_EnumLayoutTail;
255 :
256 : LwpObjectID m_NamedObjects;
257 : sal_uInt32 m_nLastClickHere;
258 :
259 : LwpObjectID m_SmartTextMgr;
260 :
261 : LwpContentManager m_ContentMgr;
262 : LwpFontManager m_FontMgr;
263 : LwpPieceManager* m_pPieceMgr;
264 :
265 : LwpObjectID m_DftDropCapStyle;
266 : LwpObjectID m_DftHeaderStyle;
267 :
268 : LwpObjectID m_DftFooterStyle;
269 : private:
270 : void ReadStyles(LwpObjectStream *pStrm);
271 : public:
272 8 : inline LwpContentManager* GetContentManager() { return &m_ContentMgr; }
273 8 : inline LwpObjectID* GetGraphicListHead() { return m_ContentMgr.GetGraphicListHead(); }
274 258 : inline LwpFontManager* GetFontManger() { return &m_FontMgr;}
275 8 : inline LwpObjectID* GetTextStyleHead() { return &m_TextStyle;}
276 7 : inline LwpObjectID* GetLayout() {return &m_Layout;}
277 8 : inline LwpObjectID* GetBulletManagerID() { return m_BulMgr.GetHeadID();}
278 238 : inline LwpDocument* GetDocument(){ return m_pDoc;}
279 1 : inline LwpNumberManager* GetNumberManager() { return &m_NumMgr;}
280 : LwpObjectID * GetDefaultTextStyle() ;
281 : private:
282 : LwpStyleManager* m_pStyleMgr;
283 : LwpDropcapMgr* m_pDropcapMgr;
284 : LwpBulletStyleMgr* m_pBulletStyleMgr;
285 : public:
286 330 : inline LwpStyleManager* GetStyleManager() { return m_pStyleMgr;}
287 : LwpBookMark* GetBookMark(LwpObjectID objMarker);
288 0 : LwpDropcapMgr* GetDropcapMgr(){return m_pDropcapMgr;}
289 : LwpContent* EnumContents(LwpContent* pContent);
290 : LwpSection* EnumSections(LwpSection* pSection);
291 411 : LwpBulletStyleMgr* GetBulletStyleMgr(){return m_pBulletStyleMgr;}
292 :
293 : LwpObjectID* FindParaStyleByName(OUString name);
294 : OUString FindActuralStyleName(OUString name);
295 : };
296 :
297 : class LwpStyleManager
298 : {
299 : public:
300 : LwpStyleManager();
301 : ~LwpStyleManager();
302 : private:
303 : LwpFoundry* m_pFoundry;
304 : struct hashFunc
305 : {
306 330 : size_t operator()( const LwpObjectID& rName ) const
307 : {
308 330 : return rName.HashCode();
309 : }
310 : };
311 : struct eqFunc
312 : {
313 264 : bool operator()( const LwpObjectID& rKey1, const LwpObjectID& rKey2 ) const
314 : {
315 264 : return(rKey1==rKey2);
316 : }
317 : };
318 :
319 : typedef boost::unordered_map<LwpObjectID, IXFStyle*, hashFunc, eqFunc> LwpStyleMap;
320 : LwpStyleMap m_StyleList;
321 : public:
322 9 : void SetFoundry(LwpFoundry* pFoundry){m_pFoundry = pFoundry;}
323 : IXFStyle* AddStyle(LwpObjectID styleObjID, IXFStyle* pStyle);
324 : IXFStyle* GetStyle(const LwpObjectID &styleObjID);
325 : };
326 : #endif
327 :
328 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|