1 /*************************************************************************
3 * The Contents of this file are made available subject to the terms of
4 * either of the following licenses
6 * - GNU Lesser General Public License Version 2.1
7 * - Sun Industry Standards Source License Version 1.1
9 * Sun Microsystems Inc., October, 2000
11 * GNU Lesser General Public License Version 2.1
12 * =============================================
13 * Copyright 2000 by Sun Microsystems, Inc.
14 * 901 San Antonio Road, Palo Alto, CA 94303, USA
16 * This library is free software; you can redistribute it and/or
17 * modify it under the terms of the GNU Lesser General Public
18 * License version 2.1, as published by the Free Software Foundation.
20 * This library is distributed in the hope that it will be useful,
21 * but WITHOUT ANY WARRANTY; without even the implied warranty of
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
23 * Lesser General Public License for more details.
25 * You should have received a copy of the GNU Lesser General Public
26 * License along with this library; if not, write to the Free Software
27 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
31 * Sun Industry Standards Source License Version 1.1
32 * =================================================
33 * The contents of this file are subject to the Sun Industry Standards
34 * Source License Version 1.1 (the "License"); You may not use this file
35 * except in compliance with the License. You may obtain a copy of the
36 * License at http://www.openoffice.org/license.html.
38 * Software provided under this License is provided on an "AS IS" basis,
39 * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
40 * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
41 * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
42 * See the License for the specific provisions governing your rights and
43 * obligations concerning the Software.
45 * The Initial Developer of the Original Code is: IBM Corporation
47 * Copyright: 2008 by IBM Corporation
49 * All Rights Reserved.
51 * Contributor(s): _______________________________________
54 ************************************************************************/
55 /*************************************************************************
57 * LwpDocument header file
58 ************************************************************************/
59 /*************************************************************************
62 Jun 2005 Code cleaning by change some members to local variables in Read()
63 ************************************************************************/
65 #ifndef _LWPDOCUMENT_HXX
66 #define _LWPDOCUMENT_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
);
91 //Data members in file format
92 LwpObjectID m_DocSockID
;
94 sal_uInt32 m_nPersistentFlags
;
97 DOC_PROTECTED
= 0x00000004UL
,
98 /*#define DOC_USECONTENTS 0x00000008UL
99 #define DOC_LOCKREVISIONS 0x00000200UL
100 #define DOC_LOCAL 0x00000400UL
102 DOC_CHILDDOC
= 0x00000800UL
103 /*#define DOC_DOPREVIEW 0x02000000UL
104 #define DOC_REBUILDENDNOTES 0x04000000UL
105 #define DOC_FILEPROTECTION 0x10000000UL
106 #define DOC_PERSISTENTBITS (DOC_PROTECTED | DOC_USECONTENTS | DOC_LOCKREVISIONS | DOC_LOCAL | DOC_CHILDDOC | DOC_DOPREVIEW | DOC_REBUILDENDNOTES | DOC_FILEPROTECTION)
110 //Code cleaning by change some members to local variables in Read()
111 //Reserve the comments for future use
112 //LwpSortOption* m_pDocSort;
113 //LwpUIDocument* m_pUIDoc;
114 LwpLineNumberOptions
* m_pLnOpts
;
115 //LwpUserDictFiles* m_pUsrDicts;
116 //LwpPrinterInfo* m_pPrtInfo;
118 LwpObjectID m_DivOpts
;
119 LwpObjectID m_FootnoteOpts
;
120 LwpObjectID m_DocData
;
121 LwpObjectID m_DivInfo
;
122 LwpAtomHolder m_Epoch
;
124 LwpObjectID m_WYSIWYGPageHints
;
125 LwpObjectID m_VerDoc
;
126 LwpObjectID m_STXInfo
;
131 void ParseDocContent(IXFStream
* pOutputStream
);
132 void RegisterTextStyles();
133 void RegisterLayoutStyles();
135 void RegisterStylesInPara();
136 void RegisterBulletStyles();
137 void RegisterGraphicsStyles();
138 void RegisterLinenumberStyles();
139 void RegisterFootnoteStyles();
140 void RegisterDefaultParaStyles();
141 void ParseMasterDoc(IXFStream
* pOutputStream
);
144 void Parse(IXFStream
* pOutputStream
);
145 void RegisterStyle();
147 inline sal_Bool
IsChildDoc();
148 inline sal_Bool
HonorProtection();
149 inline LwpObjectID
* GetContentList();
150 inline LwpObjectID
* GetDocData();
151 inline LwpObjectID
* GetSocket();
153 inline LwpFoundry
* GetFoundry();
154 inline LwpObjectID
* GetDivInfoID();
155 inline LwpObjectID
* GetPageHintsID();
156 inline LwpObjectID
* GetFootnoteOpts();
157 inline LwpObjectID
* GetVerDoc();
158 LwpObjectID
* GetValidFootnoteOpts();
160 sal_uInt16
GetEndnoteType();
161 LwpDocument
* GetPreviousDivision();
162 LwpDocument
* GetNextDivision();
163 LwpDocument
* GetParentDivision();
164 LwpDocument
* GetPreviousInGroup();
166 LwpDocument
* GetNextInGroup();
167 LwpDocument
* GetPreviousDivisionWithContents();
168 LwpDocument
* GetLastDivisionWithContents();
169 LwpDocument
* GetLastInGroupWithContents();
170 LwpDocument
* GetRootDocument();
171 LwpDocument
* GetFirstDivisionWithContentsThatIsNotOLE();
172 LwpDocument
* GetLastDivisionThatHasEndnote();
174 LwpDocument
* GetLastDivision();
175 LwpDocument
* GetFirstDivision();
176 LwpVirtualLayout
* GetEnSuperTableLayout();
177 sal_Bool
GetNumberOfPages(LwpDocument
* pEndDivision
, sal_uInt16
& nCount
);
178 sal_uInt16
GetMaxNumberOfPages();
180 sal_uInt16
GetNumberOfPagesBefore();
181 void ParseFrameInPage(IXFStream
* pOutputStream
);
184 void MaxNumberOfPages(sal_uInt16
& nNumPages
);
185 void XFConvertFrameInPage(XFContentContainer
* pCont
);
186 void ChangeStyleName();
187 sal_Bool
IsSkippedDivision();//add by
190 inline sal_Bool
LwpDocument::IsChildDoc()
192 return (sal_Bool
) ((m_nPersistentFlags
& DOC_CHILDDOC
) ? TRUE
: FALSE
);
194 inline sal_Bool
LwpDocument::HonorProtection()
196 return m_nPersistentFlags
& DOC_PROTECTED
? sal_True
: sal_False
;
198 inline LwpObjectID
* LwpDocument::GetContentList()
200 return(m_pFoundry
->GetContentManager()->GetContentList());
202 inline LwpObjectID
* LwpDocument::GetSocket()
206 inline LwpFoundry
* LwpDocument::GetFoundry()
210 inline LwpObjectID
* LwpDocument::GetDivInfoID()
214 inline LwpObjectID
* LwpDocument::GetPageHintsID()
216 return &m_WYSIWYGPageHints
;
218 inline LwpObjectID
* LwpDocument::GetFootnoteOpts()
220 return &m_FootnoteOpts
;
222 inline LwpObjectID
* LwpDocument::GetDocData()
226 inline LwpObjectID
* LwpDocument::GetVerDoc()
232 * @brief DocumentSock object, divisions are embedded by document socket object
234 class LwpDocSock
: public LwpDLNFVList
237 LwpDocSock(LwpObjectHeader
&objHdr
, LwpSvStream
* pStrm
);
244 void RegisterStyle();
245 void Parse(IXFStream
* pOutputStream
);