LibreOffice Module lotuswordpro (master) 1
lwpfoundry.hxx
Go to the documentation of this file.
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#ifndef INCLUDED_LOTUSWORDPRO_INC_LWPFOUNDRY_HXX
62#define INCLUDED_LOTUSWORDPRO_INC_LWPFOUNDRY_HXX
63
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>
72
73class LwpDocument;
74class LwpBookMark;
75
77{
78public:
80 static void Read(LwpObjectStream *pStrm);
81 static void Skip(LwpObjectStream *pStrm);
82};
83
85{
86public:
88private:
90public:
91 void Read(LwpObjectStream *pStrm);
92};
93
95{
96public:
98private:
100public:
101 void Read(LwpObjectStream *pStrm);
102 const LwpObjectID& GetTableRangeID() const { return m_TableRange;}
103};
104
106{
107public:
109private:
111public:
112 void Read(LwpObjectStream *pStrm);
114};
115
116class LwpContent;
118{
119public:
121private:
126
131public:
135
136public:
137 void Read(LwpObjectStream *pStrm);
138};
139
141{
142public:
144private:
165
169
170public:
171 void Read(LwpObjectStream *pStrm);
172};
173
174class LwpOrderedObject;
175class LwpListList;
177{
178public:
180 void Read(LwpObjectStream *pStrm);
182private:
184
186};
187
188class LwpStyleManager;
189class LwpSection;
192{
193public:
194 LwpFoundry( LwpObjectStream *pStrm, LwpDocument* pDoc );
195 ~LwpFoundry();
196 void Read(LwpObjectStream *pStrm);
197 void RegisterAllLayouts();
198private:
201private: //file members
208
209 LwpObjectID m_Layout; //The head layout
224
231
234
236
239 std::unique_ptr<LwpPieceManager> m_xPieceMgr;
240
243
245private:
246 void ReadStyles(LwpObjectStream *pStrm);
247public:
257private:
258 std::unique_ptr<LwpStyleManager> m_xStyleMgr;
260 std::unique_ptr<LwpBulletStyleMgr> m_xBulletStyleMgr;
261public:
268
269 LwpObjectID* FindParaStyleByName(std::u16string_view name);
270 OUString FindActualStyleName(const OUString& name);
271};
272
274{
275public:
278private:
280 struct hashFunc
281 {
282 size_t operator()( const LwpObjectID& rName ) const
283 {
284 return rName.HashCode();
285 }
286 };
287 struct eqFunc
288 {
289 bool operator()( const LwpObjectID& rKey1, const LwpObjectID& rKey2 ) const
290 {
291 return(rKey1==rKey2);
292 }
293 };
294
295 typedef std::unordered_map<LwpObjectID, IXFStyle*, hashFunc, eqFunc> LwpStyleMap;
297public:
298 void SetFoundry(LwpFoundry* pFoundry){m_pFoundry = pFoundry;}
299 void AddStyle(LwpObjectID styleObjID, std::unique_ptr<IXFStyle> pStyle);
300 IXFStyle* GetStyle(const LwpObjectID &styleObjID);
301};
302#endif
303
304/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
@descr Interface for all style object.
Definition: ixfstyle.hxx:71
LwpObjectID m_Head
Definition: lwpfoundry.hxx:110
LwpObjectID & GetHeadID()
Definition: lwpfoundry.hxx:113
void Read(LwpObjectStream *pStrm)
Definition: lwpfoundry.cxx:350
LwpObjectID m_OleHead
Definition: lwpfoundry.hxx:129
LwpObjectID m_ContentList
Definition: lwpfoundry.hxx:122
LwpObjectID m_OleTail
Definition: lwpfoundry.hxx:130
LwpContent * EnumContents(LwpContent *pContent)
@descr: Get next content
Definition: lwpfoundry.cxx:382
LwpObjectID m_OleObjCount
Definition: lwpfoundry.hxx:125
LwpObjectID m_EnumTail
Definition: lwpfoundry.hxx:124
LwpObjectID m_GrapTail
Definition: lwpfoundry.hxx:128
LwpObjectID m_EnumHead
Definition: lwpfoundry.hxx:123
void Read(LwpObjectStream *pStrm)
Definition: lwpfoundry.cxx:356
LwpObjectID & GetGraphicListHead()
Definition: lwpfoundry.hxx:133
LwpObjectID m_GrapHead
Definition: lwpfoundry.hxx:127
LwpObjectID & GetContentList()
Definition: lwpfoundry.hxx:132
Base class of all Lwp content objects.
Definition: lwpcontent.hxx:74
Document object, represent document and division.
Definition: lwpdoc.hxx:76
OUString FindActualStyleName(const OUString &name)
@descr: Get style name registered according the original style name
Definition: lwpfoundry.cxx:288
LwpObjectID m_MarkerHead
Definition: lwpfoundry.hxx:203
LwpObjectID m_FrameStyle
Definition: lwpfoundry.hxx:214
LwpFoundry(LwpObjectStream *pStrm, LwpDocument *pDoc)
Definition: lwpfoundry.cxx:77
LwpObjectID m_EnumLayoutHead
Definition: lwpfoundry.hxx:229
LwpObjectID & GetTextStyleHead()
Definition: lwpfoundry.hxx:251
LwpObjectID m_DftCellStyle
Definition: lwpfoundry.hxx:220
LwpObjectID m_DftFrameStyle
Definition: lwpfoundry.hxx:217
LwpObjectID m_DftFooterStyle
Definition: lwpfoundry.hxx:244
LwpContent * EnumContents(LwpContent *pContent)
@descr: Get next content
Definition: lwpfoundry.cxx:235
LwpObjectID m_EnumLayoutTail
Definition: lwpfoundry.hxx:230
LwpNumberManager & GetNumberManager()
Definition: lwpfoundry.hxx:255
LwpObjectID * GetDefaultTextStyle()
@descr: Get default text style id
Definition: lwpfoundry.cxx:253
sal_uInt32 m_nLastClickHere
Definition: lwpfoundry.hxx:233
std::unique_ptr< LwpBulletStyleMgr > m_xBulletStyleMgr
Definition: lwpfoundry.hxx:260
LwpObjectID m_DftLeftColumnStyle
Definition: lwpfoundry.hxx:222
LwpDocument * m_pDoc
Definition: lwpfoundry.hxx:199
LwpObjectID m_DftTableStyle
Definition: lwpfoundry.hxx:219
LwpBookMark * GetBookMark(LwpObjectID objMarker)
Definition: lwpfoundry.cxx:210
LwpObjectID m_TableStyle
Definition: lwpfoundry.hxx:215
LwpObjectID m_Layout
Definition: lwpfoundry.hxx:209
LwpDropcapMgr & GetDropcapMgr()
Definition: lwpfoundry.hxx:264
LwpObjectID m_DftColumnStyle
Definition: lwpfoundry.hxx:221
LwpObjectID m_DefaultTextStyle
Definition: lwpfoundry.hxx:211
LwpObjectID m_NamedObjects
Definition: lwpfoundry.hxx:232
LwpObjectID m_DftHeaderStyle
Definition: lwpfoundry.hxx:242
LwpObjectID m_DdeLinkHead
Definition: lwpfoundry.hxx:226
LwpObjectID m_FootnoteMgr
Definition: lwpfoundry.hxx:204
LwpContentManager & GetContentManager()
Definition: lwpfoundry.hxx:248
LwpOrderedObjectManager m_SectionList
Definition: lwpfoundry.hxx:207
LwpObjectID & GetBulletManagerID()
Definition: lwpfoundry.hxx:253
LwpBulletStyleMgr * GetBulletStyleMgr()
Definition: lwpfoundry.hxx:267
LwpObjectID m_TextStyle
Definition: lwpfoundry.hxx:210
void ReadStyles(LwpObjectStream *pStrm)
Definition: lwpfoundry.cxx:145
bool m_bRegisteredAll
Definition: lwpfoundry.hxx:200
LwpContentManager m_ContentMgr
Definition: lwpfoundry.hxx:237
LwpObjectID m_DftDropCapStyle
Definition: lwpfoundry.hxx:241
LwpObjectID m_DefaultClickStyle
Definition: lwpfoundry.hxx:212
LwpObjectID m_DftRighColumnStyle
Definition: lwpfoundry.hxx:223
LwpObjectID m_NamedOutlineSeqHead
Definition: lwpfoundry.hxx:228
LwpFontManager & GetFontManager()
Definition: lwpfoundry.hxx:250
LwpObjectID m_CellStyle
Definition: lwpfoundry.hxx:216
LwpSection * EnumSections(LwpSection *pSection)
@descr: Get next section
Definition: lwpfoundry.cxx:244
LwpFontManager m_FontMgr
Definition: lwpfoundry.hxx:238
LwpObjectID m_BookMarkHead
Definition: lwpfoundry.hxx:225
void Read(LwpObjectStream *pStrm)
Definition: lwpfoundry.cxx:90
LwpObjectID m_DftPageStyle
Definition: lwpfoundry.hxx:218
LwpObjectID m_PageStyle
Definition: lwpfoundry.hxx:213
LwpObjectID & GetGraphicListHead()
Definition: lwpfoundry.hxx:249
LwpObjectID & GetLayout()
Definition: lwpfoundry.hxx:252
LwpObjectManager m_ObjMgr
Definition: lwpfoundry.hxx:202
void RegisterAllLayouts()
Definition: lwpfoundry.cxx:166
std::unique_ptr< LwpStyleManager > m_xStyleMgr
Definition: lwpfoundry.hxx:258
LwpDropcapMgr m_aDropcapMgr
Definition: lwpfoundry.hxx:259
LwpObjectID m_DirtBagHead
Definition: lwpfoundry.hxx:227
LwpObjectID m_SmartTextMgr
Definition: lwpfoundry.hxx:235
LwpStyleManager * GetStyleManager()
Definition: lwpfoundry.hxx:262
LwpObjectID * FindParaStyleByName(std::u16string_view name)
@descr: Get paragraph style object id according to its style name
Definition: lwpfoundry.cxx:266
LwpBulletManager m_BulMgr
Definition: lwpfoundry.hxx:206
LwpNumberManager m_NumMgr
Definition: lwpfoundry.hxx:205
std::unique_ptr< LwpPieceManager > m_xPieceMgr
Definition: lwpfoundry.hxx:239
LwpDocument * GetDocument()
Definition: lwpfoundry.hxx:254
VO_LISTLIST object in .lwp file.
Definition: lwpholder.hxx:122
LwpObjectID m_TableRange
Definition: lwpfoundry.hxx:99
const LwpObjectID & GetTableRangeID() const
Definition: lwpfoundry.hxx:102
void Read(LwpObjectStream *pStrm)
Definition: lwpfoundry.cxx:344
object id class
Definition: lwpobjid.hxx:79
size_t HashCode() const
Definition: lwpobjid.hxx:135
LwpObjectID m_Division
Definition: lwpfoundry.hxx:89
void Read(LwpObjectStream *pStrm)
Definition: lwpfoundry.cxx:333
stream class for LwpObject body data provide stream like interface to read object data
Definition: lwpobjstrm.hxx:77
LwpListList * GetNextActiveListList(LwpListList *pLast)
@descr: Get next listlist object, copy from lwp source code
Definition: lwpfoundry.cxx:466
void Read(LwpObjectStream *pStrm)
Definition: lwpfoundry.cxx:425
LwpOrderedObject * Enumerate(LwpOrderedObject *pLast)
@descr: Get next orderedobject, copy from lwp source code
Definition: lwpfoundry.cxx:434
LwpObjectID m_IndentPieceList
Definition: lwpfoundry.hxx:157
LwpObjectID m_ExternalBorderStuffPieceList
Definition: lwpfoundry.hxx:167
LwpObjectID m_NumericsPieceList
Definition: lwpfoundry.hxx:154
LwpObjectID m_MarginsPieceList
Definition: lwpfoundry.hxx:147
LwpObjectID m_ShadowPieceList
Definition: lwpfoundry.hxx:153
LwpObjectID m_GutterStuffPieceList
Definition: lwpfoundry.hxx:150
LwpObjectID m_ParaBackgroundPieceList
Definition: lwpfoundry.hxx:166
LwpObjectID m_AlignmentPieceList
Definition: lwpfoundry.hxx:156
LwpObjectID m_ScalePieceList
Definition: lwpfoundry.hxx:146
LwpObjectID m_BackgroundStuffPieceList
Definition: lwpfoundry.hxx:151
LwpObjectID m_NumberingPieceList
Definition: lwpfoundry.hxx:161
LwpObjectID m_BreaksPieceList
Definition: lwpfoundry.hxx:160
LwpObjectID m_AmikakePieceList
Definition: lwpfoundry.hxx:164
LwpObjectID m_SpacingPieceList
Definition: lwpfoundry.hxx:159
LwpObjectID m_TabPieceList
Definition: lwpfoundry.hxx:162
LwpObjectID m_ColumnsPieceList
Definition: lwpfoundry.hxx:148
LwpObjectID m_BorderStuffPieceList
Definition: lwpfoundry.hxx:149
LwpObjectID m_CharacterBorderPieceList
Definition: lwpfoundry.hxx:163
LwpObjectID m_ParaBorderPieceList
Definition: lwpfoundry.hxx:158
LwpObjectID m_JoinStuffPieceList
Definition: lwpfoundry.hxx:152
LwpObjectID m_RelativityPieceList
Definition: lwpfoundry.hxx:155
void Read(LwpObjectStream *pStrm)
Definition: lwpfoundry.cxx:390
LwpObjectID m_GeometryPieceList
Definition: lwpfoundry.hxx:145
LwpObjectID m_ExternalJoinStuffPieceList
Definition: lwpfoundry.hxx:168
IXFStyle * GetStyle(const LwpObjectID &styleObjID)
Definition: lwpfoundry.cxx:522
void AddStyle(LwpObjectID styleObjID, std::unique_ptr< IXFStyle > pStyle)
Definition: lwpfoundry.cxx:507
LwpStyleMap m_StyleList
Definition: lwpfoundry.hxx:296
std::unordered_map< LwpObjectID, IXFStyle *, hashFunc, eqFunc > LwpStyleMap
Definition: lwpfoundry.hxx:295
void SetFoundry(LwpFoundry *pFoundry)
Definition: lwpfoundry.hxx:298
LwpFoundry * m_pFoundry
Definition: lwpfoundry.hxx:279
static void Read(LwpObjectStream *pStrm)
Definition: lwpfoundry.cxx:303
LwpVersionManager()=delete
static void Skip(LwpObjectStream *pStrm)
Definition: lwpfoundry.cxx:309
bool operator()(const LwpObjectID &rKey1, const LwpObjectID &rKey2) const
Definition: lwpfoundry.hxx:289
size_t operator()(const LwpObjectID &rName) const
Definition: lwpfoundry.hxx:282