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