blob: 71e98888e06d345d21535a780795567c573cd6de (
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
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
|
/* ====================================================================
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(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.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
==================================================================== */
package org.apache.poi.hwpf.usermodel;
import org.apache.poi.common.Duplicatable;
import org.apache.poi.hwpf.model.Colorref;
import org.apache.poi.hwpf.model.types.CHPAbstractType;
@SuppressWarnings("unused")
public final class CharacterProperties extends CHPAbstractType implements Duplicatable {
public static final short SPRM_FRMARKDEL = (short)0x0800;
public static final short SPRM_FRMARK = 0x0801;
public static final short SPRM_FFLDVANISH = 0x0802;
public static final short SPRM_PICLOCATION = 0x6A03;
public static final short SPRM_IBSTRMARK = 0x4804;
public static final short SPRM_DTTMRMARK = 0x6805;
public static final short SPRM_FDATA = 0x0806;
public static final short SPRM_SYMBOL = 0x6A09;
public static final short SPRM_FOLE2 = 0x080A;
public static final short SPRM_HIGHLIGHT = 0x2A0C;
public static final short SPRM_OBJLOCATION = 0x680E;
public static final short SPRM_ISTD = 0x4A30;
public static final short SPRM_FBOLD = 0x0835;
public static final short SPRM_FITALIC = 0x0836;
public static final short SPRM_FSTRIKE = 0x0837;
public static final short SPRM_FOUTLINE = 0x0838;
public static final short SPRM_FSHADOW = 0x0839;
public static final short SPRM_FSMALLCAPS = 0x083A;
public static final short SPRM_FCAPS = 0x083B;
public static final short SPRM_FVANISH = 0x083C;
public static final short SPRM_KUL = 0x2A3E;
public static final short SPRM_DXASPACE = (short)0x8840;
public static final short SPRM_LID = 0x4A41;
public static final short SPRM_ICO = 0x2A42;
public static final short SPRM_HPS = 0x4A43;
public static final short SPRM_HPSPOS = 0x4845;
public static final short SPRM_ISS = 0x2A48;
public static final short SPRM_HPSKERN = 0x484B;
public static final short SPRM_YSRI = 0x484E;
public static final short SPRM_RGFTCASCII = 0x4A4F;
public static final short SPRM_RGFTCFAREAST = 0x4A50;
public static final short SPRM_RGFTCNOTFAREAST = 0x4A51;
public static final short SPRM_CHARSCALE = 0x4852;
public static final short SPRM_FDSTRIKE = 0x2A53;
public static final short SPRM_FIMPRINT = 0x0854;
public static final short SPRM_FSPEC = 0x0855;
public static final short SPRM_FOBJ = 0x0856;
public static final short SPRM_PROPRMARK = (short)0xCA57;
public static final short SPRM_FEMBOSS = 0x0858;
public static final short SPRM_SFXTEXT = 0x2859;
/*
* Microsoft Office Word 97-2007 Binary File Format (.doc) Specification;
* Page 60 of 210
*/
public static final short SPRM_DISPFLDRMARK = (short)0xCA62;
public static final short SPRM_IBSTRMARKDEL = 0x4863;
public static final short SPRM_DTTMRMARKDEL = 0x6864;
public static final short SPRM_BRC = 0x6865;
public static final short SPRM_SHD = 0x4866;
public static final short SPRM_IDSIRMARKDEL = 0x4867;
public static final short SPRM_CPG = 0x486B;
public static final short SPRM_NONFELID = 0x486D;
public static final short SPRM_FELID = 0x486E;
public static final short SPRM_IDCTHINT = 0x286F;
/**
* change chp.cv
*/
public static final short SPRM_CCV = 0x6870;
public CharacterProperties() {
setFUsePgsuSettings( true );
setXstDispFldRMark( new byte[36] );
}
public CharacterProperties(CharacterProperties other) {
super(other);
}
public boolean isMarkedDeleted()
{
return isFRMarkDel();
}
public void markDeleted(boolean mark)
{
super.setFRMarkDel(mark);
}
public boolean isBold()
{
return isFBold();
}
public void setBold(boolean bold)
{
super.setFBold(bold);
}
public boolean isItalic()
{
return isFItalic();
}
public void setItalic(boolean italic)
{
super.setFItalic(italic);
}
public boolean isOutlined()
{
return isFOutline();
}
public void setOutline(boolean outlined)
{
super.setFOutline(outlined);
}
public boolean isFldVanished()
{
return isFFldVanish();
}
public void setFldVanish(boolean fldVanish)
{
super.setFFldVanish(fldVanish);
}
public boolean isSmallCaps()
{
return isFSmallCaps();
}
public void setSmallCaps(boolean smallCaps)
{
super.setFSmallCaps(smallCaps);
}
public boolean isCapitalized()
{
return isFCaps();
}
public void setCapitalized(boolean caps)
{
super.setFCaps(caps);
}
public boolean isVanished()
{
return isFVanish();
}
public void setVanished(boolean vanish)
{
super.setFVanish(vanish);
}
public boolean isMarkedInserted()
{
return isFRMark();
}
public void markInserted(boolean mark)
{
super.setFRMark(mark);
}
public boolean isStrikeThrough()
{
return isFStrike();
}
public void strikeThrough(boolean strike)
{
super.setFStrike(strike);
}
public boolean isShadowed()
{
return isFShadow();
}
public void setShadow(boolean shadow)
{
super.setFShadow(shadow);
}
public boolean isEmbossed()
{
return isFEmboss();
}
public void setEmbossed(boolean emboss)
{
super.setFEmboss(emboss);
}
public boolean isImprinted()
{
return isFImprint();
}
public void setImprinted(boolean imprint)
{
super.setFImprint(imprint);
}
public boolean isDoubleStrikeThrough()
{
return isFDStrike();
}
public void setDoubleStrikeThrough(boolean dstrike)
{
super.setFDStrike(dstrike);
}
public int getFontSize()
{
return getHps();
}
public void setFontSize(int halfPoints)
{
super.setHps(halfPoints);
}
public int getCharacterSpacing()
{
return getDxaSpace();
}
public void setCharacterSpacing(int twips)
{
super.setDxaSpace(twips);
}
public short getSubSuperScriptIndex()
{
return getIss();
}
public void setSubSuperScriptIndex(short iss)
{
super.setDxaSpace(iss);
}
public int getUnderlineCode()
{
return super.getKul();
}
public void setUnderlineCode(int kul)
{
super.setKul((byte)kul);
}
public int getColor()
{
return super.getIco();
}
public void setColor(int color)
{
super.setIco((byte)color);
}
public int getVerticalOffset()
{
return super.getHpsPos();
}
public void setVerticalOffset(int hpsPos)
{
super.setHpsPos((short) hpsPos);
}
public int getKerning()
{
return super.getHpsKern();
}
public void setKerning(int kern)
{
super.setHpsKern(kern);
}
public boolean isHighlighted()
{
return super.isFHighlight();
}
public void setHighlighted(byte color)
{
super.setIcoHighlight(color);
}
/**
* Get the ico24 field for the CHP record.
*/
public int getIco24()
{
if ( !getCv().isEmpty() )
return getCv().getValue();
// convert word 97 colour numbers to 0xBBRRGGRR value
switch ( getIco() )
{
case 0: // auto
return -1;
case 1: // black
return 0x00000000;
case 2: // blue
return 0x00FF0000;
case 3: // cyan
return 0x00FFFF00;
case 4: // green
return 0x0000FF00;
case 5: // magenta
return 0x00FF00FF;
case 6: // red
return 0x000000FF;
case 7: // yellow
return 0x0000FFFF;
case 8: // white
return 0x00FFFFFF;
case 9: // dark blue
return 0x00800000;
case 10: // dark cyan
return 0x00808000;
case 11: // dark green
return 0x00008000;
case 12: // dark magenta
return 0x00800080;
case 13: // dark red
return 0x00000080;
case 14: // dark yellow
return 0x00008080;
case 15: // dark grey
return 0x00808080;
case 16: // light grey
return 0x00C0C0C0;
}
return -1;
}
/**
* Set the ico24 field for the CHP record.
*/
public void setIco24( int colour24 )
{
setCv( new Colorref( colour24 & 0xFFFFFF ) );
}
@Override
public CharacterProperties copy() {
return new CharacterProperties(this);
}
}
|