1 // Copyright 2014 PDFium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6
7 #ifndef FXFA_OBJECTACC_H_
8 #define FXFA_OBJECTACC_H_
9
10 #include "core/include/fxge/fx_dib.h" // For FX_ARGB.
11
12 class CXFA_Node;
13 class IFX_Locale;
14 class CXFA_Data;
15 class CXFA_Font;
16 class CXFA_Fill;
17 class CXFA_Margin;
18 class CXFA_Caption;
19 class CXFA_Para;
20 class CXFA_Event;
21 class CXFA_Script;
22 class CXFA_Value;
23 class CXFA_Calculate;
24 class CXFA_Line;
25 class CXFA_Text;
26 class CXFA_ExData;
27 class CXFA_Image;
28 class CXFA_Validate;
29 class CXFA_Variables;
30 class CXFA_Bind;
31 class CXFA_Assist;
32 class CXFA_ToolTip;
33 class CXFA_Keep;
34 class CXFA_Submit;
35 class CXFA_BindItems;
36 class CXFA_Stroke;
37 class CXFA_Corner;
38 class CXFA_Edge;
39 class CXFA_Box;
40 class CXFA_Arc;
41 class CXFA_Border;
42 class CXFA_Rectangle;
43 class CXFA_WidgetData;
44 class CXFA_Occur;
45 class CXFA_Filter;
46 class CXFA_Certificate;
47 class CXFA_WrapCertificate;
48 class CXFA_Oids;
49 class CXFA_SubjectDNs;
50 class CXFA_DigestMethods;
51 class CXFA_Encodings;
52 class CXFA_EncryptionMethods;
53 class CXFA_Reasons;
54 class CXFA_Manifest;
XFA_IsSpace(FX_WCHAR c)55 inline FX_BOOL XFA_IsSpace(FX_WCHAR c) {
56 return (c == 0x20) || (c == 0x0d) || (c == 0x0a) || (c == 0x09);
57 }
XFA_IsDigit(FX_WCHAR c)58 inline FX_BOOL XFA_IsDigit(FX_WCHAR c) {
59 return c >= '0' && c <= '9';
60 }
61 typedef CFX_ArrayTemplate<CXFA_Node*> CXFA_NodeArray;
62 typedef CFX_ArrayTemplate<CXFA_Object*> CXFA_ObjArray;
63 class CXFA_Data {
64 public:
CXFA_Data(CXFA_Node * pNode)65 CXFA_Data(CXFA_Node* pNode) : m_pNode(pNode) {}
66 operator CXFA_Node*() const { return m_pNode; }
GetNode()67 CXFA_Node* GetNode() { return m_pNode; }
68
IsExistInXML()69 FX_BOOL IsExistInXML() const { return m_pNode != NULL; }
70
71 XFA_ELEMENT GetClassID() const;
72
73 protected:
74 FX_BOOL TryMeasure(XFA_ATTRIBUTE eAttr,
75 FX_FLOAT& fValue,
76 FX_BOOL bUseDefault = FALSE) const;
77 FX_BOOL SetMeasure(XFA_ATTRIBUTE eAttr, FX_FLOAT fValue);
78 CXFA_Node* m_pNode;
79 };
80 class CXFA_Fill : public CXFA_Data {
81 public:
82 CXFA_Fill(CXFA_Node* pNode);
83 ~CXFA_Fill();
84
85 int32_t GetPresence();
86
87 FX_ARGB GetColor(FX_BOOL bText = FALSE);
88
89 void SetColor(FX_ARGB color);
90
91 int32_t GetFillType();
92
93 int32_t GetPattern(FX_ARGB& foreColor);
94
95 int32_t GetStipple(FX_ARGB& stippleColor);
96
97 int32_t GetLinear(FX_ARGB& endColor);
98
99 int32_t GetRadial(FX_ARGB& endColor);
100 FX_BOOL SetPresence(int32_t iPresence);
101 FX_BOOL SetFillType(int32_t iType);
102 FX_BOOL SetPattern(int32_t iPattern, FX_ARGB foreColor);
103 FX_BOOL SetStipple(int32_t iStipple, FX_ARGB stippleColor);
104 FX_BOOL SetLinear(int32_t iLinear, FX_ARGB endColor);
105 FX_BOOL SetRadial(int32_t iRadial, FX_ARGB endColor);
106 };
107 class CXFA_Margin : public CXFA_Data {
108 public:
109 CXFA_Margin(CXFA_Node* pNode);
110 FX_BOOL GetLeftInset(FX_FLOAT& fInset, FX_FLOAT fDefInset = 0) const;
111 FX_BOOL GetTopInset(FX_FLOAT& fInset, FX_FLOAT fDefInset = 0) const;
112 FX_BOOL GetRightInset(FX_FLOAT& fInset, FX_FLOAT fDefInset = 0) const;
113 FX_BOOL GetBottomInset(FX_FLOAT& fInset, FX_FLOAT fDefInset = 0) const;
114 FX_BOOL SetLeftInset(FX_FLOAT fInset);
115 FX_BOOL SetTopInset(FX_FLOAT fInset);
116 FX_BOOL SetRightInset(FX_FLOAT fInset);
117 FX_BOOL SetBottomInset(FX_FLOAT fInset);
118 };
119 class CXFA_Font : public CXFA_Data {
120 public:
121 CXFA_Font(CXFA_Node* pNode);
122
123 FX_FLOAT GetBaselineShift();
124
125 FX_FLOAT GetHorizontalScale();
126
127 FX_FLOAT GetVerticalScale();
128
129 FX_FLOAT GetLetterSpacing();
130
131 int32_t GetLineThrough();
132
133 int32_t GetLineThroughPeriod();
134
135 int32_t GetOverline();
136
137 int32_t GetOverlinePeriod();
138
139 int32_t GetUnderline();
140
141 int32_t GetUnderlinePeriod();
142
143 FX_FLOAT GetFontSize();
144
145 void GetTypeface(CFX_WideStringC& wsTypeFace);
146
147 FX_BOOL IsBold();
148
149 FX_BOOL IsItalic();
150
151 FX_BOOL IsUseKerning();
152
153 FX_ARGB GetColor();
154
155 void SetColor(FX_ARGB color);
156 FX_BOOL SetBaselineShift(FX_FLOAT fBaselineShift);
157 FX_BOOL SetHorizontalScale(FX_FLOAT fHorizontalScale);
158 FX_BOOL SetVerticalScale(FX_FLOAT fVerticalScale);
159 FX_BOOL SetLetterSpacing(FX_FLOAT fLetterSpacing, XFA_UNIT eUnit);
160 FX_BOOL SetLineThrough(int32_t iLineThrough);
161 FX_BOOL SetLineThroughPeriod(int32_t iLineThroughPeriod);
162 FX_BOOL SetOverline(int32_t iOverline);
163 FX_BOOL SetOverlinePeriod(int32_t iOverlinePeriod);
164 FX_BOOL SetUnderline(int32_t iUnderline);
165 FX_BOOL SetUnderlinePeriod(int32_t iUnderlinePeriod);
166 };
167 class CXFA_Caption : public CXFA_Data {
168 public:
169 CXFA_Caption(CXFA_Node* pNode);
170
171 int32_t GetPresence();
172
173 int32_t GetPlacementType();
174
175 FX_FLOAT GetReserve();
176
177 CXFA_Margin GetMargin();
178
179 CXFA_Font GetFont();
180
181 CXFA_Value GetValue();
182
183 CXFA_Para GetPara();
184 FX_BOOL SetPresence(int32_t iPresence);
185 FX_BOOL SetPlacementType(int32_t iType);
186 FX_BOOL SetReserve(FX_FLOAT fReserve);
187 };
188 class CXFA_Para : public CXFA_Data {
189 public:
190 CXFA_Para(CXFA_Node* pNode);
191
192 int32_t GetHorizontalAlign();
193
194 int32_t GetVerticalAlign();
195
196 FX_FLOAT GetLineHeight();
197 FX_FLOAT GetMarginLeft();
198 FX_FLOAT GetMarginRight();
199 int32_t GetOrphans();
200 FX_FLOAT GetRadixOffset();
201 FX_FLOAT GetSpaceAbove();
202 FX_FLOAT GetSpaceBelow();
203 FX_FLOAT GetTextIndent();
204 int32_t GetWidows();
205 FX_BOOL SetHorizontalAlign(int32_t iHorizontalAlign);
206 FX_BOOL SetVerticalAlign(int32_t iVerticalAlign);
207 FX_BOOL SetLineHeight(FX_FLOAT fLineHeight);
208 FX_BOOL SetMarginLeft(FX_FLOAT fMarginLeft);
209 FX_BOOL SetMarginRight(FX_FLOAT fMarginRight);
210 FX_BOOL SetOrphans(int32_t iOrphans);
211 FX_BOOL SetRadixOffset(FX_FLOAT fRadixOffset);
212 FX_BOOL SetSpaceAbove(FX_FLOAT fSpaceAbove);
213 FX_BOOL SetSpaceBelow(FX_FLOAT fSpaceBelow);
214 FX_BOOL SetTextIndent(FX_FLOAT fTextIndent);
215 FX_BOOL SetWidows(int32_t iWidows);
216 };
217 class CXFA_Keep : public CXFA_Data {
218 public:
219 CXFA_Keep(CXFA_Node* pNode, CXFA_Node* pParent);
220
221 int32_t GetIntact();
222 int32_t GetNext();
223 int32_t GetPrevious();
224 FX_BOOL SetIntact(int32_t iIntact);
225 FX_BOOL SetNext(int32_t iNext);
226 FX_BOOL SetPrevious(int32_t iPrevious);
227
228 private:
229 CXFA_Node* m_pParent;
230 };
231 enum XFA_TEXTENCODING {
232 XFA_TEXTENCODING_None,
233 XFA_TEXTENCODING_Big5,
234 XFA_TEXTENCODING_FontSpecific,
235 XFA_TEXTENCODING_GBK,
236 XFA_TEXTENCODING_GB18030,
237 XFA_TEXTENCODING_GB2312,
238 XFA_TEXTENCODING_ISO8859NN,
239 XFA_TEXTENCODING_KSC5601,
240 XFA_TEXTENCODING_ShiftJIS,
241 XFA_TEXTENCODING_UCS2,
242 XFA_TEXTENCODING_UTF16,
243 XFA_TEXTENCODING_UTF8
244 };
245 class CXFA_Event : public CXFA_Data {
246 public:
247 CXFA_Event(CXFA_Node* pNode);
248
249 int32_t GetActivity();
250
251 int32_t GetEventType();
252 void GetRef(CFX_WideStringC& wsRef);
253
254 int32_t GetExecuteRunAt();
255 int32_t GetExecuteType();
256 void GetExecuteConnection(CFX_WideString& wsConnection);
257
258 CXFA_Script GetScript();
259
260 CXFA_Submit GetSubmit();
261
262 int32_t GetSignDataOperation();
263 void GetSignDataTarget(CFX_WideString& wsTarget);
264 FX_BOOL SetActivity(int32_t iActivity);
265 FX_BOOL SetEventType(int32_t iEventType);
266 FX_BOOL SetExecuteRunAt(int32_t iExecuteRunAt);
267 FX_BOOL SetExecuteType(int32_t iExecuteType);
268 FX_BOOL SetExecuteConnection(const CFX_WideString& wsConnection);
269 FX_BOOL SetSignDataOperation(int32_t iOperation);
270 FX_BOOL SetSignDataTarget(const CFX_WideString& wsTarget);
271 };
272 enum XFA_SCRIPTTYPE {
273 XFA_SCRIPTTYPE_Formcalc = 0,
274 XFA_SCRIPTTYPE_Javascript,
275 XFA_SCRIPTTYPE_Unkown,
276 };
277 class CXFA_Script : public CXFA_Data {
278 public:
279 CXFA_Script(CXFA_Node* pNode);
280 void GetBinding(CFX_WideString& wsBinding);
281
282 XFA_SCRIPTTYPE GetContentType();
283 int32_t GetRunAt();
284 void GetExpression(CFX_WideString& wsExpression);
285 FX_BOOL SetBinding(const CFX_WideString& wsBinding);
286 FX_BOOL SetContentType(XFA_SCRIPTTYPE eType);
287 FX_BOOL SetRunAt(int32_t iRunAt);
288 FX_BOOL SetExpression(const CFX_WideString& wsExpression);
289 };
290 class CXFA_Submit : public CXFA_Data {
291 public:
292 CXFA_Submit(CXFA_Node* pNode);
293 FX_BOOL IsSubmitEmbedPDF();
294 int32_t GetSubmitFormat();
295 void GetSubmitTarget(CFX_WideStringC& wsTarget);
296 XFA_TEXTENCODING GetSubmitTextEncoding();
297 void GetSubmitXDPContent(CFX_WideStringC& wsContent);
298 FX_BOOL SetSubmitFormat(int32_t iSubmitFormat);
299 FX_BOOL SetSubmitTarget(const CFX_WideString& wsTarget);
300 FX_BOOL SetSubmitTextEncoding(XFA_TEXTENCODING eTextEncoding);
301 FX_BOOL SetSubmitXDPContent(const CFX_WideString& wsContent);
302 };
303 class CXFA_Value : public CXFA_Data {
304 public:
CXFA_Value(CXFA_Node * pNode)305 CXFA_Value(CXFA_Node* pNode) : CXFA_Data(pNode) {}
306
307 XFA_ELEMENT GetChildValueClassID();
308
309 FX_BOOL GetChildValueContent(CFX_WideString& wsContent);
310 CXFA_Arc GetArc();
311 CXFA_Line GetLine();
312 CXFA_Rectangle GetRectangle();
313 CXFA_Text GetText();
314 CXFA_ExData GetExData();
315 CXFA_Image GetImage();
316 FX_BOOL SetChildValueContent(const CFX_WideString& wsContent,
317 FX_BOOL bNotify = FALSE,
318 XFA_ELEMENT iType = XFA_ELEMENT_UNKNOWN);
319 };
320 class CXFA_Line : public CXFA_Data {
321 public:
CXFA_Line(CXFA_Node * pNode)322 CXFA_Line(CXFA_Node* pNode) : CXFA_Data(pNode) {}
323 int32_t GetHand();
324 FX_BOOL GetSlop();
325 CXFA_Edge GetEdge();
326 FX_BOOL SetHand(int32_t iHand);
327 FX_BOOL SetSlop(int32_t iSlop);
328 };
329 class CXFA_Text : public CXFA_Data {
330 public:
331 CXFA_Text(CXFA_Node* pNode);
332 void GetName(CFX_WideStringC& wsName);
333 int32_t GetMaxChars();
334 void GetRid(CFX_WideStringC& wsRid);
335 void GetContent(CFX_WideString& wsText);
336 void SetContent(CFX_WideString wsText, FX_BOOL bNotify = TRUE);
337 FX_BOOL SetName(const CFX_WideString& wsName);
338 FX_BOOL SetMaxChars(int32_t iMaxChars);
339 FX_BOOL SetRid(const CFX_WideString& wsRid);
340 };
341 class CXFA_ExData : public CXFA_Data {
342 public:
343 CXFA_ExData(CXFA_Node* pNode);
344 void GetContentType(CFX_WideStringC& wsContentType);
345 void GetHref(CFX_WideStringC& wsHref);
346 int32_t GetMaxLength();
347 void GetRid(CFX_WideStringC& wsRid);
348 int32_t GetTransferEncoding();
349 void GetContent(CFX_WideString& wsText);
350 FX_BOOL SetContentType(const CFX_WideString& wsContentType);
351 FX_BOOL SetHref(const CFX_WideString& wsHref);
352 FX_BOOL SetMaxLength(int32_t iMaxLength);
353 FX_BOOL SetRid(const CFX_WideString& wsRid);
354 FX_BOOL SetTransferEncoding(int32_t iTransferEncoding);
355 FX_BOOL SetContent(const CFX_WideString& wsText,
356 FX_BOOL bNotify = FALSE,
357 FX_BOOL bScriptModify = FALSE,
358 FX_BOOL bSyncData = TRUE);
359 };
360 class CXFA_Image : public CXFA_Data {
361 public:
362 CXFA_Image(CXFA_Node* pNode, FX_BOOL bDefValue);
363 int32_t GetAspect();
364 FX_BOOL GetContentType(CFX_WideString& wsContentType);
365 FX_BOOL GetHref(CFX_WideString& wsHref);
366 int32_t GetTransferEncoding();
367 FX_BOOL GetContent(CFX_WideString& wsText);
368 FX_BOOL SetAspect(int32_t iAspect);
369 FX_BOOL SetContentType(const CFX_WideString& wsContentType);
370 FX_BOOL SetHref(const CFX_WideString& wsHref);
371 FX_BOOL SetTransferEncoding(int32_t iTransferEncoding);
372 FX_BOOL SetContent(const CFX_WideString& wsText);
373
374 protected:
375 FX_BOOL m_bDefValue;
376 };
377 class CXFA_Calculate : public CXFA_Data {
378 public:
379 CXFA_Calculate(CXFA_Node* pNode);
380
381 int32_t GetOverride();
382 CXFA_Script GetScript();
383 void GetMessageText(CFX_WideString& wsMessage);
384 FX_BOOL SetOverride(int32_t iOverride);
385 FX_BOOL SetMessageText(const CFX_WideString& wsMessage);
386 };
387 class CXFA_Validate : public CXFA_Data {
388 public:
389 CXFA_Validate(CXFA_Node* pNode);
390 int32_t GetFormatTest();
391 FX_BOOL SetFormatTest(CFX_WideString wsValue);
392 int32_t GetNullTest();
393 FX_BOOL SetNullTest(CFX_WideString wsValue);
394 int32_t GetScriptTest();
395 void GetFormatMessageText(CFX_WideString& wsMessage);
396 void SetFormatMessageText(CFX_WideString wsMessage);
397 void GetNullMessageText(CFX_WideString& wsMessage);
398 void SetNullMessageText(CFX_WideString wsMessage);
399 void GetScriptMessageText(CFX_WideString& wsMessage);
400 void SetScriptMessageText(CFX_WideString wsMessage);
401 void GetPicture(CFX_WideString& wsPicture);
402 CXFA_Script GetScript();
403
404 protected:
405 void GetMessageText(CFX_WideString& wsMessage,
406 const CFX_WideStringC& wsMessageType);
407 void SetMessageText(CFX_WideString& wsMessage,
408 const CFX_WideStringC& wsMessageType);
409 FX_BOOL SetTestValue(int32_t iType,
410 CFX_WideString& wsValue,
411 XFA_ATTRIBUTEENUM eName);
412 };
413 class CXFA_Variables : public CXFA_Data {
414 public:
415 CXFA_Variables(CXFA_Node* pNode);
416
417 int32_t CountScripts();
418 CXFA_Script GetScript(int32_t nIndex);
419 };
420 class CXFA_Bind : public CXFA_Data {
421 public:
422 CXFA_Bind(CXFA_Node* pNode);
423 int32_t GetMatch();
424 void GetRef(CFX_WideStringC& wsRef);
425 void GetPicture(CFX_WideString& wsPicture);
426 FX_BOOL SetMatch(int32_t iMatch);
427 FX_BOOL SetRef(const CFX_WideString& wsRef);
428 FX_BOOL SetPicture(const CFX_WideString& wsPicture);
429 };
430 class CXFA_Assist : public CXFA_Data {
431 public:
432 CXFA_Assist(CXFA_Node* pNode);
433
434 CXFA_ToolTip GetToolTip();
435 };
436 class CXFA_ToolTip : public CXFA_Data {
437 public:
438 CXFA_ToolTip(CXFA_Node* pNode);
439 FX_BOOL GetTip(CFX_WideString& wsTip);
440 FX_BOOL SetTip(const CFX_WideString& wsTip);
441 };
442 class CXFA_BindItems : public CXFA_Data {
443 public:
444 CXFA_BindItems(CXFA_Node* pNode);
445 void GetConnection(CFX_WideStringC& wsConnection);
446 void GetLabelRef(CFX_WideStringC& wsLabelRef);
447 void GetValueRef(CFX_WideStringC& wsValueRef);
448 void GetRef(CFX_WideStringC& wsRef);
449 FX_BOOL SetConnection(const CFX_WideString& wsConnection);
450 FX_BOOL SetLabelRef(const CFX_WideString& wsLabelRef);
451 FX_BOOL SetValueRef(const CFX_WideString& wsValueRef);
452 FX_BOOL SetRef(const CFX_WideString& wsRef);
453 };
454 #define XFA_STROKE_SAMESTYLE_NoPresence 1
455 #define XFA_STROKE_SAMESTYLE_Corner 2
456 class CXFA_Stroke : public CXFA_Data {
457 public:
CXFA_Stroke(CXFA_Node * pNode)458 CXFA_Stroke(CXFA_Node* pNode) : CXFA_Data(pNode) {}
459
IsCorner()460 FX_BOOL IsCorner() const { return GetClassID() == XFA_ELEMENT_Corner; }
461
IsEdge()462 FX_BOOL IsEdge() const { return GetClassID() == XFA_ELEMENT_Edge; }
463
464 int32_t GetPresence() const;
IsVisible()465 FX_BOOL IsVisible() const {
466 return GetPresence() == XFA_ATTRIBUTEENUM_Visible;
467 }
468
469 int32_t GetCapType() const;
470
471 int32_t GetStrokeType() const;
472
473 FX_FLOAT GetThickness() const;
474 CXFA_Measurement GetMSThickness() const;
475
476 void SetThickness(FX_FLOAT fThickness);
477 void SetMSThickness(CXFA_Measurement msThinkness);
478
479 FX_ARGB GetColor() const;
480
481 void SetColor(FX_ARGB argb);
482
483 int32_t GetJoinType() const;
484
485 FX_BOOL IsInverted() const;
486
487 FX_FLOAT GetRadius() const;
488
489 FX_BOOL SameStyles(CXFA_Stroke stroke, FX_DWORD dwFlags = 0) const;
490 };
491 class CXFA_Corner : public CXFA_Stroke {
492 public:
CXFA_Corner(CXFA_Node * pNode)493 CXFA_Corner(CXFA_Node* pNode) : CXFA_Stroke(pNode) {}
494 };
495 class CXFA_Edge : public CXFA_Stroke {
496 public:
CXFA_Edge(CXFA_Node * pNode)497 CXFA_Edge(CXFA_Node* pNode) : CXFA_Stroke(pNode) {}
498 };
499 typedef CFX_ArrayTemplate<CXFA_Stroke> CXFA_StrokeArray;
500 typedef CFX_ArrayTemplate<CXFA_Edge> CXFA_EdgeArray;
501 typedef CFX_ArrayTemplate<CXFA_Corner> CXFA_CornerArray;
502 class CXFA_Box : public CXFA_Data {
503 public:
CXFA_Box(CXFA_Node * pNode)504 CXFA_Box(CXFA_Node* pNode) : CXFA_Data(pNode) {}
505
IsArc()506 FX_BOOL IsArc() const { return GetClassID() == XFA_ELEMENT_Arc; }
507
IsBorder()508 FX_BOOL IsBorder() const { return GetClassID() == XFA_ELEMENT_Border; }
509
IsRectangle()510 FX_BOOL IsRectangle() const { return GetClassID() == XFA_ELEMENT_Rectangle; }
511
512 int32_t GetBreak() const;
513
514 int32_t GetHand() const;
515
516 int32_t GetPresence() const;
517
518 int32_t CountCorners() const;
519
520 CXFA_Corner GetCorner(int32_t nIndex) const;
521
522 int32_t CountEdges() const;
523
524 CXFA_Edge GetEdge(int32_t nIndex = 0) const;
525
526 void GetStrokes(CXFA_StrokeArray& strokes) const;
527
528 FX_BOOL IsCircular() const;
529
530 FX_BOOL GetStartAngle(FX_FLOAT& fStartAngle) const;
GetStartAngle()531 FX_FLOAT GetStartAngle() const {
532 FX_FLOAT fStartAngle;
533 GetStartAngle(fStartAngle);
534 return fStartAngle;
535 }
536
537 FX_BOOL GetSweepAngle(FX_FLOAT& fSweepAngle) const;
GetSweepAngle()538 FX_FLOAT GetSweepAngle() const {
539 FX_FLOAT fSweepAngle;
540 GetSweepAngle(fSweepAngle);
541 return fSweepAngle;
542 }
543
544 CXFA_Fill GetFill(FX_BOOL bModified = FALSE) const;
545
546 CXFA_Margin GetMargin() const;
547
548 FX_BOOL SameStyles() const;
549
550 int32_t Get3DStyle(FX_BOOL& bVisible, FX_FLOAT& fThickness) const;
551 };
552 class CXFA_Arc : public CXFA_Box {
553 public:
CXFA_Arc(CXFA_Node * pNode)554 CXFA_Arc(CXFA_Node* pNode) : CXFA_Box(pNode) {}
555 };
556 class CXFA_Border : public CXFA_Box {
557 public:
CXFA_Border(CXFA_Node * pNode)558 CXFA_Border(CXFA_Node* pNode) : CXFA_Box(pNode) {}
559 };
560 class CXFA_Rectangle : public CXFA_Box {
561 public:
CXFA_Rectangle(CXFA_Node * pNode)562 CXFA_Rectangle(CXFA_Node* pNode) : CXFA_Box(pNode) {}
563 };
564 enum XFA_CHECKSTATE {
565 XFA_CHECKSTATE_On = 0,
566 XFA_CHECKSTATE_Off = 1,
567 XFA_CHECKSTATE_Neutral = 2,
568 };
569 enum XFA_VALUEPICTURE {
570 XFA_VALUEPICTURE_Raw = 0,
571 XFA_VALUEPICTURE_Display,
572 XFA_VALUEPICTURE_Edit,
573 XFA_VALUEPICTURE_DataBind,
574 };
575 class CXFA_WidgetData : public CXFA_Data {
576 public:
577 CXFA_WidgetData(CXFA_Node* pNode);
578 CXFA_Node* GetUIChild();
579
580 XFA_ELEMENT GetUIType();
581 CFX_WideString GetRawValue();
582 int32_t GetAccess(FX_BOOL bTemplate = FALSE);
583 FX_BOOL GetAccessKey(CFX_WideStringC& wsAccessKey);
584 int32_t GetAnchorType();
585 int32_t GetColSpan();
586 int32_t GetPresence();
587 int32_t GetRotate();
588 CXFA_Border GetBorder(FX_BOOL bModified = FALSE);
589 CXFA_Caption GetCaption(FX_BOOL bModified = FALSE);
590 CXFA_Font GetFont(FX_BOOL bModified = FALSE);
591 CXFA_Margin GetMargin(FX_BOOL bModified = FALSE);
592 CXFA_Para GetPara(FX_BOOL bModified = FALSE);
593 CXFA_Keep GetKeep(FX_BOOL bModified = FALSE);
594 void GetEventList(CXFA_NodeArray& events);
595 int32_t GetEventByActivity(int32_t iActivity,
596 CXFA_NodeArray& events,
597 FX_BOOL bIsFormReady = FALSE);
598 CXFA_Value GetDefaultValue(FX_BOOL bModified = FALSE);
599 CXFA_Value GetFormValue(FX_BOOL bModified = FALSE);
600 CXFA_Calculate GetCalculate(FX_BOOL bModified = FALSE);
601 CXFA_Validate GetValidate(FX_BOOL bModified = FALSE);
602 CXFA_Variables GetVariables(FX_BOOL bModified = FALSE);
603 CXFA_Bind GetBind(FX_BOOL bModified = FALSE);
604 CXFA_Assist GetAssist(FX_BOOL bModified = FALSE);
605 void GetRelevant(CFX_WideStringC& wsRelevant);
606 FX_DWORD GetRelevantStatus();
607 FX_BOOL GetWidth(FX_FLOAT& fWidth);
608 FX_BOOL GetHeight(FX_FLOAT& fHeight);
609 FX_BOOL GetMinWidth(FX_FLOAT& fMinWidth);
610 FX_BOOL GetMinHeight(FX_FLOAT& fMinHeight);
611 FX_BOOL GetMaxWidth(FX_FLOAT& fMaxWidth);
612 FX_BOOL GetMaxHeight(FX_FLOAT& fMaxHeight);
613 CXFA_BindItems GetBindItems();
614 FX_BOOL SetAccess(int32_t iAccess, FX_BOOL bNotify = TRUE);
615 FX_BOOL SetAccessKey(const CFX_WideString& wsAccessKey);
616 FX_BOOL SetAnchorType(int32_t iType);
617 FX_BOOL SetColSpan(int32_t iColSpan);
618 FX_BOOL SetPresence(int32_t iPresence);
619 FX_BOOL SetRotate(int32_t iRotate);
620 FX_BOOL SetRelevant(const CFX_WideString& wsRelevant);
621 FX_BOOL SetStatus(FX_DWORD dwStatus);
622 FX_BOOL SetWidth(FX_FLOAT fWidth);
623 FX_BOOL SetHeight(FX_FLOAT fHeight);
624 FX_BOOL SetMinWidth(FX_FLOAT fMinWidth);
625 FX_BOOL SetMinHeight(FX_FLOAT fMinHeight);
626 FX_BOOL SetMaxWidth(FX_FLOAT fMaxWidth);
627 FX_BOOL SetMaxHeight(FX_FLOAT fMaxHeight);
628 FX_BOOL SetPos(FX_FLOAT x, FX_FLOAT y);
629 FX_BOOL SetName(const CFX_WideString& wsName);
630 FX_BOOL SetButtonHighlight(int32_t iButtonHighlight);
631 FX_BOOL SetButtonRollover(const CFX_WideString& wsRollover,
632 FX_BOOL bRichText);
633 FX_BOOL SetButtonDown(const CFX_WideString& wsDown, FX_BOOL bRichText);
634 FX_BOOL SetCheckButtonShape(int32_t iCheckButtonShape);
635 FX_BOOL SetCheckButtonMark(int32_t iCheckButtonMark);
636 FX_BOOL SetCheckButtonSize(FX_FLOAT fCheckButtonMark);
637 CXFA_Border GetUIBorder(FX_BOOL bModified = FALSE);
638 CXFA_Margin GetUIMargin(FX_BOOL bModified = FALSE);
639 void GetUIMargin(CFX_RectF& rtUIMargin);
640 int32_t GetButtonHighlight();
641 FX_BOOL GetButtonRollover(CFX_WideString& wsRollover, FX_BOOL& bRichText);
642 FX_BOOL GetButtonDown(CFX_WideString& wsDown, FX_BOOL& bRichText);
643 int32_t GetCheckButtonShape();
644 int32_t GetCheckButtonMark();
645 FX_FLOAT GetCheckButtonSize();
646 FX_BOOL IsAllowNeutral();
647 FX_BOOL IsRadioButton();
648 XFA_CHECKSTATE GetCheckState();
649 void SetCheckState(XFA_CHECKSTATE eCheckState, FX_BOOL bNotify = TRUE);
650 CXFA_Node* GetExclGroupNode();
651 CXFA_Node* GetSelectedMember();
652 CXFA_Node* SetSelectedMember(const CFX_WideStringC& wsName,
653 FX_BOOL bNotify = TRUE);
654 void SetSelectedMemberByValue(const CFX_WideStringC& wsValue,
655 FX_BOOL bNotify = TRUE,
656 FX_BOOL bScriptModify = FALSE,
657 FX_BOOL bSyncData = TRUE);
658 CXFA_Node* GetExclGroupFirstMember();
659 CXFA_Node* GetExclGroupNextMember(CXFA_Node* pNode);
660 int32_t GetChoiceListCommitOn();
661 FX_BOOL IsChoiceListAllowTextEntry();
662 int32_t GetChoiceListOpen();
663 FX_BOOL IsListBox();
664 int32_t CountChoiceListItems(FX_BOOL bSaveValue = FALSE);
665 FX_BOOL GetChoiceListItem(CFX_WideString& wsText,
666 int32_t nIndex,
667 FX_BOOL bSaveValue = FALSE);
668 void GetChoiceListItems(CFX_WideStringArray& wsTextArray,
669 FX_BOOL bSaveValue = FALSE);
670 int32_t CountSelectedItems();
671 int32_t GetSelectedItem(int32_t nIndex = 0);
672 void GetSelectedItems(CFX_Int32Array& iSelArray);
673 void GetSelectedItemsValue(CFX_WideStringArray& wsSelTextArray);
674 FX_BOOL GetItemState(int32_t nIndex);
675 void SetItemState(int32_t nIndex,
676 FX_BOOL bSelected,
677 FX_BOOL bNotify = FALSE,
678 FX_BOOL bScriptModify = FALSE,
679 FX_BOOL bSyncData = TRUE);
680 void SetSelectdItems(CFX_Int32Array& iSelArray,
681 FX_BOOL bNotify = FALSE,
682 FX_BOOL bScriptModify = FALSE,
683 FX_BOOL bSyncData = TRUE);
684 void ClearAllSelections();
685 void InsertItem(const CFX_WideString& wsLabel,
686 const CFX_WideString& wsValue,
687 int32_t nIndex = -1,
688 FX_BOOL bNotify = FALSE);
689 void GetItemLabel(const CFX_WideStringC& wsValue, CFX_WideString& wsLabel);
690 void GetItemValue(const CFX_WideStringC& wsLabel, CFX_WideString& wsValue);
691 FX_BOOL DeleteItem(int32_t nIndex,
692 FX_BOOL bNotify = FALSE,
693 FX_BOOL bScriptModify = FALSE,
694 FX_BOOL bSyncData = TRUE);
695 int32_t GetHorizontalScrollPolicy();
696 int32_t GetNumberOfCells();
697 FX_BOOL IsDateTimeEditUsePicker();
698 FX_BOOL SetValue(const CFX_WideString& wsValue, XFA_VALUEPICTURE eValueType);
699 FX_BOOL GetPictureContent(CFX_WideString& wsPicture,
700 XFA_VALUEPICTURE ePicture);
701 IFX_Locale* GetLocal();
702 FX_BOOL GetValue(CFX_WideString& wsValue, XFA_VALUEPICTURE eValueType);
703 FX_BOOL GetNormalizeDataValue(const CFX_WideStringC& wsValue,
704 CFX_WideString& wsNormalizeValue);
705 FX_BOOL GetFormatDataValue(const CFX_WideStringC& wsValue,
706 CFX_WideString& wsFormatedValue);
707 void NormalizeNumStr(const CFX_WideString& wsValue, CFX_WideString& wsOutput);
708 CFX_WideString GetBarcodeType();
709 FX_BOOL GetBarcodeAttribute_CharEncoding(int32_t& val);
710 FX_BOOL GetBarcodeAttribute_Checksum(int32_t& val);
711 FX_BOOL GetBarcodeAttribute_DataLength(int32_t& val);
712 FX_BOOL GetBarcodeAttribute_StartChar(FX_CHAR& val);
713 FX_BOOL GetBarcodeAttribute_EndChar(FX_CHAR& val);
714 FX_BOOL GetBarcodeAttribute_ECLevel(int32_t& val);
715 FX_BOOL GetBarcodeAttribute_ModuleWidth(int32_t& val);
716 FX_BOOL GetBarcodeAttribute_ModuleHeight(int32_t& val);
717 FX_BOOL GetBarcodeAttribute_PrintChecksum(FX_BOOL& val);
718 FX_BOOL GetBarcodeAttribute_TextLocation(int32_t& val);
719 FX_BOOL GetBarcodeAttribute_Truncate(FX_BOOL& val);
720 FX_BOOL GetBarcodeAttribute_WideNarrowRatio(FX_FLOAT& val);
721 void GetPasswordChar(CFX_WideString& wsPassWord);
722 FX_BOOL IsAllowRichText();
723 FX_BOOL IsMultiLine();
724 int32_t GetVerticalScrollPolicy();
725 int32_t GetMaxChars(XFA_ELEMENT& eType);
726 FX_BOOL GetFracDigits(int32_t& iFracDigits);
727 FX_BOOL GetLeadDigits(int32_t& iLeadDigits);
728 CXFA_Filter GetFilter(FX_BOOL bModified = FALSE);
729 CXFA_Manifest GetManifest(FX_BOOL bModified = FALSE);
730
731 FX_BOOL m_bIsNull;
732 FX_BOOL m_bPreNull;
733
734 protected:
735 void SyncValue(const CFX_WideString& wsValue, FX_BOOL bNotify);
736 void InsertListTextItem(CXFA_Node* pItems,
737 const CFX_WideStringC& wsText,
738 int32_t nIndex = -1);
739 void FormatNumStr(const CFX_WideString& wsValue,
740 IFX_Locale* pLocale,
741 CFX_WideString& wsOutput);
742
743 CXFA_Node* m_pUiChildNode;
744 XFA_ELEMENT m_eUIType;
745 };
746 class CXFA_Occur : public CXFA_Data {
747 public:
748 CXFA_Occur(CXFA_Node* pNode);
749 int32_t GetMax();
750 int32_t GetMin();
751 int32_t GetInitial();
752 FX_BOOL GetOccurInfo(int32_t& iMin, int32_t& iMax, int32_t& iInit);
753 void SetMax(int32_t iMax);
754 void SetMin(int32_t iMin);
755 };
756 class CXFA_Filter : public CXFA_Data {
757 public:
CXFA_Filter(CXFA_Node * pNode)758 CXFA_Filter(CXFA_Node* pNode) : CXFA_Data(pNode) {}
759 CFX_WideString GetFilterString(XFA_ATTRIBUTE eAttribute);
760 XFA_ATTRIBUTEENUM GetAppearanceFilterType();
761 CFX_WideString GetAppearanceFilterContent();
762 XFA_ATTRIBUTEENUM GetCertificatesCredentialServerPolicy();
763 CFX_WideString GetCertificatesURL();
764 CFX_WideString GetCertificatesURLPolicy();
765 CXFA_WrapCertificate GetCertificatesEncryption(FX_BOOL bModified = FALSE);
766 CXFA_WrapCertificate GetCertificatesIssuers(FX_BOOL bModified = FALSE);
767 CFX_WideString GetCertificatesKeyUsageString(XFA_ATTRIBUTE eAttribute);
768 CXFA_Oids GetCertificatesOids();
769 CXFA_WrapCertificate GetCertificatesSigning(FX_BOOL bModified = FALSE);
770 CXFA_DigestMethods GetDigestMethods(FX_BOOL bModified = FALSE);
771 CXFA_Encodings GetEncodings(FX_BOOL bModified = FALSE);
772 CXFA_EncryptionMethods GetEncryptionMethods(FX_BOOL bModified = FALSE);
773 XFA_ATTRIBUTEENUM GetHandlerType();
774 CFX_WideString GetHandlerContent();
775 XFA_ATTRIBUTEENUM GetlockDocumentType();
776 CFX_WideString GetlockDocumentContent();
777 int32_t GetMDPPermissions();
778 XFA_ATTRIBUTEENUM GetMDPSignatureType();
779
780 CXFA_Reasons GetReasons(FX_BOOL bModified = FALSE);
781 CFX_WideString GetTimeStampServer();
782 XFA_ATTRIBUTEENUM GetTimeStampType();
783 };
784 class CXFA_Certificate : public CXFA_Data {
785 public:
CXFA_Certificate(CXFA_Node * pNode)786 CXFA_Certificate(CXFA_Node* pNode) : CXFA_Data(pNode) {}
787 CFX_WideString GetCertificateName();
788 CFX_WideString GetCertificateContent();
789 };
790 class CXFA_WrapCertificate : public CXFA_Data {
791 public:
CXFA_WrapCertificate(CXFA_Node * pNode)792 CXFA_WrapCertificate(CXFA_Node* pNode) : CXFA_Data(pNode) {}
793 XFA_ATTRIBUTEENUM GetType();
794 int32_t CountCertificates();
795 CXFA_Certificate GetCertificate(int32_t nIndex);
796 };
797 class CXFA_Oids : public CXFA_Data {
798 public:
CXFA_Oids(CXFA_Node * pNode)799 CXFA_Oids(CXFA_Node* pNode) : CXFA_Data(pNode) {}
800 XFA_ATTRIBUTEENUM GetOidsType();
801 int32_t CountOids();
802 CFX_WideString GetOidContent(int32_t nIndex);
803 };
804 class CXFA_SubjectDNs : public CXFA_Data {
805 public:
CXFA_SubjectDNs(CXFA_Node * pNode)806 CXFA_SubjectDNs(CXFA_Node* pNode) : CXFA_Data(pNode) {}
807 XFA_ATTRIBUTEENUM GetSubjectDNsType();
808 int32_t CountSubjectDNs();
809 CFX_WideString GetSubjectDNString(int32_t nIndex, XFA_ATTRIBUTE eAttribute);
810 CFX_WideString GetSubjectDNContent(int32_t nIndex);
811 };
812 class CXFA_DigestMethods : public CXFA_Data {
813 public:
CXFA_DigestMethods(CXFA_Node * pNode)814 CXFA_DigestMethods(CXFA_Node* pNode) : CXFA_Data(pNode) {}
815 XFA_ATTRIBUTEENUM GetDigestMethodsType();
816 int32_t CountDigestMethods();
817 CFX_WideString GetDigestMethodContent(int32_t nIndex);
818 };
819 class CXFA_Encodings : public CXFA_Data {
820 public:
CXFA_Encodings(CXFA_Node * pNode)821 CXFA_Encodings(CXFA_Node* pNode) : CXFA_Data(pNode) {}
822 XFA_ATTRIBUTEENUM GetEncodingsType();
823 int32_t CountEncodings();
824 CFX_WideString GetEncodingContent(int32_t nIndex);
825 };
826 class CXFA_EncryptionMethods : public CXFA_Data {
827 public:
CXFA_EncryptionMethods(CXFA_Node * pNode)828 CXFA_EncryptionMethods(CXFA_Node* pNode) : CXFA_Data(pNode) {}
829 XFA_ATTRIBUTEENUM GetEncryptionMethodsType();
830 int32_t CountEncryptionMethods();
831 CFX_WideString GetEncryptionMethodContent(int32_t nIndex);
832 };
833 class CXFA_Reasons : public CXFA_Data {
834 public:
CXFA_Reasons(CXFA_Node * pNode)835 CXFA_Reasons(CXFA_Node* pNode) : CXFA_Data(pNode) {}
836 XFA_ATTRIBUTEENUM GetReasonsType();
837 int32_t CountReasons();
838 CFX_WideString GetReasonContent(int32_t nIndex);
839 };
840 class CXFA_Manifest : public CXFA_Data {
841 public:
CXFA_Manifest(CXFA_Node * pNode)842 CXFA_Manifest(CXFA_Node* pNode) : CXFA_Data(pNode) {}
843 XFA_ATTRIBUTEENUM GetAction();
844 int32_t CountReives();
845 CFX_WideString GetRefContent(int32_t nIndex);
846 };
847
848 #endif // FXFA_OBJECTACC_H_
849