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,
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 /*************************************************************************
58 * LwpDocument header file
59 ************************************************************************/
60 /*************************************************************************
63 Jun 2005 Code cleaning by change some members to local variables in Read()
64 ************************************************************************/
66 #ifndef INCLUDED_LOTUSWORDPRO_SOURCE_FILTER_LWPDOC_HXX
67 #define INCLUDED_LOTUSWORDPRO_SOURCE_FILTER_LWPDOC_HXX
70 #include "lwpsortopt.hxx"
71 #include "lwpuidoc.hxx"
72 #include "lwplnopts.hxx"
73 #include "lwpusrdicts.hxx"
74 #include "lwpprtinfo.hxx"
75 #include "lwpdlvlist.hxx"
76 #include "lwpheader.hxx"
77 #include "lwpfoundry.hxx"
80 class LwpVirtualLayout
;
82 * @brief Document object, represent document and division
84 class LwpDocument
: public LwpDLNFPVList
87 LwpDocument(LwpObjectHeader
&objHdr
, LwpSvStream
* pStrm
);
88 virtual ~LwpDocument();
91 LwpFoundry
* m_pOwnedFoundry
;
93 //Data members in file format
94 LwpObjectID m_DocSockID
;
96 sal_uInt32 m_nPersistentFlags
;
99 DOC_PROTECTED
= 0x00000004UL
,
100 DOC_CHILDDOC
= 0x00000800UL
103 //Code cleaning by change some members to local variables in Read()
104 //Reserve the comments for future use
105 //LwpSortOption* m_pDocSort;
106 //LwpUIDocument* m_pUIDoc;
107 LwpLineNumberOptions
* m_pLnOpts
;
108 //LwpUserDictFiles* m_pUsrDicts;
109 //LwpPrinterInfo* m_pPrtInfo;
111 LwpObjectID m_DivOpts
;
112 LwpObjectID m_FootnoteOpts
;
113 LwpObjectID m_DocData
;
114 LwpObjectID m_DivInfo
;
115 LwpAtomHolder m_Epoch
;
117 LwpObjectID m_WYSIWYGPageHints
;
118 LwpObjectID m_VerDoc
;
119 LwpObjectID m_STXInfo
;
122 void Read() SAL_OVERRIDE
;
124 void ParseDocContent(IXFStream
* pOutputStream
);
125 void RegisterTextStyles();
126 void RegisterLayoutStyles();
128 void RegisterStylesInPara();
129 void RegisterBulletStyles();
130 void RegisterGraphicsStyles();
131 void RegisterLinenumberStyles();
132 void RegisterFootnoteStyles();
133 void RegisterDefaultParaStyles();
136 void Parse(IXFStream
* pOutputStream
) SAL_OVERRIDE
;
137 void RegisterStyle() SAL_OVERRIDE
;
139 inline bool IsChildDoc();
140 inline bool HonorProtection();
141 inline LwpObjectID
* GetContentList();
142 inline LwpObjectID
* GetDocData();
143 inline LwpObjectID
* GetSocket();
145 inline LwpFoundry
* GetFoundry();
146 inline LwpObjectID
* GetDivInfoID();
147 inline LwpObjectID
* GetPageHintsID();
148 inline LwpObjectID
* GetFootnoteOpts();
149 inline LwpObjectID
* GetVerDoc();
150 LwpObjectID
* GetValidFootnoteOpts();
152 sal_uInt16
GetEndnoteType();
153 LwpDocument
* GetPreviousDivision();
154 LwpDocument
* GetNextDivision();
155 LwpDocument
* GetParentDivision();
156 LwpDocument
* GetPreviousInGroup();
158 LwpDocument
* GetNextInGroup();
159 LwpDocument
* GetPreviousDivisionWithContents();
160 LwpDocument
* GetLastDivisionWithContents();
161 LwpDocument
* GetLastInGroupWithContents();
162 LwpDocument
* GetRootDocument();
163 LwpDocument
* GetFirstDivisionWithContentsThatIsNotOLE();
164 LwpDocument
* GetLastDivisionThatHasEndnote();
166 LwpDocument
* GetLastDivision();
167 LwpDocument
* GetFirstDivision();
168 LwpVirtualLayout
* GetEnSuperTableLayout();
169 bool GetNumberOfPages(LwpDocument
* pEndDivision
, sal_uInt16
& nCount
);
171 sal_uInt16
GetNumberOfPagesBefore();
172 void ParseFrameInPage(IXFStream
* pOutputStream
);
175 void MaxNumberOfPages(sal_uInt16
& nNumPages
);
176 void XFConvertFrameInPage(XFContentContainer
* pCont
);
177 void ChangeStyleName();
178 bool IsSkippedDivision();
181 inline bool LwpDocument::IsChildDoc()
183 return (m_nPersistentFlags
& DOC_CHILDDOC
);
185 inline bool LwpDocument::HonorProtection()
187 return m_nPersistentFlags
& DOC_PROTECTED
;
189 inline LwpObjectID
* LwpDocument::GetContentList()
191 return(m_pFoundry
->GetContentManager()->GetContentList());
193 inline LwpObjectID
* LwpDocument::GetSocket()
197 inline LwpFoundry
* LwpDocument::GetFoundry()
201 inline LwpObjectID
* LwpDocument::GetDivInfoID()
205 inline LwpObjectID
* LwpDocument::GetPageHintsID()
207 return &m_WYSIWYGPageHints
;
209 inline LwpObjectID
* LwpDocument::GetFootnoteOpts()
211 return &m_FootnoteOpts
;
213 inline LwpObjectID
* LwpDocument::GetDocData()
217 inline LwpObjectID
* LwpDocument::GetVerDoc()
223 * @brief DocumentSock object, divisions are embedded by document socket object
225 class LwpDocSock
: public LwpDLNFVList
228 LwpDocSock(LwpObjectHeader
&objHdr
, LwpSvStream
* pStrm
);
229 virtual ~LwpDocSock(){}
233 void Read() SAL_OVERRIDE
;
235 void RegisterStyle() SAL_OVERRIDE
;
236 void Parse(IXFStream
* pOutputStream
) SAL_OVERRIDE
;
241 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */