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 : * For LWP filter architecture prototype
59 : ************************************************************************/
60 : /*************************************************************************
61 : * Change History
62 : Mar 2005 Created
63 : ************************************************************************/
64 :
65 : #ifndef INCLUDED_LOTUSWORDPRO_SOURCE_FILTER_LWPMARKER_HXX
66 : #define INCLUDED_LOTUSWORDPRO_SOURCE_FILTER_LWPMARKER_HXX
67 :
68 : #include "lwpobj.hxx"
69 : #include "lwpobjid.hxx"
70 : #include "lwpdlvlist.hxx"
71 : #include "lwpfrib.hxx"
72 : #include "xfilter/xftextspan.hxx"
73 :
74 : class LwpMarker : public LwpDLNFPVList
75 : {
76 : public:
77 : LwpMarker(LwpObjectHeader &objHdr, LwpSvStream *pStrm);
78 2 : virtual ~LwpMarker(){}
79 : void Read() SAL_OVERRIDE;
80 : OUString GetNamedProperty(const OUString& name);
81 : protected:
82 : enum{
83 : MARKER_START=1,
84 : MARKER_END=2
85 : };
86 : private:
87 : sal_uInt16 m_nFlag;
88 : sal_uInt16 m_nPageNumber;
89 : sal_uInt16 m_nNeedUpdate;
90 : LwpObjectID m_objLayout;
91 : LwpObjectID m_objMarkerList;
92 : LwpObjectID m_objContent;
93 :
94 : };
95 :
96 : class LwpFribRange
97 : {
98 : public:
99 2 : LwpFribRange(){}
100 2 : ~LwpFribRange(){}
101 : void Read(LwpObjectStream* pObjStrm);
102 : private:
103 : LwpObjectID m_StartPara;
104 : LwpObjectID m_EndPara;
105 : };
106 :
107 : class LwpStoryMarker : public LwpMarker
108 : {
109 : public:
110 : LwpStoryMarker(LwpObjectHeader &objHdr, LwpSvStream *pStrm);
111 2 : virtual ~LwpStoryMarker(){}
112 : void Read() SAL_OVERRIDE;
113 : private:
114 : LwpFribRange m_Range;
115 : sal_uInt16 m_nFlag;
116 : };
117 :
118 : class LwpCHBlkMarker : public LwpStoryMarker
119 : {
120 : public:
121 : LwpCHBlkMarker(LwpObjectHeader &objHdr, LwpSvStream *pStrm);
122 0 : virtual ~LwpCHBlkMarker(){}
123 : void Read() SAL_OVERRIDE;
124 0 : sal_uInt16 GetAction(){return m_nAction;}
125 : void ConvertCHBlock(XFContentContainer* pXFPara,sal_uInt8 nType);
126 : enum{
127 : CLICKHERE_CHBEHAVIORTEXT=1,
128 : CLICKHERE_CHBEHAVIORTABLE=2,
129 : CLICKHERE_CHBEHAVIORPICTURE=3,
130 : CLICKHERE_CHBEHAVIOROLEOBJECT=4,
131 : CLICKHERE_CHBEHAVIORCHART=5,
132 : CLICKHERE_CHBEHAVIORDRAWING=6,
133 : CLICKHERE_CHBEHAVIORFILE=7,
134 : CLICKHERE_CHBEHAVIORGLOSSARY=8,
135 : CLICKHERE_CHBEHAVIOREQUATION=9,
136 : CLICKHERE_CHBEHAVIORINTERNETLINK=10,
137 : CLICKHERE_CHBEHAVIORSTRINGLIST=11,
138 : CLICKHERE_CHBEHAVIORDATETIME=12,
139 : CLICKHERE_CHBEHAVIORSYMBOL=13,
140 : CLICKHERE_CHBEHAVIORDOCFIELD=14,
141 : CLICKHERE_CHBEHAVIORPAGENUM=15
142 : };
143 : private:
144 : void ProcessPlaceHolder(XFContentContainer* pXFPara,sal_uInt16 nAction,sal_uInt8 nType);
145 : void ProcessOtherCHB(XFContentContainer* pXFPara,sal_uInt8 nType);
146 : void ProcessKeylist(XFContentContainer* pXFPara,sal_uInt8 nType);
147 : bool IsHasFilled();
148 : bool IsBubbleHelp();
149 : OUString GetPromptText();
150 : void EnumAllKeywords();
151 : private:
152 : enum{
153 : CHB_PROMPT = 0x01,
154 : CHB_EDIT = 0x02,
155 : CHB_HELP = 0x04,
156 : CHB_TAB = 0x08,
157 : CHB_HIDDEN = 0x10,
158 : CHB_ALLOWVALUESNOTINLIST = 0x20,
159 : CHB_ALLOWMULTIVALUES = 0x40,
160 : CHB_RETURN = 0x80,
161 : CHB_NOEARS = 0x100,
162 : CHB_MAGNETIC = 0x200,
163 : CHB_PERSISTENT = (CHB_PROMPT+CHB_HELP+CHB_TAB+CHB_HIDDEN
164 : +CHB_ALLOWVALUESNOTINLIST+CHB_ALLOWMULTIVALUES
165 : +CHB_RETURN+CHB_NOEARS+CHB_MAGNETIC)
166 : };
167 : LwpObjectID m_objPromptStory;
168 : sal_uInt32 m_nTab;
169 : sal_uInt16 m_nFlag;
170 : sal_uInt16 m_nAction;
171 : LwpAtomHolder m_Help;
172 : LwpAtomHolder m_Mirror;
173 : std::vector<OUString> m_Keylist;
174 : };
175 :
176 : class LwpBookMark : public LwpDLNFVList
177 : {
178 : public:
179 : LwpBookMark(LwpObjectHeader &objHdr, LwpSvStream *pStrm);
180 0 : virtual ~LwpBookMark(){}
181 : protected:
182 : void Read() SAL_OVERRIDE;
183 : public:
184 : bool IsRightMarker(LwpObjectID objMarker);
185 : OUString GetName();
186 : private:
187 : enum { BKMK_NOTESFX = 0x0001,
188 : BKMK_OLDNOTESFX = 0x0002
189 : };
190 : LwpObjectID m_objMarker;
191 : sal_uInt16 m_nFlag;
192 : };
193 :
194 : class LwpFieldMark : public LwpStoryMarker
195 : {
196 : public:
197 : LwpFieldMark(LwpObjectHeader &objHdr, LwpSvStream *pStrm);
198 4 : virtual ~LwpFieldMark(){}
199 : void Read() SAL_OVERRIDE;
200 : void ParseIndex(OUString& sKey1,OUString& sKey2);
201 : void ParseTOC(OUString& sLevel,OUString& sText);
202 10 : sal_uInt16 GetFieldType(){return m_nFieldType;}
203 : bool IsFormulaInsert();
204 : bool IsDateTimeField(sal_uInt8& type,OUString& formula);
205 : bool IsCrossRefField(sal_uInt8& nType, OUString& sMarkName);
206 : bool IsDocPowerField(sal_uInt8& nType,OUString& sFormula);
207 3 : OUString GetFormula(){return m_Formula.str();}
208 0 : void SetStyleFlag(bool bFalg){m_bHasStyle = bFalg;}
209 2 : bool GetStyleFlag(){return m_bHasStyle;}
210 2 : bool GetStart(){return m_bHasStart;}
211 2 : void SetStart(bool bFlag){m_bHasStart = bFlag;}
212 0 : LwpFrib* GetStartFrib(){return m_pFrib;}
213 0 : void SetStartFrib(LwpFrib* pFrib){m_pFrib = pFrib;}
214 8 : bool GetRevisionFlag(){return m_bRevisionFlag;}
215 0 : void SetRevisionFlag(bool bFlag){m_bRevisionFlag = bFlag;}
216 :
217 : enum{
218 : FLD_FIELD = 0x0003,
219 : FLD_INDEX = 0x0008,
220 : FLD_TOC = 0x000B
221 : };
222 : enum{
223 : FF_FORMULAINSERTED = 0X0008,
224 : };
225 : enum{
226 : CROSSREF_INVALID = 0,
227 : CROSSREF_TEXT = 1,
228 : CROSSREF_PAGE = 2,
229 : CROSSREF_PARANUMBER = 3
230 : };
231 : enum{
232 : DATETIME_SKIP = 0,
233 : DATETIME_NOW = 1,
234 : DATETIME_CREATE = 2,
235 : DATETIME_LASTEDIT = 3,
236 : DATETIME_TOTALTIME = 4
237 : };
238 : enum{
239 : DOC_DESCRIPTION = 1,
240 : DOC_NUMPAGES = 2,
241 : DOC_NUMWORDS = 3,
242 : DOC_NUMCHARS = 4,
243 : };
244 : private:
245 : LwpObjectID m_objFormulaStory;
246 : LwpObjectID m_objResultContent;
247 : sal_uInt16 m_nFlag;
248 : sal_uInt16 m_nFieldType;
249 : LwpAtomHolder m_Formula;
250 :
251 : bool m_bHasStyle;
252 : bool m_bHasStart;
253 :
254 : LwpFrib* m_pFrib;
255 : bool m_bRevisionFlag;
256 : };
257 :
258 : class LwpRubyMarker : public LwpStoryMarker
259 : {
260 : public:
261 : LwpRubyMarker(LwpObjectHeader &objHdr, LwpSvStream *pStrm);
262 0 : virtual ~LwpRubyMarker(){}
263 : void Read() SAL_OVERRIDE;
264 0 : OUString GetRubyText(){return m_strRubyText;}
265 0 : void SetRubyText(const OUString& sText){m_strRubyText = sText;}
266 0 : OUString GetTextStyleName(){return m_TextStyle;}
267 0 : void SetTextStyleName(const OUString& sName){m_TextStyle = sName;}
268 0 : OUString GetRubyStyleName(){return m_RubyStyle;}
269 0 : void SetRubyStyleName(const OUString& sName){m_RubyStyle = sName;}
270 : private:
271 : LwpObjectID m_objLayout;
272 : OUString m_strRubyText;
273 : OUString m_RubyStyle;
274 : OUString m_TextStyle;
275 : };
276 : #endif
277 :
278 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|