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 : * LwpDocument header file
59 : ************************************************************************/
60 : /*************************************************************************
61 : * Change History
62 : Jan 2005 Created
63 : Jun 2005 Code cleaning by change some members to local variables in Read()
64 : ************************************************************************/
65 :
66 : #ifndef INCLUDED_LOTUSWORDPRO_SOURCE_FILTER_LWPDOC_HXX
67 : #define INCLUDED_LOTUSWORDPRO_SOURCE_FILTER_LWPDOC_HXX
68 :
69 : #include "lwpobj.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"
78 :
79 : class IXFStream;
80 : class LwpVirtualLayout;
81 : /**
82 : * @brief Document object, represent document and division
83 : */
84 : class LwpDocument : public LwpDLNFPVList
85 : {
86 : public:
87 : LwpDocument(LwpObjectHeader &objHdr, LwpSvStream* pStrm);
88 : virtual ~LwpDocument();
89 :
90 : private:
91 : LwpFoundry* m_pOwnedFoundry;
92 :
93 : //Data members in file format
94 : LwpObjectID m_DocSockID;
95 : sal_uInt16 m_nFlags;
96 : sal_uInt32 m_nPersistentFlags;
97 : enum
98 : {
99 : DOC_PROTECTED = 0x00000004UL,
100 : DOC_CHILDDOC = 0x00000800UL
101 : };
102 :
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;
110 :
111 : LwpObjectID m_DivOpts;
112 : LwpObjectID m_FootnoteOpts;
113 : LwpObjectID m_DocData;
114 : LwpObjectID m_DivInfo;
115 : LwpAtomHolder m_Epoch;
116 :
117 : LwpObjectID m_WYSIWYGPageHints;
118 : LwpObjectID m_VerDoc;
119 : LwpObjectID m_STXInfo;
120 :
121 : protected:
122 : void Read() SAL_OVERRIDE;
123 : void ReadPlug();
124 : void ParseDocContent(IXFStream* pOutputStream);
125 : void RegisterTextStyles();
126 : void RegisterLayoutStyles();
127 :
128 : void RegisterStylesInPara();
129 : void RegisterBulletStyles();
130 : void RegisterGraphicsStyles();
131 : void RegisterLinenumberStyles();
132 : void RegisterFootnoteStyles();
133 : void RegisterDefaultParaStyles();
134 :
135 : public:
136 : void Parse(IXFStream* pOutputStream) SAL_OVERRIDE;
137 : void RegisterStyle() SAL_OVERRIDE;
138 :
139 : inline bool IsChildDoc();
140 : inline bool HonorProtection();
141 : inline LwpObjectID& GetContentList();
142 : inline LwpObjectID& GetDocData();
143 : inline LwpObjectID& GetSocket();
144 :
145 : inline LwpFoundry* GetFoundry();
146 : inline LwpObjectID& GetDivInfoID();
147 : inline LwpObjectID& GetPageHintsID();
148 : inline LwpObjectID& GetFootnoteOpts();
149 : inline LwpObjectID& GetVerDoc();
150 : LwpObjectID* GetValidFootnoteOpts();
151 :
152 : sal_uInt16 GetEndnoteType();
153 : LwpDocument* GetPreviousDivision();
154 : LwpDocument* GetNextDivision();
155 : LwpDocument* GetParentDivision();
156 : LwpDocument* GetPreviousInGroup();
157 :
158 : LwpDocument* GetNextInGroup();
159 : LwpDocument* GetPreviousDivisionWithContents();
160 : LwpDocument* GetLastDivisionWithContents();
161 : LwpDocument* GetLastInGroupWithContents();
162 : LwpDocument* GetRootDocument();
163 : LwpDocument* GetFirstDivisionWithContentsThatIsNotOLE();
164 : LwpDocument* GetLastDivisionThatHasEndnote();
165 :
166 : LwpDocument* GetLastDivision();
167 : LwpDocument* GetFirstDivision();
168 : LwpVirtualLayout* GetEnSuperTableLayout();
169 : bool GetNumberOfPages(LwpDocument* pEndDivision, sal_uInt16& nCount);
170 :
171 : sal_uInt16 GetNumberOfPagesBefore();
172 : void ParseFrameInPage(IXFStream* pOutputStream);
173 :
174 : private:
175 : void MaxNumberOfPages(sal_uInt16& nNumPages);
176 : void XFConvertFrameInPage(XFContentContainer* pCont);
177 : static void ChangeStyleName();
178 : bool IsSkippedDivision();
179 : };
180 :
181 512 : inline bool LwpDocument::IsChildDoc()
182 : {
183 512 : return (m_nPersistentFlags & DOC_CHILDDOC) != 0;
184 : }
185 218 : inline bool LwpDocument::HonorProtection()
186 : {
187 218 : return (m_nPersistentFlags & DOC_PROTECTED) != 0;
188 : }
189 : inline LwpObjectID& LwpDocument::GetContentList()
190 : {
191 : return m_pFoundry->GetContentManager().GetContentList();
192 : }
193 297 : inline LwpObjectID& LwpDocument::GetSocket()
194 : {
195 297 : return m_DocSockID;
196 : }
197 7 : inline LwpFoundry* LwpDocument::GetFoundry()
198 : {
199 7 : return m_pFoundry;
200 : }
201 34 : inline LwpObjectID& LwpDocument::GetDivInfoID()
202 : {
203 34 : return m_DivInfo;
204 : }
205 0 : inline LwpObjectID& LwpDocument::GetPageHintsID()
206 : {
207 0 : return m_WYSIWYGPageHints;
208 : }
209 8 : inline LwpObjectID& LwpDocument::GetFootnoteOpts()
210 : {
211 8 : return m_FootnoteOpts;
212 : }
213 4 : inline LwpObjectID& LwpDocument::GetDocData()
214 : {
215 4 : return m_DocData;
216 : }
217 4 : inline LwpObjectID& LwpDocument::GetVerDoc()
218 : {
219 4 : return m_VerDoc;
220 : }
221 :
222 : /**
223 : * @brief DocumentSock object, divisions are embedded by document socket object
224 : */
225 : class LwpDocSock : public LwpDLNFVList
226 : {
227 : public:
228 : LwpDocSock(LwpObjectHeader &objHdr, LwpSvStream* pStrm);
229 16 : virtual ~LwpDocSock(){}
230 : private:
231 : LwpObjectID m_Doc;
232 : protected:
233 : void Read() SAL_OVERRIDE;
234 : public:
235 : void RegisterStyle() SAL_OVERRIDE;
236 : void Parse(IXFStream* pOutputStream) SAL_OVERRIDE;
237 : };
238 :
239 : #endif
240 :
241 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|