Bump version to 24.04.3.4
[LibreOffice.git] / lotuswordpro / inc / lwpfoundry.hxx
blobdf2a71a19c90d6cf5c743c64075d61e977eb1d36
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*************************************************************************
4 * The Contents of this file are made available subject to the terms of
5 * either of the following licenses
7 * - GNU Lesser General Public License Version 2.1
8 * - Sun Industry Standards Source License Version 1.1
10 * Sun Microsystems Inc., October, 2000
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
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.
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.
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
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.
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.
46 * The Initial Developer of the Original Code is: IBM Corporation
48 * Copyright: 2008 by IBM Corporation
50 * All Rights Reserved.
52 * Contributor(s): _______________________________________
55 ************************************************************************/
56 /*************************************************************************
57 * @file
58 * For LWP filter architecture prototype
59 ************************************************************************/
61 #ifndef INCLUDED_LOTUSWORDPRO_INC_LWPFOUNDRY_HXX
62 #define INCLUDED_LOTUSWORDPRO_INC_LWPFOUNDRY_HXX
64 #include <config_lgpl.h>
65 #include "lwpobjid.hxx"
66 #include "lwpobjstrm.hxx"
67 #include "lwpfont.hxx"
68 #include "lwpdropcapmgr.hxx"
69 #include "xfilter/ixfstyle.hxx"
70 #include <unordered_map>
71 #include <memory>
73 class LwpDocument;
74 class LwpBookMark;
76 class LwpVersionManager
78 public:
79 LwpVersionManager() = delete;
80 static void Read(LwpObjectStream *pStrm);
81 static void Skip(LwpObjectStream *pStrm);
84 class LwpObjectManager
86 public:
87 LwpObjectManager(){}
88 private:
89 LwpObjectID m_Division;
90 public:
91 void Read(LwpObjectStream *pStrm);
94 class LwpNumberManager
96 public:
97 LwpNumberManager(){}
98 private:
99 LwpObjectID m_TableRange;
100 public:
101 void Read(LwpObjectStream *pStrm);
102 const LwpObjectID& GetTableRangeID() const { return m_TableRange;}
105 class LwpBulletManager
107 public:
108 LwpBulletManager(){}
109 private:
110 LwpObjectID m_Head;
111 public:
112 void Read(LwpObjectStream *pStrm);
113 LwpObjectID& GetHeadID() { return m_Head;}
116 class LwpContent;
117 class LwpContentManager
119 public:
120 LwpContentManager(){}
121 private:
122 LwpObjectID m_ContentList;
123 LwpObjectID m_EnumHead;
124 LwpObjectID m_EnumTail;
125 LwpObjectID m_OleObjCount;
127 LwpObjectID m_GrapHead;
128 LwpObjectID m_GrapTail;
129 LwpObjectID m_OleHead;
130 LwpObjectID m_OleTail;
131 public:
132 LwpObjectID& GetContentList() { return m_ContentList; }
133 LwpObjectID& GetGraphicListHead() { return m_GrapHead; }
134 LwpContent* EnumContents(LwpContent* pContent);
136 public:
137 void Read(LwpObjectStream *pStrm);
140 class LwpPieceManager
142 public:
143 LwpPieceManager(){}
144 private:
145 LwpObjectID m_GeometryPieceList;
146 LwpObjectID m_ScalePieceList;
147 LwpObjectID m_MarginsPieceList;
148 LwpObjectID m_ColumnsPieceList;
149 LwpObjectID m_BorderStuffPieceList;
150 LwpObjectID m_GutterStuffPieceList;
151 LwpObjectID m_BackgroundStuffPieceList;
152 LwpObjectID m_JoinStuffPieceList;
153 LwpObjectID m_ShadowPieceList;
154 LwpObjectID m_NumericsPieceList;
155 LwpObjectID m_RelativityPieceList;
156 LwpObjectID m_AlignmentPieceList;
157 LwpObjectID m_IndentPieceList;
158 LwpObjectID m_ParaBorderPieceList;
159 LwpObjectID m_SpacingPieceList;
160 LwpObjectID m_BreaksPieceList;
161 LwpObjectID m_NumberingPieceList;
162 LwpObjectID m_TabPieceList;
163 LwpObjectID m_CharacterBorderPieceList;
164 LwpObjectID m_AmikakePieceList;
166 LwpObjectID m_ParaBackgroundPieceList;
167 LwpObjectID m_ExternalBorderStuffPieceList;
168 LwpObjectID m_ExternalJoinStuffPieceList;
170 public:
171 void Read(LwpObjectStream *pStrm);
174 class LwpOrderedObject;
175 class LwpListList;
176 class LwpOrderedObjectManager final
178 public:
179 LwpOrderedObjectManager(){}
180 void Read(LwpObjectStream *pStrm);
181 LwpOrderedObject* Enumerate(LwpOrderedObject* pLast);
182 private:
183 LwpListList* GetNextActiveListList(LwpListList* pLast);
185 LwpObjectID m_Head;
188 class LwpStyleManager;
189 class LwpSection;
190 class LwpBulletStyleMgr;
191 class LwpFoundry
193 public:
194 LwpFoundry( LwpObjectStream *pStrm, LwpDocument* pDoc );
195 ~LwpFoundry();
196 void Read(LwpObjectStream *pStrm);
197 void RegisterAllLayouts();
198 private:
199 LwpDocument* m_pDoc;
200 bool m_bRegisteredAll;
201 private: //file members
202 LwpObjectManager m_ObjMgr;
203 LwpObjectID m_MarkerHead;
204 LwpObjectID m_FootnoteMgr;
205 LwpNumberManager m_NumMgr;
206 LwpBulletManager m_BulMgr;
207 LwpOrderedObjectManager m_SectionList;
209 LwpObjectID m_Layout; //The head layout
210 LwpObjectID m_TextStyle;
211 LwpObjectID m_DefaultTextStyle;
212 LwpObjectID m_DefaultClickStyle;
213 LwpObjectID m_PageStyle;
214 LwpObjectID m_FrameStyle;
215 LwpObjectID m_TableStyle;
216 LwpObjectID m_CellStyle;
217 LwpObjectID m_DftFrameStyle;
218 LwpObjectID m_DftPageStyle;
219 LwpObjectID m_DftTableStyle;
220 LwpObjectID m_DftCellStyle;
221 LwpObjectID m_DftColumnStyle;
222 LwpObjectID m_DftLeftColumnStyle;
223 LwpObjectID m_DftRighColumnStyle;
225 LwpObjectID m_BookMarkHead;
226 LwpObjectID m_DdeLinkHead;
227 LwpObjectID m_DirtBagHead;
228 LwpObjectID m_NamedOutlineSeqHead;
229 LwpObjectID m_EnumLayoutHead;
230 LwpObjectID m_EnumLayoutTail;
232 LwpObjectID m_NamedObjects;
233 sal_uInt32 m_nLastClickHere;
235 LwpObjectID m_SmartTextMgr;
237 LwpContentManager m_ContentMgr;
238 LwpFontManager m_FontMgr;
239 std::unique_ptr<LwpPieceManager> m_xPieceMgr;
241 LwpObjectID m_DftDropCapStyle;
242 LwpObjectID m_DftHeaderStyle;
244 LwpObjectID m_DftFooterStyle;
245 private:
246 void ReadStyles(LwpObjectStream *pStrm);
247 public:
248 LwpContentManager& GetContentManager() { return m_ContentMgr; }
249 LwpObjectID& GetGraphicListHead() { return m_ContentMgr.GetGraphicListHead(); }
250 LwpFontManager& GetFontManager() { return m_FontMgr;}
251 LwpObjectID& GetTextStyleHead() { return m_TextStyle;}
252 LwpObjectID& GetLayout() {return m_Layout;}
253 LwpObjectID& GetBulletManagerID() { return m_BulMgr.GetHeadID();}
254 LwpDocument* GetDocument(){ return m_pDoc;}
255 LwpNumberManager& GetNumberManager() { return m_NumMgr;}
256 LwpObjectID * GetDefaultTextStyle() ;
257 private:
258 std::unique_ptr<LwpStyleManager> m_xStyleMgr;
259 LwpDropcapMgr m_aDropcapMgr;
260 std::unique_ptr<LwpBulletStyleMgr> m_xBulletStyleMgr;
261 public:
262 LwpStyleManager* GetStyleManager() { return m_xStyleMgr.get(); }
263 LwpBookMark* GetBookMark(LwpObjectID objMarker);
264 LwpDropcapMgr& GetDropcapMgr() { return m_aDropcapMgr; }
265 LwpContent* EnumContents(LwpContent* pContent);
266 LwpSection* EnumSections(LwpSection* pSection);
267 LwpBulletStyleMgr* GetBulletStyleMgr() { return m_xBulletStyleMgr.get(); }
269 LwpObjectID* FindParaStyleByName(std::u16string_view name);
270 OUString FindActualStyleName(const OUString& name);
273 class LwpStyleManager
275 public:
276 LwpStyleManager();
277 ~LwpStyleManager();
278 private:
279 LwpFoundry* m_pFoundry;
280 struct hashFunc
282 size_t operator()( const LwpObjectID& rName ) const
284 return rName.HashCode();
287 struct eqFunc
289 bool operator()( const LwpObjectID& rKey1, const LwpObjectID& rKey2 ) const
291 return(rKey1==rKey2);
295 typedef std::unordered_map<LwpObjectID, IXFStyle*, hashFunc, eqFunc> LwpStyleMap;
296 LwpStyleMap m_StyleList;
297 public:
298 void SetFoundry(LwpFoundry* pFoundry){m_pFoundry = pFoundry;}
299 void AddStyle(LwpObjectID styleObjID, std::unique_ptr<IXFStyle> pStyle);
300 IXFStyle* GetStyle(const LwpObjectID &styleObjID);
302 #endif
304 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */