summaryrefslogtreecommitdiff
path: root/lotuswordpro/source/filter/lwpmarker.hxx
blob: 8375d07327d48c612d18590f17b8ebebbf2bdf0c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
 *
 *  The Contents of this file are made available subject to the terms of
 *  either of the following licenses
 *
 *         - GNU Lesser General Public License Version 2.1
 *         - Sun Industry Standards Source License Version 1.1
 *
 *  Sun Microsystems Inc., October, 2000
 *
 *  GNU Lesser General Public License Version 2.1
 *  =============================================
 *  Copyright 2000 by Sun Microsystems, Inc.
 *  901 San Antonio Road, Palo Alto, CA 94303, USA
 *
 *  This library is free software; you can redistribute it and/or
 *  modify it under the terms of the GNU Lesser General Public
 *  License version 2.1, as published by the Free Software Foundation.
 *
 *  This library is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 *  Lesser General Public License for more details.
 *
 *  You should have received a copy of the GNU Lesser General Public
 *  License along with this library; if not, write to the Free Software
 *  Foundation, Inc., 59 Temple Place, Suite 330, Boston,
 *  MA  02111-1307  USA
 *
 *
 *  Sun Industry Standards Source License Version 1.1
 *  =================================================
 *  The contents of this file are subject to the Sun Industry Standards
 *  Source License Version 1.1 (the "License"); You may not use this file
 *  except in compliance with the License. You may obtain a copy of the
 *  License at http://www.openoffice.org/license.html.
 *
 *  Software provided under this License is provided on an "AS IS" basis,
 *  WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
 *  WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
 *  MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
 *  See the License for the specific provisions governing your rights and
 *  obligations concerning the Software.
 *
 *  The Initial Developer of the Original Code is: IBM Corporation
 *
 *  Copyright: 2008 by IBM Corporation
 *
 *  All Rights Reserved.
 *
 *  Contributor(s): _______________________________________
 *
 *
 ************************************************************************/
/*************************************************************************
 * @file
 *  For LWP filter architecture prototype
 ************************************************************************/

#ifndef INCLUDED_LOTUSWORDPRO_SOURCE_FILTER_LWPMARKER_HXX
#define INCLUDED_LOTUSWORDPRO_SOURCE_FILTER_LWPMARKER_HXX

#include <lwpobjid.hxx>
#include "lwpdlvlist.hxx"
#include <lwpfrib.hxx>

class LwpMarker : public LwpDLNFPVList
{
public:
    LwpMarker(LwpObjectHeader const &objHdr, LwpSvStream *pStrm);
    void Read() override;
    OUString GetNamedProperty(std::u16string_view name);
protected:
    enum{
        MARKER_START=1,
        MARKER_END=2
    };
private:
    sal_uInt16 m_nFlag;
    sal_uInt16 m_nPageNumber;
    sal_uInt16 m_nNeedUpdate;
    LwpObjectID m_objLayout;
    LwpObjectID m_objMarkerList;
    LwpObjectID m_objContent;

};

class LwpFribRange
{
public:
    LwpFribRange(){}
    void Read(LwpObjectStream* pObjStrm);
private:
    LwpObjectID m_StartPara;
    LwpObjectID m_EndPara;
};

class LwpStoryMarker : public LwpMarker
{
public:
    LwpStoryMarker(LwpObjectHeader const &objHdr, LwpSvStream *pStrm);
    void Read() override;
private:
    LwpFribRange m_Range;
    sal_uInt16 m_nFlag;
};

class LwpCHBlkMarker : public LwpStoryMarker
{
public:
    LwpCHBlkMarker(LwpObjectHeader const &objHdr, LwpSvStream *pStrm);
    void Read() override;
    sal_uInt16 GetAction() const {return m_nAction;}
    void ConvertCHBlock(XFContentContainer* pXFPara,sal_uInt8 nType);
    enum{
        CLICKHERE_CHBEHAVIORTEXT=1,
        CLICKHERE_CHBEHAVIORTABLE=2,
        CLICKHERE_CHBEHAVIORPICTURE=3,
        CLICKHERE_CHBEHAVIOROLEOBJECT=4,
        CLICKHERE_CHBEHAVIORCHART=5,
        CLICKHERE_CHBEHAVIORDRAWING=6,
        CLICKHERE_CHBEHAVIORFILE=7,
        CLICKHERE_CHBEHAVIORGLOSSARY=8,
        CLICKHERE_CHBEHAVIOREQUATION=9,
        CLICKHERE_CHBEHAVIORINTERNETLINK=10,
        CLICKHERE_CHBEHAVIORSTRINGLIST=11,
        CLICKHERE_CHBEHAVIORDATETIME=12,
        CLICKHERE_CHBEHAVIORSYMBOL=13,
        CLICKHERE_CHBEHAVIORDOCFIELD=14,
        CLICKHERE_CHBEHAVIORPAGENUM=15
    };
private:
    void ProcessPlaceHolder(XFContentContainer* pXFPara,sal_uInt16 nAction,sal_uInt8 nType);
    void ProcessOtherCHB(XFContentContainer* pXFPara,sal_uInt8 nType);
    void ProcessKeylist(XFContentContainer* pXFPara,sal_uInt8 nType);
    bool IsHasFilled() const;
    bool IsBubbleHelp() const;
    OUString GetPromptText() const;
    void EnumAllKeywords();
private:
    enum{
        CHB_PROMPT = 0x01,
        CHB_EDIT = 0x02,
        CHB_HELP = 0x04,
        CHB_TAB = 0x08,
        CHB_HIDDEN = 0x10,
        CHB_ALLOWVALUESNOTINLIST = 0x20,
        CHB_ALLOWMULTIVALUES = 0x40,
        CHB_RETURN = 0x80,
        CHB_NOEARS = 0x100,
        CHB_MAGNETIC = 0x200,
        CHB_PERSISTENT = (CHB_PROMPT+CHB_HELP+CHB_TAB+CHB_HIDDEN
            +CHB_ALLOWVALUESNOTINLIST+CHB_ALLOWMULTIVALUES
            +CHB_RETURN+CHB_NOEARS+CHB_MAGNETIC)
    };
    LwpObjectID m_objPromptStory;
    sal_uInt32 m_nTab;
    sal_uInt16 m_nFlag;
    sal_uInt16 m_nAction;
    LwpAtomHolder m_Help;
    LwpAtomHolder m_Mirror;
    std::vector<OUString> m_Keylist;
};

class LwpBookMark : public LwpDLNFVList
{
public:
    LwpBookMark(LwpObjectHeader const &objHdr, LwpSvStream *pStrm);
protected:
    void Read() override;
public:
    bool IsRightMarker(LwpObjectID objMarker);
    OUString const & GetName();
private:
    enum {  BKMK_NOTESFX = 0x0001,
        BKMK_OLDNOTESFX = 0x0002
        };
    LwpObjectID m_objMarker;
    sal_uInt16 m_nFlag;
};

class LwpFieldMark : public LwpStoryMarker
{
public:
    LwpFieldMark(LwpObjectHeader const &objHdr, LwpSvStream *pStrm);
    void Read() override;
    void ParseIndex(OUString& sKey1,OUString& sKey2);
    void ParseTOC(OUString& sLevel,OUString& sText);
    sal_uInt16 GetFieldType() const {return m_nFieldType;}
    bool IsFormulaInsert() const;
    bool IsDateTimeField(sal_uInt8& type,OUString& formula);
    bool IsCrossRefField(sal_uInt8& nType, OUString& sMarkName);
    bool IsDocPowerField(sal_uInt8& nType,OUString& sFormula);
    OUString const & GetFormula() const {return m_Formula.str();}
    void SetStyleFlag(bool bFalg){m_bHasStyle = bFalg;}
    bool GetStyleFlag() const {return m_bHasStyle;}
    bool GetStart() const {return m_bHasStart;}
    void SetStart(bool bFlag){m_bHasStart = bFlag;}
    LwpFrib* GetStartFrib(){return m_pFrib;}
    void SetStartFrib(LwpFrib* pFrib){m_pFrib = pFrib;}
    bool GetRevisionFlag() const {return m_bRevisionFlag;}
    void SetRevisionFlag(bool bFlag){m_bRevisionFlag = bFlag;}

    enum{
        FLD_FIELD = 0x0003,
        FLD_INDEX = 0x0008,
        FLD_TOC = 0x000B
    };
    enum{
        FF_FORMULAINSERTED = 0X0008,
    };
    enum{
        CROSSREF_INVALID = 0,
        CROSSREF_TEXT = 1,
        CROSSREF_PAGE = 2,
        CROSSREF_PARANUMBER = 3
    };
    enum{
        DATETIME_SKIP = 0,
        DATETIME_NOW = 1,
        DATETIME_CREATE = 2,
        DATETIME_LASTEDIT = 3,
        DATETIME_TOTALTIME = 4
    };
    enum{
        DOC_DESCRIPTION = 1,
        DOC_NUMPAGES = 2,
        DOC_NUMWORDS = 3,
        DOC_NUMCHARS = 4,
    };
private:
    LwpObjectID m_objFormulaStory;
    LwpObjectID m_objResultContent;
    sal_uInt16 m_nFlag;
    sal_uInt16 m_nFieldType;
    LwpAtomHolder m_Formula;

    bool m_bHasStyle;
    bool m_bHasStart;

    LwpFrib* m_pFrib;
    bool m_bRevisionFlag;
};

class LwpRubyMarker : public LwpStoryMarker
{
public:
    LwpRubyMarker(LwpObjectHeader const &objHdr, LwpSvStream *pStrm);
    void Read() override;
    const OUString& GetRubyText() const {return m_strRubyText;}
    void SetRubyText(const OUString& sText){m_strRubyText = sText;}
    const OUString& GetTextStyleName() const {return m_TextStyle;}
    void SetTextStyleName(const OUString& sName){m_TextStyle = sName;}
    const OUString& GetRubyStyleName() const {return m_RubyStyle;}
    void SetRubyStyleName(const OUString& sName){m_RubyStyle = sName;}
private:
    LwpObjectID m_objLayout;
    OUString m_strRubyText;
    OUString m_RubyStyle;
    OUString m_TextStyle;
};
#endif

/* vim:set shiftwidth=4 softtabstop=4 expandtab: */