LibreOffice Module lotuswordpro (master) 1
lwpdoc.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 * LwpDocument header file
59 ************************************************************************/
60
61#ifndef INCLUDED_LOTUSWORDPRO_SOURCE_FILTER_LWPDOC_HXX
62#define INCLUDED_LOTUSWORDPRO_SOURCE_FILTER_LWPDOC_HXX
63
64#include <config_lgpl.h>
65#include "lwplnopts.hxx"
66#include "lwpdlvlist.hxx"
67#include <lwpfoundry.hxx>
68#include <optional>
69
70class IXFStream;
76{
77public:
78 LwpDocument(LwpObjectHeader const& objHdr, LwpSvStream* pStrm);
79 virtual ~LwpDocument() override;
80
81private:
82 std::unique_ptr<LwpFoundry> m_xOwnedFoundry;
86
87 //Data members in file format
89 sal_uInt16 m_nFlags;
91 enum
92 {
93 DOC_PROTECTED = 0x00000004UL,
94 DOC_CHILDDOC = 0x00000800UL
95 };
96
97 std::optional<LwpLineNumberOptions> m_oLnOpts;
98
104
108
109protected:
110 void Read() override;
111 void ReadPlug();
112 void ParseDocContent(IXFStream* pOutputStream);
113 void RegisterTextStyles();
115
122
123public:
124 void Parse(IXFStream* pOutputStream) override;
125 void RegisterStyle() override;
126
127 inline bool IsChildDoc() const;
128 inline bool GetHonorProtection() const;
129 inline LwpObjectID& GetDocData();
130 inline LwpObjectID& GetSocket();
131
132 inline LwpFoundry* GetFoundry();
133 inline LwpObjectID& GetDivInfoID();
134 inline LwpObjectID& GetPageHintsID();
136 inline LwpObjectID& GetVerDoc();
138
139 sal_uInt16 GetEndnoteType();
144
151 {
153 throw std::runtime_error("recursion in page divisions");
157 return pRet;
158 }
160
164 bool GetNumberOfPages(LwpDocument* pEndDivision, sal_uInt16& nCount);
165
166 sal_uInt16 GetNumberOfPagesBefore();
167 void ParseFrameInPage(IXFStream* pOutputStream);
168
169private:
172 static void ChangeStyleName();
173 bool IsSkippedDivision();
174};
175
176inline bool LwpDocument::IsChildDoc() const { return (m_nPersistentFlags & DOC_CHILDDOC) != 0; }
178{
179 return (m_nPersistentFlags & DOC_PROTECTED) != 0;
180}
188
193{
194public:
195 LwpDocSock(LwpObjectHeader const& objHdr, LwpSvStream* pStrm);
196
197private:
199
200protected:
201 void Read() override;
202
203public:
204 void RegisterStyle() override;
205 void Parse(IXFStream* pOutputStream) override;
206};
207
208#endif
209
210/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Stream wrapper for sax writer.
Definition: ixfstream.hxx:72
AtomHolder class of Word Pro to hold a string.
Double Linked Named Family Properties Virtual List.
Definition: lwpdlvlist.hxx:119
Double Linked Named Family Virtual List.
Definition: lwpdlvlist.hxx:91
DocumentSock object, divisions are embedded by document socket object.
Definition: lwpdoc.hxx:193
void Read() override
@descr read VO_DOCSOCK from file
Definition: lwpdoc.cxx:802
LwpDocSock(LwpObjectHeader const &objHdr, LwpSvStream *pStrm)
Definition: lwpdoc.cxx:794
void Parse(IXFStream *pOutputStream) override
@descr parse contents of documents plugged
Definition: lwpdoc.cxx:824
void RegisterStyle() override
@descr register styles in documents plugged
Definition: lwpdoc.cxx:811
LwpObjectID m_Doc
Definition: lwpdoc.hxx:198
Document object, represent document and division.
Definition: lwpdoc.hxx:76
void ParseDocContent(IXFStream *pOutputStream)
@descr Parse content in this division to IXFStream LwpDocument->LwpDivInfo->LwpPageLayout....
Definition: lwpdoc.cxx:423
LwpDocument * GetLastDivision()
@descr Get last division
Definition: lwpdoc.cxx:615
LwpObjectID & GetDivInfoID()
Definition: lwpdoc.hxx:183
void RegisterLayoutStyles()
@descr Register all layouts styles (page master and master page) All para styles used in master page ...
Definition: lwpdoc.cxx:256
bool m_bGettingGetLastDivisionWithContents
Definition: lwpdoc.hxx:85
bool GetHonorProtection() const
Definition: lwpdoc.hxx:177
LwpObjectID m_FootnoteOpts
Definition: lwpdoc.hxx:100
virtual ~LwpDocument() override
Definition: lwpdoc.cxx:86
sal_uInt16 GetEndnoteType()
@descr Get the endnote type
Definition: lwpdoc.cxx:456
std::optional< LwpLineNumberOptions > m_oLnOpts
Definition: lwpdoc.hxx:97
LwpDocument * GetNextDivision()
@descr Get next division
Definition: lwpdoc.cxx:485
LwpDocument * GetFirstDivisionWithContentsThatIsNotOLE()
Definition: lwpdoc.hxx:150
LwpObjectID m_VerDoc
Definition: lwpdoc.hxx:106
void ParseFrameInPage(IXFStream *pOutputStream)
@descr Parse the frame which anchor is to page before parse other contents, This method is called whe...
Definition: lwpdoc.cxx:747
LwpObjectID & GetDocData()
Definition: lwpdoc.hxx:186
bool m_bGettingPreviousDivisionWithContents
Definition: lwpdoc.hxx:84
@ DOC_PROTECTED
Definition: lwpdoc.hxx:93
@ DOC_CHILDDOC
Definition: lwpdoc.hxx:94
LwpObjectID * GetValidFootnoteOpts()
@descr Get the footnoteoptions from the root document
Definition: lwpdoc.cxx:443
LwpFoundry * GetFoundry()
Definition: lwpdoc.hxx:182
LwpDocument * GetLastInGroupWithContents()
@descr Get last division in group which has contents, copy from lwp source code
Definition: lwpdoc.cxx:596
LwpDocument * GetPreviousDivisionWithContents()
@descr Get previous division which has contents, copy from lwp source code
Definition: lwpdoc.cxx:540
LwpObjectID & GetVerDoc()
Definition: lwpdoc.hxx:187
void RegisterBulletStyles()
@descr Register all bullet styles used in this division
Definition: lwpdoc.cxx:313
LwpDocument * GetParentDivision()
@descr Get parent division
Definition: lwpdoc.cxx:497
void RegisterStyle() override
@descr Register all styles in this division
Definition: lwpdoc.cxx:207
sal_uInt16 GetNumberOfPagesBefore()
@descr Get the numbers of page before current division
Definition: lwpdoc.cxx:734
LwpDocument * GetLastDivisionWithContents()
@descr Get last division which has contents, copy from lwp source code
Definition: lwpdoc.cxx:559
LwpObjectID & GetFootnoteOpts()
Definition: lwpdoc.hxx:185
LwpObjectID m_DivOpts
Definition: lwpdoc.hxx:99
LwpObjectID & GetPageHintsID()
Definition: lwpdoc.hxx:184
LwpObjectID m_DocSockID
Definition: lwpdoc.hxx:88
void ReadPlug()
@descr Read plug related data from m_pObjStram
Definition: lwpdoc.cxx:142
void Parse(IXFStream *pOutputStream) override
@descr Parse obj to IXFStream
Definition: lwpdoc.cxx:152
LwpObjectID m_WYSIWYGPageHints
Definition: lwpdoc.hxx:105
bool GetNumberOfPages(LwpDocument *pEndDivision, sal_uInt16 &nCount)
@descr Get the numbers of page before pEndDivision, copy from lwp source code
Definition: lwpdoc.cxx:711
sal_uInt32 m_nPersistentFlags
Definition: lwpdoc.hxx:90
bool IsChildDoc() const
Definition: lwpdoc.hxx:176
LwpDocument * GetLastDivisionThatHasEndnote()
@descr Get last division that has endnote
Definition: lwpdoc.cxx:678
LwpObjectID m_DocData
Definition: lwpdoc.hxx:101
LwpAtomHolder m_Epoch
Definition: lwpdoc.hxx:103
std::unique_ptr< LwpFoundry > m_xOwnedFoundry
Definition: lwpdoc.hxx:82
LwpDocument * GetPreviousDivision()
@descr Get previous division
Definition: lwpdoc.cxx:473
sal_uInt16 m_nFlags
Definition: lwpdoc.hxx:89
void XFConvertFrameInPage(XFContentContainer *pCont)
@descr Parse the frame which anchor is to page in the entire document
Definition: lwpdoc.cxx:760
void RegisterTextStyles()
@descr Register all named para styles
Definition: lwpdoc.cxx:230
rtl::Reference< LwpVirtualLayout > GetEnSuperTableLayout()
@descr Get endnote supertable layout, every division has only one endnote supertable layout.
Definition: lwpdoc.cxx:697
void RegisterFootnoteStyles()
@descr Register footnote/endnote configuration for the entire document
Definition: lwpdoc.cxx:361
static void ChangeStyleName()
@descr change click here to placeholder
Definition: lwpdoc.cxx:785
LwpObjectID m_DivInfo
Definition: lwpdoc.hxx:102
bool IsSkippedDivision()
Definition: lwpdoc.cxx:169
LwpDocument * GetNextInGroup()
@descr Get previous division in group, copy from lwp source code
Definition: lwpdoc.cxx:524
void RegisterStylesInPara()
@descr Register all styles used in para
Definition: lwpdoc.cxx:286
void RegisterLinenumberStyles()
@descr Register line number styles
Definition: lwpdoc.cxx:351
void RegisterGraphicsStyles()
@descr Register all styles used in VO_Graphic
Definition: lwpdoc.cxx:337
LwpDocument * GetRootDocument()
@descr Get root document
Definition: lwpdoc.cxx:637
void Read() override
@descr Read VO_Document from object stream
Definition: lwpdoc.cxx:90
bool m_bGettingFirstDivisionWithContentsThatIsNotOLE
Definition: lwpdoc.hxx:83
LwpDocument * GetPreviousInGroup()
@descr Get previous division in group, copy from lwp source code
Definition: lwpdoc.cxx:509
LwpObjectID m_STXInfo
Definition: lwpdoc.hxx:107
LwpDocument(LwpObjectHeader const &objHdr, LwpSvStream *pStrm)
Definition: lwpdoc.cxx:76
LwpDocument * GetFirstDivision()
@descr Get first division
Definition: lwpdoc.cxx:626
void RegisterDefaultParaStyles()
@descr Register default para styles
Definition: lwpdoc.cxx:401
LwpDocument * ImplGetFirstDivisionWithContentsThatIsNotOLE()
@descr Get first division with contents that is not ole, copy from lwp-source code
Definition: lwpdoc.cxx:655
LwpObjectID & GetSocket()
Definition: lwpdoc.hxx:181
Base class of all Lwp VO objects.
Definition: lwpobjhdr.hxx:71
object id class
Definition: lwpobjid.hxx:79
encapsulate XInputStream to provide SvStream like interfaces
Definition: lwpsvstream.hxx:69
A container for content.