FX_BOOL considered harmful, part 2.
[pdfium.git] / core / include / fpdfdoc / fpdf_doc.h
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 CORE_INCLUDE_FPDFDOC_FPDF_DOC_H_
8 #define CORE_INCLUDE_FPDFDOC_FPDF_DOC_H_
9
10 #include <map>
11
12 #include "../fpdfapi/fpdf_parser.h"
13 #include "../fpdfapi/fpdf_render.h"
14
15 class CFieldTree;
16 class CPDF_AAction;
17 class CPDF_Action;
18 class CPDF_ActionFields;
19 class CPDF_Annot;
20 class CPDF_AnnotList;
21 class CPDF_ApSettings;
22 class CPDF_Bookmark;
23 class CPDF_BookmarkTree;
24 class CPDF_DefaultAppearance;
25 class CPDF_Dest;
26 class CPDF_DocJSActions;
27 class CPDF_FileSpec;
28 class CPDF_FormControl;
29 class CPDF_FormField;
30 class CPDF_FormNotify;
31 class CPDF_IconFit;
32 class CPDF_InterForm;
33 class CPDF_Link;
34 class CPDF_LinkList;
35 class CPDF_LWinParam;
36 class CPDF_Metadata;
37 class CPDF_NumberTree;
38 class CPDF_OCContext;
39 class CPDF_Page;
40 class CPDF_RenderOptions;
41 class CPDF_TextObject;
42 class CPDF_ViewerPreferences;
43 class CXML_Element;
44
45 class CPDF_NameTree
46 {
47 public:
48
49     CPDF_NameTree(CPDF_Dictionary* pRoot)
50     {
51         m_pRoot = pRoot;
52     }
53
54     CPDF_NameTree(CPDF_Document* pDoc, const CFX_ByteStringC& category);
55
56     CPDF_Object*                LookupValue(int nIndex, CFX_ByteString& csName) const;
57
58     CPDF_Object*                LookupValue(const CFX_ByteString& csName) const;
59
60     CPDF_Array*                 LookupNamedDest(CPDF_Document* pDoc, const CFX_ByteStringC& sName);
61
62     int                                 GetIndex(const CFX_ByteString& csName) const;
63
64     int                                 GetCount() const;
65
66
67     CPDF_Dictionary*    GetRoot() const
68     {
69         return m_pRoot;
70     }
71
72 protected:
73
74     CPDF_Dictionary*            m_pRoot;
75 };
76 class CPDF_BookmarkTree
77 {
78 public:
79     CPDF_BookmarkTree(CPDF_Document* pDoc) : m_pDocument(pDoc) {}
80
81     CPDF_Bookmark               GetFirstChild(const CPDF_Bookmark& parent) const;
82
83     CPDF_Bookmark               GetNextSibling(const CPDF_Bookmark& bookmark) const;
84
85     CPDF_Document*              GetDocument() const { return m_pDocument; }
86
87 protected:
88     CPDF_Document*              m_pDocument;
89 };
90 #define PDFBOOKMARK_ITALIC                      1
91 #define PDFBOOKMARK_BOLD                        2
92 class CPDF_Bookmark
93 {
94 public:
95
96     CPDF_Bookmark() : m_pDict(NULL) {}
97
98     explicit CPDF_Bookmark(CPDF_Dictionary* pDict) : m_pDict(pDict) {}
99
100     CPDF_Dictionary* GetDict() const { return m_pDict; }
101
102     operator bool() const { return m_pDict != NULL; }
103
104     FX_DWORD                    GetColorRef() const;
105
106     FX_DWORD                    GetFontStyle() const;
107
108     CFX_WideString              GetTitle() const;
109
110     CPDF_Dest                   GetDest(CPDF_Document* pDocument) const;
111
112     CPDF_Action                 GetAction() const;
113
114     CPDF_Dictionary*    m_pDict;
115 };
116 #define PDFZOOM_XYZ                                     1
117 #define PDFZOOM_FITPAGE                         2
118 #define PDFZOOM_FITHORZ                         3
119 #define PDFZOOM_FITVERT                         4
120 #define PDFZOOM_FITRECT                         5
121 #define PDFZOOM_FITBBOX                         6
122 #define PDFZOOM_FITBHORZ                        7
123 #define PDFZOOM_FITBVERT                        8
124 class CPDF_Dest
125 {
126 public:
127     CPDF_Dest() : m_pObj(nullptr) { }
128     explicit CPDF_Dest(CPDF_Object* pObj) : m_pObj(pObj) { }
129
130     operator bool () const { return m_pObj != NULL; }
131     CPDF_Object* GetObject() const { return m_pObj; }
132
133     CFX_ByteString              GetRemoteName();
134     int                                 GetPageIndex(CPDF_Document* pDoc);
135     FX_DWORD                    GetPageObjNum();
136     int                                 GetZoomMode();
137     FX_FLOAT                    GetParam(int index);
138
139 protected:
140     CPDF_Object*                m_pObj;
141 };
142 class CPDF_OCContext : public IPDF_OCContext
143 {
144 public:
145
146     enum UsageType {
147         View = 0,
148         Design,
149         Print,
150         Export
151     };
152
153     CPDF_OCContext(CPDF_Document *pDoc, UsageType eUsageType = View);
154
155     virtual ~CPDF_OCContext();
156
157     CPDF_Document*      GetDocument() const
158     {
159         return m_pDocument;
160     }
161
162     UsageType           GetUsageType() const
163     {
164         return m_eUsageType;
165     }
166
167     bool                        CheckOCGVisible(const CPDF_Dictionary *pOCGDict);
168
169     void                        ResetOCContext();
170 protected:
171
172     bool                        LoadOCGStateFromConfig(const CFX_ByteStringC& csConfig, const CPDF_Dictionary *pOCGDict, bool &bValidConfig) const;
173
174     bool                        LoadOCGState(const CPDF_Dictionary *pOCGDict) const;
175
176     bool                        GetOCGVisible(const CPDF_Dictionary *pOCGDict);
177
178     bool                        GetOCGVE(CPDF_Array *pExpression, bool bFromConfig, int nLevel = 0);
179
180     bool                        LoadOCMDState(const CPDF_Dictionary *pOCMDDict, bool bFromConfig);
181
182     CPDF_Document               *m_pDocument;
183
184     UsageType                   m_eUsageType;
185
186     std::map<const CPDF_Dictionary*, bool> m_OCGStates;
187 };
188 class CPDF_LWinParam
189 {
190 public:
191
192     CPDF_LWinParam(CPDF_Dictionary* pDict)
193     {
194         m_pDict = pDict;
195     }
196
197     operator CPDF_Dictionary* () const
198     {
199         return m_pDict;
200     }
201
202     inline CFX_ByteString       GetFileName()
203     {
204         return m_pDict->GetString("F");
205     }
206
207
208     inline CFX_ByteString       GetDefaultDirectory()
209     {
210         return m_pDict->GetString("D");
211     }
212
213
214     inline CFX_ByteString       GetOperation()
215     {
216         return m_pDict->GetString("O");
217     }
218
219
220     inline CFX_ByteString       GetParameter()
221     {
222         return m_pDict->GetString("P");
223     }
224
225     CPDF_Dictionary*            m_pDict;
226 };
227 class CPDF_ActionFields
228 {
229 public:
230
231     CPDF_ActionFields(const CPDF_Action* pAction)
232     {
233         m_pAction = (CPDF_Action*)pAction;
234     }
235
236     operator CPDF_Action*() const
237     {
238         return m_pAction;
239     }
240
241     FX_DWORD                            GetFieldsCount() const;
242
243     void                                        GetAllFields(CFX_PtrArray& fieldObjects) const;
244
245     CPDF_Object*                        GetField(FX_DWORD iIndex) const;
246
247     CPDF_Action*                        m_pAction;
248 };
249
250 #define PDFNAMED_NEXTPAGE               1
251 #define PDFNAMED_PREVPAGE               2
252 #define PDFNAMED_FIRSTPAGE              3
253 #define PDFNAMED_LASTPAGE               4
254 #define PDFJS_MAXLENGTH                 64
255 class CPDF_Action
256 {
257 public:
258     enum ActionType {
259         Unknown = 0,
260         GoTo,
261         GoToR,
262         GoToE,
263         Launch,
264         Thread,
265         URI,
266         Sound,
267         Movie,
268         Hide,
269         Named,
270         SubmitForm,
271         ResetForm,
272         ImportData,
273         JavaScript,
274         SetOCGState,
275         Rendition,
276         Trans,
277         GoTo3DView
278     };
279
280     CPDF_Action() : m_pDict(nullptr) { }
281     explicit CPDF_Action(CPDF_Dictionary* pDict) : m_pDict(pDict) { }
282
283     operator bool () const { return m_pDict != NULL; }
284
285     CPDF_Dictionary* GetDict() const { return m_pDict; }
286
287     CFX_ByteString              GetTypeName() const
288     {
289         return m_pDict->GetString("S");
290     }
291
292     ActionType                  GetType() const;
293
294     CPDF_Dest                   GetDest(CPDF_Document* pDoc) const;
295
296     CFX_WideString              GetFilePath() const;
297
298     bool                                GetNewWindow() const
299     {
300         return m_pDict->GetBoolean("NewWindow");
301     }
302
303     CPDF_LWinParam              GetWinParam() const;
304
305     CFX_ByteString              GetURI(CPDF_Document* pDoc) const;
306
307     bool                                GetMouseMap() const
308     {
309         return m_pDict->GetBoolean("IsMap");
310     }
311
312     CPDF_ActionFields   GetWidgets() const
313     {
314         return this;
315     }
316
317     bool                                GetHideStatus() const
318     {
319         return m_pDict->GetBoolean("H", true);
320     }
321
322     CFX_ByteString              GetNamedAction() const
323     {
324         return m_pDict->GetString("N");
325     }
326
327     FX_DWORD                    GetFlags() const
328     {
329         return m_pDict->GetInteger("Flags");
330     }
331
332     CFX_WideString              GetJavaScript() const;
333
334     CPDF_Dictionary*    GetAnnot() const;
335
336     int32_t                             GetOperationType() const;
337
338     CPDF_Stream*                GetSoundStream() const
339     {
340         return m_pDict->GetStream("Sound");
341     }
342
343     FX_FLOAT                    GetVolume() const
344     {
345         return m_pDict->GetNumber("Volume");
346     }
347
348     bool                                IsSynchronous() const
349     {
350         return m_pDict->GetBoolean("Synchronous");
351     }
352
353     bool                                IsRepeat() const
354     {
355         return m_pDict->GetBoolean("Repeat");
356     }
357
358     bool                                IsMixPlay() const
359     {
360         return m_pDict->GetBoolean("Mix");
361     }
362
363     FX_DWORD                    GetSubActionsCount() const;
364
365     CPDF_Action                 GetSubAction(FX_DWORD iIndex) const;
366
367 protected:
368     CPDF_Dictionary*    m_pDict;
369 };
370 class CPDF_AAction
371 {
372 public:
373
374     CPDF_AAction(CPDF_Dictionary* pDict = NULL)
375     {
376         m_pDict = pDict;
377     }
378
379     operator CPDF_Dictionary*() const
380     {
381         return m_pDict;
382     }
383
384     enum AActionType {
385         CursorEnter = 0,
386         CursorExit,
387         ButtonDown,
388         ButtonUp,
389         GetFocus,
390         LoseFocus,
391         PageOpen,
392         PageClose,
393         PageVisible,
394         PageInvisible,
395         OpenPage,
396         ClosePage,
397         KeyStroke,
398         Format,
399         Validate,
400         Calculate,
401         CloseDocument,
402         SaveDocument,
403         DocumentSaved,
404         PrintDocument,
405         DocumentPrinted
406     };
407
408     bool                                ActionExist(AActionType eType) const;
409
410     CPDF_Action                 GetAction(AActionType eType) const;
411
412     FX_POSITION                 GetStartPos() const;
413
414     CPDF_Action                 GetNextAction(FX_POSITION& pos, AActionType& eType) const;
415
416     CPDF_Dictionary*    m_pDict;
417 };
418 class CPDF_DocJSActions
419 {
420 public:
421     CPDF_DocJSActions(CPDF_Document* pDoc);
422
423
424     int                                 CountJSActions() const;
425
426     CPDF_Action                 GetJSAction(int index, CFX_ByteString& csName) const;
427
428     CPDF_Action                 GetJSAction(const CFX_ByteString& csName) const;
429
430     int                                 FindJSAction(const CFX_ByteString& csName) const;
431
432
433     CPDF_Document*              GetDocument() const
434     {
435         return m_pDocument;
436     }
437
438 protected:
439
440     CPDF_Document*              m_pDocument;
441 };
442 class CPDF_FileSpec
443 {
444 public:
445
446     CPDF_FileSpec();
447
448     CPDF_FileSpec(CPDF_Object *pObj)
449     {
450         m_pObj = pObj;
451     }
452
453     operator CPDF_Object*() const
454     {
455         return m_pObj;
456     }
457
458     bool                        IsURL() const;
459
460     bool                        GetFileName(CFX_WideString &wsFileName) const;
461
462     CPDF_Stream*        GetFileStream() const;
463
464     void                        SetFileName(const CFX_WideStringC& wsFileName, bool bURL = false);
465 protected:
466
467     CPDF_Object         *m_pObj;
468 };
469 class CPDF_LinkList
470 {
471 public:
472
473     CPDF_LinkList(CPDF_Document* pDoc)
474     {
475         m_pDocument = pDoc;
476     }
477
478     ~CPDF_LinkList();
479
480     CPDF_Link                   GetLinkAtPoint(CPDF_Page* pPage, FX_FLOAT pdf_x, FX_FLOAT pdf_y);
481
482     int                                 CountLinks(CPDF_Page* pPage);
483
484     CPDF_Link                   GetLink(CPDF_Page* pPage, int index);
485
486     CPDF_Document*              GetDocument() const
487     {
488         return m_pDocument;
489     }
490 protected:
491
492     CPDF_Document*              m_pDocument;
493
494     CFX_MapPtrToPtr             m_PageMap;
495
496     CFX_PtrArray*               GetPageLinks(CPDF_Page* pPage);
497
498     void                                LoadPageLinks(CPDF_Page* pPage, CFX_PtrArray* pList);
499 };
500 class CPDF_Link
501 {
502 public:
503     CPDF_Link() : m_pDict(nullptr) { }
504     explicit CPDF_Link(CPDF_Dictionary* pDict) : m_pDict(pDict) { }
505
506     CPDF_Dictionary* GetDict() const { return m_pDict; }
507
508     CFX_FloatRect               GetRect();
509     CPDF_Dest                   GetDest(CPDF_Document* pDoc);
510     CPDF_Action                 GetAction();
511
512 protected:
513     CPDF_Dictionary*    m_pDict;
514 };
515
516 #define ANNOTFLAG_INVISIBLE     0x0001
517 #define ANNOTFLAG_HIDDEN        0x0002
518 #define ANNOTFLAG_PRINT         0x0004
519 #define ANNOTFLAG_NOZOOM        0x0008
520 #define ANNOTFLAG_NOROTATE      0x0010
521 #define ANNOTFLAG_NOVIEW        0x0020
522 #define ANNOTFLAG_READONLY      0x0040
523 #define ANNOTFLAG_LOCKED        0x0080
524 #define ANNOTFLAG_TOGGLENOVIEW  0x0100
525
526 class CPDF_Annot : public CFX_PrivateData
527 {
528   public:
529     enum AppearanceMode {
530         Normal,
531         Rollover,
532         Down
533     };
534
535     CPDF_Annot(CPDF_Dictionary* pDict, CPDF_AnnotList* pList);
536     ~CPDF_Annot();
537
538     CFX_ByteString GetSubType() const;
539
540     FX_DWORD GetFlags() const;
541
542     void GetRect(CFX_FloatRect& rect) const;
543
544     CPDF_Dictionary* GetAnnotDict();
545
546     bool DrawAppearance(const CPDF_Page* pPage,
547                            CFX_RenderDevice* pDevice,
548                            const CFX_AffineMatrix* pUser2Device,
549                            AppearanceMode mode,
550                            const CPDF_RenderOptions* pOptions);
551
552     bool DrawInContext(const CPDF_Page* pPage,
553                           const CPDF_RenderContext* pContext,
554                           const CFX_AffineMatrix* pUser2Device,
555                           AppearanceMode mode);
556
557     void ClearCachedAP();
558
559     void DrawBorder(CFX_RenderDevice* pDevice,
560                     const CFX_AffineMatrix* pUser2Device,
561                     const CPDF_RenderOptions* pOptions);
562
563     CPDF_Form* GetAPForm(const CPDF_Page* pPage, AppearanceMode mode);
564
565   private:
566     CPDF_Dictionary* const m_pAnnotDict;
567
568     CPDF_AnnotList* const m_pList;
569
570     const CFX_ByteString m_sSubtype;
571
572     CFX_MapPtrToPtr m_APMap;
573 };
574
575 class CPDF_AnnotList
576 {
577 public:
578
579     CPDF_AnnotList(CPDF_Page* pPage);
580
581     ~CPDF_AnnotList();
582
583     void        GetAnnotMatrix(const CPDF_Dictionary* pAnnotDict, const CFX_Matrix* pUser2Device, CFX_Matrix &matrix) const;
584
585     void        GetAnnotRect(const CPDF_Dictionary* pAnnotDict, const CFX_Matrix* pUser2Device, CPDF_Rect &rtAnnot) const;
586
587     void                                DisplayAnnots(const CPDF_Page* pPage, CFX_RenderDevice* pDevice,
588                                       CFX_AffineMatrix* pMatrix, bool bShowWidget,
589                                       CPDF_RenderOptions* pOptions);
590
591     void                                DisplayAnnots(const CPDF_Page* pPage, CPDF_RenderContext* pContext,
592                                       bool bPrinting, CFX_AffineMatrix* pMatrix, bool bShowWidget,
593                                       CPDF_RenderOptions* pOptions)
594     {
595         DisplayAnnots(pPage, NULL, pContext, bPrinting, pMatrix, bShowWidget ? 3 : 1, pOptions, NULL);
596     }
597
598     void                                DisplayAnnots(const CPDF_Page* pPage, CPDF_RenderContext* pContext,
599                                       bool bPrinting, CFX_AffineMatrix* pMatrix, bool bShowWidget,
600                                       CPDF_RenderOptions* pOptions, FX_RECT *pClipRect)
601     {
602         DisplayAnnots(pPage, NULL, pContext, bPrinting, pMatrix, bShowWidget ? 3 : 1, pOptions, pClipRect);
603     }
604
605     void                                DisplayAnnots(const CPDF_Page* pPage, CFX_RenderDevice* pDevice, CPDF_RenderContext* pContext,
606                                       bool bPrinting, CFX_AffineMatrix* pMatrix, FX_DWORD dwAnnotFlags,
607                                       CPDF_RenderOptions* pOptions, FX_RECT* pClipRect);
608
609
610
611     CPDF_Annot*                 GetAt(int index)
612     {
613         return (CPDF_Annot*)m_AnnotList.GetAt(index);
614     }
615
616     int                                 Count()
617     {
618         return m_AnnotList.GetSize();
619     }
620
621     int                                 GetIndex(CPDF_Annot* pAnnot);
622
623
624     CPDF_Document*              GetDocument() const
625     {
626         return m_pDocument;
627     }
628 protected:
629
630     CFX_PtrArray                m_AnnotList;
631
632     CPDF_Dictionary*    m_pPageDict;
633
634     CPDF_Document*              m_pDocument;
635
636     CFX_PtrArray                m_Borders;
637
638     void                                DisplayPass(const CPDF_Page* pPage, CFX_RenderDevice* pDevice,
639                                     CPDF_RenderContext* pContext, bool bPrinting, CFX_AffineMatrix* pMatrix,
640                                     bool bWidget, CPDF_RenderOptions* pOptions, FX_RECT* clip_rect);
641     friend class                CPDF_Annot;
642 };
643 #define COLORTYPE_TRANSPARENT   0
644 #define COLORTYPE_GRAY                  1
645 #define COLORTYPE_RGB                   2
646 #define COLORTYPE_CMYK                  3
647 class CPDF_DefaultAppearance
648 {
649 public:
650
651     CPDF_DefaultAppearance(const CFX_ByteString& csDA = "")
652     {
653         m_csDA = csDA;
654     }
655
656     CPDF_DefaultAppearance(const CPDF_DefaultAppearance& cDA)
657     {
658         m_csDA = (CFX_ByteString)(CPDF_DefaultAppearance&)cDA;
659     }
660
661
662     operator CFX_ByteString() const
663     {
664         return m_csDA;
665     }
666
667     const CPDF_DefaultAppearance& operator =(const CFX_ByteString& csDA)
668     {
669         m_csDA = csDA;
670         return *this;
671     }
672
673     const CPDF_DefaultAppearance& operator =(const CPDF_DefaultAppearance& cDA)
674     {
675         m_csDA = (CFX_ByteString)(CPDF_DefaultAppearance&)cDA;
676         return *this;
677     }
678
679
680
681     bool                                HasFont();
682
683     CFX_ByteString              GetFontString();
684
685     void                                GetFont(CFX_ByteString& csFontNameTag, FX_FLOAT& fFontSize);
686
687
688
689
690     bool                                HasColor(bool bStrokingOperation = false);
691
692     CFX_ByteString              GetColorString(bool bStrokingOperation = false);
693
694     void                                GetColor(int& iColorType, FX_FLOAT fc[4], bool bStrokingOperation = false);
695
696     void                                GetColor(FX_ARGB& color, int& iColorType, bool bStrokingOperation = false);
697
698
699
700
701     bool                                HasTextMatrix();
702
703     CFX_ByteString              GetTextMatrixString();
704
705     CFX_AffineMatrix    GetTextMatrix();
706
707 protected:
708
709     CFX_ByteString              m_csDA;
710 };
711 #define FIELDTYPE_UNKNOWN                       0
712 #define FIELDTYPE_PUSHBUTTON            1
713 #define FIELDTYPE_CHECKBOX                      2
714 #define FIELDTYPE_RADIOBUTTON           3
715 #define FIELDTYPE_COMBOBOX                      4
716 #define FIELDTYPE_LISTBOX                       5
717 #define FIELDTYPE_TEXTFIELD                     6
718 #define FIELDTYPE_SIGNATURE                     7
719 class CPDF_InterForm : public CFX_PrivateData
720 {
721 public:
722
723     CPDF_InterForm(CPDF_Document* pDocument, bool bUpdateAP);
724
725     ~CPDF_InterForm();
726
727
728
729     static void                         EnableUpdateAP(bool bUpdateAP);
730
731     static bool                 UpdatingAPEnabled();
732
733
734     static CFX_ByteString       GenerateNewResourceName(const CPDF_Dictionary* pResDict, const FX_CHAR* csType, int iMinLen = 2, const FX_CHAR* csPrefix = "");
735
736
737
738     static CPDF_Font*           AddSystemDefaultFont(const CPDF_Document* pDocument);
739
740     static CPDF_Font*           AddSystemFont(const CPDF_Document* pDocument, CFX_ByteString csFontName, uint8_t iCharSet = 1);
741
742     static CPDF_Font*           AddSystemFont(const CPDF_Document* pDocument, CFX_WideString csFontName, uint8_t iCharSet = 1);
743
744     static CPDF_Font*           AddStandardFont(const CPDF_Document* pDocument, CFX_ByteString csFontName);
745
746     static CFX_ByteString       GetNativeFont(uint8_t iCharSet, void* pLogFont = NULL);
747
748     static CFX_ByteString       GetNativeFont(void* pLogFont = NULL);
749
750     static uint8_t                      GetNativeCharSet();
751
752     static CPDF_Font*           AddNativeFont(uint8_t iCharSet, const CPDF_Document* pDocument);
753
754     static CPDF_Font*           AddNativeFont(const CPDF_Document* pDocument);
755
756
757
758
759     bool                                        ValidateFieldName(CFX_WideString& csNewFieldName, int iType);
760
761     bool                                        ValidateFieldName(const CPDF_FormField* pField, CFX_WideString& csNewFieldName);
762
763     bool                                        ValidateFieldName(const CPDF_FormControl* pControl, CFX_WideString& csNewFieldName);
764
765
766
767
768     FX_DWORD                            CountFields(const CFX_WideString &csFieldName = L"");
769
770     CPDF_FormField*                     GetField(FX_DWORD index, const CFX_WideString &csFieldName = L"");
771
772     void                                        GetAllFieldNames(CFX_WideStringArray& allFieldNames);
773
774     bool                                        IsValidFormField(const void* pField);
775
776     CPDF_FormField*                     GetFieldByDict(CPDF_Dictionary* pFieldDict) const;
777
778
779
780
781     FX_DWORD                            CountControls(CFX_WideString csFieldName = L"");
782
783     CPDF_FormControl*           GetControl(FX_DWORD index, CFX_WideString csFieldName = L"");
784
785     bool                                        IsValidFormControl(const void* pControl);
786
787     int                                         CountPageControls(CPDF_Page* pPage) const;
788
789     CPDF_FormControl*           GetPageControl(CPDF_Page* pPage, int index) const;
790
791
792     CPDF_FormControl*           GetControlAtPoint(CPDF_Page* pPage, FX_FLOAT pdf_x, FX_FLOAT pdf_y) const;
793
794     CPDF_FormControl*           GetControlByDict(CPDF_Dictionary* pWidgetDict) const;
795
796
797
798
799     FX_DWORD                            CountInternalFields(const CFX_WideString& csFieldName = L"") const;
800
801     CPDF_Dictionary*            GetInternalField(FX_DWORD index, const CFX_WideString& csFieldName = L"") const;
802
803
804
805
806
807     CPDF_Document*                      GetDocument() const
808     {
809         return m_pDocument;
810     }
811
812     CPDF_Dictionary*            GetFormDict() const
813     {
814         return m_pFormDict;
815     }
816
817
818
819
820     bool                                        NeedConstructAP();
821
822     void                                        NeedConstructAP(bool bNeedAP);
823
824
825
826
827     int                                         CountFieldsInCalculationOrder();
828
829     CPDF_FormField*                     GetFieldInCalculationOrder(int index);
830
831     int                                         FindFieldInCalculationOrder(const CPDF_FormField* pField);
832
833
834
835
836     FX_DWORD                            CountFormFonts();
837
838     CPDF_Font*                          GetFormFont(FX_DWORD index, CFX_ByteString& csNameTag);
839
840     CPDF_Font*                          GetFormFont(CFX_ByteString csNameTag);
841
842     CPDF_Font*                          GetFormFont(CFX_ByteString csFontName, CFX_ByteString& csNameTag);
843
844     CPDF_Font*                          GetNativeFormFont(uint8_t iCharSet, CFX_ByteString& csNameTag);
845
846     CPDF_Font*                          GetNativeFormFont(CFX_ByteString& csNameTag);
847
848     bool                                        FindFormFont(const CPDF_Font* pFont, CFX_ByteString& csNameTag);
849
850     bool                                        FindFormFont(CFX_ByteString csFontName, CPDF_Font*& pFont, CFX_ByteString& csNameTag);
851
852     inline bool                 FindFormFont(CFX_WideString csFontName, CPDF_Font*& pFont, CFX_ByteString& csNameTag)
853     {
854         return FindFormFont(PDF_EncodeText(csFontName), pFont, csNameTag);
855     }
856
857
858
859
860
861     void                                        AddFormFont(const CPDF_Font* pFont, CFX_ByteString& csNameTag);
862
863     CPDF_Font*                          AddNativeFormFont(uint8_t iCharSet, CFX_ByteString& csNameTag);
864
865     CPDF_Font*                          AddNativeFormFont(CFX_ByteString& csNameTag);
866
867     void                                        RemoveFormFont(const CPDF_Font* pFont);
868
869     void                                        RemoveFormFont(CFX_ByteString csNameTag);
870
871
872
873
874     CPDF_DefaultAppearance      GetDefaultAppearance();
875
876     CPDF_Font*                          GetDefaultFormFont();
877
878
879
880     int                                         GetFormAlignment();
881
882
883
884
885     CPDF_FormField*                     CheckRequiredFields(const CFX_PtrArray *fields = NULL, bool bIncludeOrExclude = true) const;
886
887     CFDF_Document*                      ExportToFDF(const CFX_WideStringC& pdf_path, bool bSimpleFileSpec = false) const;
888
889     CFDF_Document*                      ExportToFDF(const CFX_WideStringC& pdf_path, CFX_PtrArray& fields, bool bIncludeOrExclude = true, bool bSimpleFileSpec = false) const;
890
891     bool                                        ImportFromFDF(const CFDF_Document* pFDFDoc, bool bNotify = false);
892
893
894
895
896     bool                                        ResetForm(const CFX_PtrArray& fields, bool bIncludeOrExclude = true, bool bNotify = false);
897
898     bool                                        ResetForm(bool bNotify = false);
899
900     void                                        ReloadForm();
901
902     CPDF_FormNotify*            GetFormNotify() const
903     {
904         return m_pFormNotify;
905     }
906
907     void                                        SetFormNotify(const CPDF_FormNotify* pNotify);
908
909
910     int                                         GetPageWithWidget(int iCurPage, bool bNext);
911
912
913
914     bool                                        IsUpdated()
915     {
916         return m_bUpdated;
917     }
918
919     void                                        ClearUpdatedFlag()
920     {
921         m_bUpdated = false;
922     }
923
924
925     bool                                        HasXFAForm() const;
926
927     void                                        FixPageFields(const CPDF_Page* pPage);
928 protected:
929
930     static bool                 m_bUpdateAP;
931
932     void                                        LoadField(CPDF_Dictionary* pFieldDict, int nLevel = 0);
933
934     CPDF_Object*                        GetFieldAttr(CPDF_Dictionary* pFieldDict, const FX_CHAR* name);
935
936     CPDF_FormField*                     AddTerminalField(const CPDF_Dictionary* pFieldDict);
937
938     CPDF_FormControl*           AddControl(const CPDF_FormField* pField, const CPDF_Dictionary* pWidgetDict);
939
940     void                                        FDF_ImportField(CPDF_Dictionary* pField, const CFX_WideString& parent_name, bool bNotify = false, int nLevel = 0);
941
942     bool                                        ValidateFieldName(CFX_WideString& csNewFieldName, int iType, const CPDF_FormField* pExcludedField, const CPDF_FormControl* pExcludedControl);
943
944     int                                         CompareFieldName(const CFX_WideString& name1, const CFX_WideString& name2);
945
946     int                                         CompareFieldName(const CFX_ByteString& name1, const CFX_ByteString& name2);
947
948     CPDF_Document*                      m_pDocument;
949
950     bool                                        m_bGenerateAP;
951
952     CPDF_Dictionary*            m_pFormDict;
953
954     CFX_MapPtrToPtr                     m_ControlMap;
955
956     CFieldTree *m_pFieldTree;
957
958     CFX_ByteString                      m_bsEncoding;
959
960     CPDF_FormNotify*            m_pFormNotify;
961
962     bool                                        m_bUpdated;
963     friend class CPDF_FormControl;
964     friend class CPDF_FormField;
965 };
966 #define FORMFIELD_READONLY              0x01
967 #define FORMFIELD_REQUIRED              0x02
968 #define FORMFIELD_NOEXPORT              0x04
969 #define FORMRADIO_NOTOGGLEOFF   0x100
970 #define FORMRADIO_UNISON                0x200
971 #define FORMTEXT_MULTILINE              0x100
972 #define FORMTEXT_PASSWORD               0x200
973 #define FORMTEXT_NOSCROLL               0x400
974 #define FORMTEXT_COMB                   0x800
975 #define FORMCOMBO_EDIT                  0x100
976 #define FORMLIST_MULTISELECT    0x100
977 class CPDF_FormField
978 {
979 public:
980
981     enum Type {
982         Unknown,
983         PushButton,
984         RadioButton,
985         CheckBox,
986         Text,
987         RichText,
988         File,
989         ListBox,
990         ComboBox,
991         Sign
992     };
993
994     CFX_WideString                      GetFullName();
995
996     Type                                        GetType()
997     {
998         return m_Type;
999     }
1000
1001     FX_DWORD                            GetFlags()
1002     {
1003         return m_Flags;
1004     }
1005
1006     CPDF_InterForm*                     GetInterForm() const
1007     {
1008         return m_pForm;
1009     }
1010
1011     CPDF_Dictionary*            GetFieldDict() const
1012     {
1013         return m_pDict;
1014     }
1015
1016     void                                        SetFieldDict(CPDF_Dictionary* pDict)
1017     {
1018         m_pDict = pDict;
1019     }
1020
1021     bool                                        ResetField(bool bNotify = false);
1022
1023
1024
1025     int                                         CountControls()
1026     {
1027         return m_ControlList.GetSize();
1028     }
1029
1030     CPDF_FormControl*           GetControl(int index)
1031     {
1032         return (CPDF_FormControl*)m_ControlList.GetAt(index);
1033     }
1034
1035     int                                         GetControlIndex(const CPDF_FormControl* pControl);
1036
1037
1038
1039
1040     int                                         GetFieldType();
1041
1042
1043
1044
1045     CPDF_AAction                        GetAdditionalAction();
1046
1047
1048
1049
1050     CFX_WideString                      GetAlternateName();
1051
1052
1053
1054
1055     CFX_WideString                      GetMappingName();
1056
1057
1058
1059
1060     FX_DWORD                            GetFieldFlags();
1061
1062
1063
1064
1065     CFX_ByteString                      GetDefaultStyle();
1066
1067
1068
1069
1070     CFX_WideString                      GetRichTextString();
1071
1072
1073
1074     CFX_WideString                      GetValue();
1075
1076     CFX_WideString                      GetDefaultValue();
1077
1078     bool                                        SetValue(const CFX_WideString& value, bool bNotify = false);
1079
1080
1081
1082
1083
1084     int                                         GetMaxLen();
1085
1086
1087
1088
1089     int                                         CountSelectedItems();
1090
1091     int                                         GetSelectedIndex(int index);
1092
1093     bool                                        ClearSelection(bool bNotify = false);
1094
1095     bool                                        IsItemSelected(int index);
1096
1097     bool                                        SetItemSelection(int index, bool bSelected, bool bNotify = false);
1098
1099     bool                                        IsItemDefaultSelected(int index);
1100
1101     int                                         GetDefaultSelectedItem();
1102
1103
1104
1105
1106     int                                         CountOptions();
1107
1108     CFX_WideString                      GetOptionLabel(int index);
1109
1110     CFX_WideString                      GetOptionValue(int index);
1111
1112     int                                         FindOption(CFX_WideString csOptLabel);
1113
1114     int                                         FindOptionValue(const CFX_WideString& csOptValue, int iStartIndex = 0);
1115
1116
1117
1118
1119     bool                                        CheckControl(int iControlIndex, bool bChecked, bool bNotify = false);
1120
1121
1122
1123
1124     int                                         GetTopVisibleIndex();
1125
1126
1127
1128
1129     int                                         CountSelectedOptions();
1130
1131     int                                         GetSelectedOptionIndex(int index);
1132
1133     bool                                        IsOptionSelected(int iOptIndex);
1134
1135     bool                                        SelectOption(int iOptIndex, bool bSelected, bool bNotify = false);
1136
1137     bool                                        ClearSelectedOptions(bool bNotify = false);
1138
1139
1140
1141
1142     FX_FLOAT                            GetFontSize()
1143     {
1144         return m_FontSize;
1145     }
1146
1147     CPDF_Font*                          GetFont()
1148     {
1149         return m_pFont;
1150     }
1151
1152 protected:
1153
1154     CPDF_FormField(CPDF_InterForm* pForm, CPDF_Dictionary* pDict);
1155
1156     ~CPDF_FormField();
1157
1158     CPDF_FormField::Type        m_Type;
1159
1160     FX_DWORD                            m_Flags;
1161
1162     CPDF_InterForm*                     m_pForm;
1163
1164     CPDF_Dictionary*            m_pDict;
1165
1166     CFX_PtrArray                        m_ControlList;
1167     friend class                        CPDF_InterForm;
1168     friend class                        CPDF_FormControl;
1169
1170
1171
1172     CFX_WideString                      GetValue(bool bDefault);
1173
1174     bool                                        SetValue(const CFX_WideString& value, bool bDefault, bool bNotify);
1175
1176
1177     void                                        SyncFieldFlags();
1178
1179     int                                         FindListSel(CPDF_String* str);
1180
1181     CFX_WideString                      GetOptionText(int index, int sub_index);
1182
1183     void                                        LoadDA();
1184
1185     void                                        UpdateAP(CPDF_FormControl* pControl);
1186
1187
1188
1189     CFX_WideString                      GetCheckValue(bool bDefault);
1190
1191     bool                                        SetCheckValue(const CFX_WideString& value, bool bDefault, bool bNotify);
1192
1193
1194     FX_FLOAT                            m_FontSize;
1195
1196     CPDF_Font*                          m_pFont;
1197 };
1198 CPDF_Object*    FPDF_GetFieldAttr(CPDF_Dictionary* pFieldDict, const FX_CHAR* name, int nLevel = 0);
1199 class CPDF_IconFit
1200 {
1201 public:
1202
1203     CPDF_IconFit(CPDF_Dictionary* pDict = NULL)
1204     {
1205         m_pDict = pDict;
1206     }
1207
1208     operator CPDF_Dictionary*() const
1209     {
1210         return m_pDict;
1211     }
1212
1213
1214
1215
1216     enum ScaleMethod {
1217         Always = 0,
1218         Bigger,
1219         Smaller,
1220         Never
1221     };
1222
1223     ScaleMethod                         GetScaleMethod();
1224
1225
1226
1227
1228     bool                                        IsProportionalScale();
1229
1230
1231
1232
1233     void                                        GetIconPosition(FX_FLOAT& fLeft, FX_FLOAT& fBottom);
1234
1235
1236
1237
1238     bool                                        GetFittingBounds();
1239
1240
1241     CPDF_Dictionary*            m_pDict;
1242 };
1243
1244 #define TEXTPOS_CAPTION         0
1245 #define TEXTPOS_ICON            1
1246 #define TEXTPOS_BELOW           2
1247 #define TEXTPOS_ABOVE           3
1248 #define TEXTPOS_RIGHT           4
1249 #define TEXTPOS_LEFT            5
1250 #define TEXTPOS_OVERLAID        6
1251 class CPDF_FormControl
1252 {
1253 public:
1254
1255     CPDF_FormField::Type        GetType()
1256     {
1257         return m_pField->GetType();
1258     }
1259
1260     CPDF_InterForm*                     GetInterForm() const
1261     {
1262         return m_pForm;
1263     }
1264
1265     CPDF_FormField*                     GetField() const
1266     {
1267         return m_pField;
1268     }
1269
1270     CPDF_Dictionary*            GetWidget() const
1271     {
1272         return m_pWidgetDict;
1273     }
1274
1275     CFX_FloatRect                       GetRect();
1276
1277     void                                        DrawControl(CFX_RenderDevice* pDevice, CFX_AffineMatrix* pMatrix,
1278                                         CPDF_Page* pPage, CPDF_Annot::AppearanceMode mode, const CPDF_RenderOptions* pOptions = NULL);
1279
1280
1281
1282     CFX_ByteString                      GetCheckedAPState();
1283
1284     CFX_WideString                      GetExportValue();
1285
1286     bool                                        IsChecked();
1287
1288     bool                                        IsDefaultChecked();
1289
1290
1291
1292
1293     enum HighlightingMode       {
1294         None = 0,
1295         Invert,
1296         Outline,
1297         Push,
1298         Toggle
1299     };
1300
1301     HighlightingMode            GetHighlightingMode();
1302
1303
1304
1305
1306     bool                                        HasMKEntry(CFX_ByteString csEntry);
1307
1308
1309
1310
1311     int                                         GetRotation();
1312
1313
1314
1315
1316     inline FX_ARGB                      GetBorderColor(int& iColorType)
1317     {
1318         return GetColor(iColorType, "BC");
1319     }
1320
1321     inline FX_FLOAT                     GetOriginalBorderColor(int index)
1322     {
1323         return GetOriginalColor(index, "BC");
1324     }
1325
1326     inline void                         GetOriginalBorderColor(int& iColorType, FX_FLOAT fc[4])
1327     {
1328         GetOriginalColor(iColorType, fc, "BC");
1329     }
1330
1331
1332
1333
1334     inline FX_ARGB                      GetBackgroundColor(int& iColorType)
1335     {
1336         return GetColor(iColorType, "BG");
1337     }
1338
1339     inline FX_FLOAT                     GetOriginalBackgroundColor(int index)
1340     {
1341         return GetOriginalColor(index, "BG");
1342     }
1343
1344     inline void                         GetOriginalBackgroundColor(int& iColorType, FX_FLOAT fc[4])
1345     {
1346         GetOriginalColor(iColorType, fc, "BG");
1347     }
1348
1349
1350
1351
1352     inline CFX_WideString       GetNormalCaption()
1353     {
1354         return GetCaption("CA");
1355     }
1356
1357
1358
1359
1360     inline CFX_WideString       GetRolloverCaption()
1361     {
1362         return GetCaption("RC");
1363     }
1364
1365
1366
1367
1368     inline CFX_WideString       GetDownCaption()
1369     {
1370         return GetCaption("AC");
1371     }
1372
1373
1374
1375
1376     inline CPDF_Stream*         GetNormalIcon()
1377     {
1378         return GetIcon("I");
1379     }
1380
1381
1382
1383
1384     inline CPDF_Stream*         GetRolloverIcon()
1385     {
1386         return GetIcon("RI");
1387     }
1388
1389
1390
1391
1392     inline CPDF_Stream*         GetDownIcon()
1393     {
1394         return GetIcon("IX");
1395     }
1396
1397
1398
1399
1400     CPDF_IconFit                        GetIconFit();
1401
1402
1403
1404
1405     int                                         GetTextPosition();
1406
1407
1408
1409
1410     CPDF_Action                         GetAction();
1411
1412
1413
1414
1415     CPDF_AAction                        GetAdditionalAction();
1416
1417
1418
1419
1420     CPDF_DefaultAppearance      GetDefaultAppearance();
1421
1422     CPDF_Font*                          GetDefaultControlFont();
1423
1424
1425
1426
1427     int                                         GetControlAlignment();
1428
1429 protected:
1430
1431     CPDF_FormControl(CPDF_FormField* pField, CPDF_Dictionary* pWidgetDict);
1432
1433     CFX_ByteString                      GetOnStateName();
1434
1435     void                                        SetOnStateName(const CFX_ByteString& csOn);
1436
1437     void                                        CheckControl(bool bChecked);
1438
1439     FX_ARGB                                     GetColor(int& iColorType, CFX_ByteString csEntry);
1440
1441     FX_FLOAT                            GetOriginalColor(int index, CFX_ByteString csEntry);
1442
1443     void                                        GetOriginalColor(int& iColorType, FX_FLOAT fc[4], CFX_ByteString csEntry);
1444
1445     CFX_WideString                      GetCaption(CFX_ByteString csEntry);
1446
1447     CPDF_Stream*                        GetIcon(CFX_ByteString csEntry);
1448
1449     CPDF_ApSettings                     GetMK(bool bCreate);
1450
1451     CPDF_InterForm*                     m_pForm;
1452
1453     CPDF_FormField*                     m_pField;
1454
1455     CPDF_Dictionary*            m_pWidgetDict;
1456     friend class                        CPDF_InterForm;
1457     friend class                        CPDF_FormField;
1458 };
1459 class CPDF_FormNotify
1460 {
1461 public:
1462
1463     virtual ~CPDF_FormNotify() {}
1464
1465     virtual int         BeforeValueChange(const CPDF_FormField* pField, CFX_WideString& csValue)
1466     {
1467         return 0;
1468     }
1469
1470     virtual int         AfterValueChange(const CPDF_FormField* pField)
1471     {
1472         return 0;
1473     }
1474
1475     virtual int         BeforeSelectionChange(const CPDF_FormField* pField, CFX_WideString& csValue)
1476     {
1477         return 0;
1478     }
1479
1480     virtual int         AfterSelectionChange(const CPDF_FormField* pField)
1481     {
1482         return 0;
1483     }
1484
1485     virtual int         AfterCheckedStatusChange(const CPDF_FormField* pField, const CFX_ByteArray& statusArray)
1486     {
1487         return 0;
1488     }
1489
1490     virtual int         BeforeFormReset(const CPDF_InterForm* pForm)
1491     {
1492         return 0;
1493     }
1494
1495     virtual int         AfterFormReset(const CPDF_InterForm* pForm)
1496     {
1497         return 0;
1498     }
1499
1500     virtual int         BeforeFormImportData(const CPDF_InterForm* pForm)
1501     {
1502         return 0;
1503     }
1504
1505     virtual int         AfterFormImportData(const CPDF_InterForm* pForm)
1506     {
1507         return 0;
1508     }
1509 };
1510 bool            FPDF_GenerateAP(CPDF_Document* pDoc, CPDF_Dictionary* pAnnotDict);
1511 class CPDF_PageLabel
1512 {
1513 public:
1514
1515     CPDF_PageLabel(CPDF_Document* pDocument)
1516     {
1517         m_pDocument = pDocument;
1518     }
1519
1520
1521     CFX_WideString                                      GetLabel(int nPage) const;
1522
1523     int32_t                                             GetPageByLabel(const CFX_ByteStringC& bsLabel) const;
1524
1525
1526     int32_t                                             GetPageByLabel(const CFX_WideStringC& wsLabel) const;
1527
1528 protected:
1529     CPDF_Document*                                      m_pDocument;
1530 };
1531 class CPDF_Metadata
1532 {
1533 public:
1534
1535     CPDF_Metadata();
1536
1537
1538     ~CPDF_Metadata();
1539
1540     void                                LoadDoc(CPDF_Document *pDoc);
1541
1542
1543     int32_t                     GetString(const CFX_ByteStringC& bsItem, CFX_WideString &wsStr);
1544
1545     CXML_Element*               GetRoot() const;
1546
1547     CXML_Element*               GetRDF() const;
1548
1549 protected:
1550     void*       m_pData;
1551 };
1552 class CPDF_ViewerPreferences
1553 {
1554 public:
1555
1556     CPDF_ViewerPreferences(CPDF_Document *pDoc);
1557
1558
1559     ~CPDF_ViewerPreferences();
1560
1561
1562     bool IsDirectionR2L() const;
1563
1564     bool PrintScaling() const;
1565
1566     int32_t NumCopies() const;
1567
1568     CPDF_Array* PrintPageRange() const;
1569
1570     CFX_ByteString Duplex() const;
1571
1572 protected:
1573     CPDF_Document*      m_pDoc;
1574 };
1575 class CPDF_ApSettings
1576 {
1577 public:
1578
1579     CPDF_ApSettings(CPDF_Dictionary* pDict = NULL)
1580     {
1581         m_pDict = pDict;
1582     }
1583
1584     operator CPDF_Dictionary* () const
1585     {
1586         return m_pDict;
1587     }
1588
1589     bool                                        HasMKEntry(const CFX_ByteStringC& csEntry);
1590
1591
1592
1593     int                                         GetRotation();
1594
1595
1596
1597
1598     inline FX_ARGB                      GetBorderColor(int& iColorType)
1599     {
1600         return GetColor(iColorType, FX_BSTRC("BC"));
1601     }
1602
1603     inline FX_FLOAT                     GetOriginalBorderColor(int index)
1604     {
1605         return GetOriginalColor(index, FX_BSTRC("BC"));
1606     }
1607
1608     inline void                         GetOriginalBorderColor(int& iColorType, FX_FLOAT fc[4])
1609     {
1610         GetOriginalColor(iColorType, fc, FX_BSTRC("BC"));
1611     }
1612
1613
1614
1615
1616     inline FX_ARGB                      GetBackgroundColor(int& iColorType)
1617     {
1618         return GetColor(iColorType, FX_BSTRC("BG"));
1619     }
1620
1621     inline FX_FLOAT                     GetOriginalBackgroundColor(int index)
1622     {
1623         return GetOriginalColor(index, FX_BSTRC("BG"));
1624     }
1625
1626     inline void                         GetOriginalBackgroundColor(int& iColorType, FX_FLOAT fc[4])
1627     {
1628         GetOriginalColor(iColorType, fc, FX_BSTRC("BG"));
1629     }
1630
1631
1632
1633
1634     inline CFX_WideString       GetNormalCaption()
1635     {
1636         return GetCaption(FX_BSTRC("CA"));
1637     }
1638
1639
1640
1641
1642     inline CFX_WideString       GetRolloverCaption()
1643     {
1644         return GetCaption(FX_BSTRC("RC"));
1645     }
1646
1647
1648
1649
1650     inline CFX_WideString       GetDownCaption()
1651     {
1652         return GetCaption(FX_BSTRC("AC"));
1653     }
1654
1655
1656
1657
1658     inline CPDF_Stream*         GetNormalIcon()
1659     {
1660         return GetIcon(FX_BSTRC("I"));
1661     }
1662
1663
1664
1665
1666     inline CPDF_Stream*         GetRolloverIcon()
1667     {
1668         return GetIcon(FX_BSTRC("RI"));
1669     }
1670
1671
1672
1673
1674     inline CPDF_Stream*         GetDownIcon()
1675     {
1676         return GetIcon(FX_BSTRC("IX"));
1677     }
1678
1679
1680
1681
1682     CPDF_IconFit                        GetIconFit();
1683
1684
1685
1686
1687     int                                         GetTextPosition();
1688
1689     CPDF_Dictionary*            m_pDict;
1690 protected:
1691
1692     FX_ARGB                                     GetColor(int& iColorType, const CFX_ByteStringC& csEntry);
1693
1694     FX_FLOAT                            GetOriginalColor(int index, const CFX_ByteStringC& csEntry);
1695
1696     void                                        GetOriginalColor(int& iColorType, FX_FLOAT fc[4], const CFX_ByteStringC& csEntry);
1697
1698     CFX_WideString                      GetCaption(const CFX_ByteStringC& csEntry);
1699
1700     CPDF_Stream*                        GetIcon(const CFX_ByteStringC& csEntry);
1701     friend class                        CPDF_FormControl;
1702 };
1703
1704 #endif  // CORE_INCLUDE_FPDFDOC_FPDF_DOC_H_