Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(619)

Side by Side Diff: core/include/fpdfdoc/fpdf_doc.h

Issue 1278053004: Add new public APIs to find the z-order for links and widgets. (Closed) Base URL: https://pdfium.googlesource.com/pdfium@master
Patch Set: Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | core/src/fpdfdoc/doc_form.cpp » ('j') | core/src/fpdfdoc/doc_form.cpp » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 PDFium Authors. All rights reserved. 1 // Copyright 2014 PDFium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6 6
7 #ifndef CORE_INCLUDE_FPDFDOC_FPDF_DOC_H_ 7 #ifndef CORE_INCLUDE_FPDFDOC_FPDF_DOC_H_
8 #define CORE_INCLUDE_FPDFDOC_FPDF_DOC_H_ 8 #define CORE_INCLUDE_FPDFDOC_FPDF_DOC_H_
9 9
10 #include <map> 10 #include <map>
(...skipping 13 matching lines...) Expand all
24 class CPDF_DefaultAppearance; 24 class CPDF_DefaultAppearance;
25 class CPDF_Dest; 25 class CPDF_Dest;
26 class CPDF_DocJSActions; 26 class CPDF_DocJSActions;
27 class CPDF_FileSpec; 27 class CPDF_FileSpec;
28 class CPDF_FormControl; 28 class CPDF_FormControl;
29 class CPDF_FormField; 29 class CPDF_FormField;
30 class CPDF_FormNotify; 30 class CPDF_FormNotify;
31 class CPDF_IconFit; 31 class CPDF_IconFit;
32 class CPDF_InterForm; 32 class CPDF_InterForm;
33 class CPDF_Link; 33 class CPDF_Link;
34 class CPDF_LinkList;
35 class CPDF_LWinParam; 34 class CPDF_LWinParam;
36 class CPDF_Metadata; 35 class CPDF_Metadata;
37 class CPDF_NumberTree; 36 class CPDF_NumberTree;
38 class CPDF_OCContext; 37 class CPDF_OCContext;
39 class CPDF_Page; 38 class CPDF_Page;
40 class CPDF_RenderOptions; 39 class CPDF_RenderOptions;
41 class CPDF_TextObject; 40 class CPDF_TextObject;
42 class CPDF_ViewerPreferences; 41 class CPDF_ViewerPreferences;
43 class CXML_Element; 42 class CXML_Element;
44 43
(...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after
350 349
351 FX_BOOL GetFileName(CFX_WideString& wsFileName) const; 350 FX_BOOL GetFileName(CFX_WideString& wsFileName) const;
352 351
353 CPDF_Stream* GetFileStream() const; 352 CPDF_Stream* GetFileStream() const;
354 353
355 void SetFileName(const CFX_WideStringC& wsFileName, FX_BOOL bURL = FALSE); 354 void SetFileName(const CFX_WideStringC& wsFileName, FX_BOOL bURL = FALSE);
356 355
357 protected: 356 protected:
358 CPDF_Object* m_pObj; 357 CPDF_Object* m_pObj;
359 }; 358 };
359
360 class CPDF_LinkList { 360 class CPDF_LinkList {
361 public: 361 public:
362 CPDF_LinkList(CPDF_Document* pDoc) { m_pDocument = pDoc; } 362 CPDF_LinkList();
363
364 ~CPDF_LinkList(); 363 ~CPDF_LinkList();
365 364
366 CPDF_Link GetLinkAtPoint(CPDF_Page* pPage, FX_FLOAT pdf_x, FX_FLOAT pdf_y); 365 CPDF_Link GetLinkAtPoint(CPDF_Page* pPage,
366 FX_FLOAT pdf_x,
367 FX_FLOAT pdf_y,
368 int* z_order);
367 369
368 int CountLinks(CPDF_Page* pPage); 370 private:
369
370 CPDF_Link GetLink(CPDF_Page* pPage, int index);
371
372 CPDF_Document* GetDocument() const { return m_pDocument; }
373
374 protected:
375 CPDF_Document* m_pDocument;
376
377 CFX_MapPtrToPtr m_PageMap;
378
379 CFX_PtrArray* GetPageLinks(CPDF_Page* pPage); 371 CFX_PtrArray* GetPageLinks(CPDF_Page* pPage);
380 372
381 void LoadPageLinks(CPDF_Page* pPage, CFX_PtrArray* pList); 373 void LoadPageLinks(CPDF_Page* pPage, CFX_PtrArray* pList);
374
375 CFX_MapPtrToPtr m_PageMap;
382 }; 376 };
377
383 class CPDF_Link { 378 class CPDF_Link {
384 public: 379 public:
385 CPDF_Link() : m_pDict(nullptr) {} 380 CPDF_Link() : m_pDict(nullptr) {}
386 explicit CPDF_Link(CPDF_Dictionary* pDict) : m_pDict(pDict) {} 381 explicit CPDF_Link(CPDF_Dictionary* pDict) : m_pDict(pDict) {}
387 382
388 CPDF_Dictionary* GetDict() const { return m_pDict; } 383 CPDF_Dictionary* GetDict() const { return m_pDict; }
389 384
390 CFX_FloatRect GetRect(); 385 CFX_FloatRect GetRect();
391 CPDF_Dest GetDest(CPDF_Document* pDoc); 386 CPDF_Dest GetDest(CPDF_Document* pDoc);
392 CPDF_Action GetAction(); 387 CPDF_Action GetAction();
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after
649 CFX_WideString csFieldName = L""); 644 CFX_WideString csFieldName = L"");
650 645
651 FX_BOOL IsValidFormControl(const void* pControl); 646 FX_BOOL IsValidFormControl(const void* pControl);
652 647
653 int CountPageControls(CPDF_Page* pPage) const; 648 int CountPageControls(CPDF_Page* pPage) const;
654 649
655 CPDF_FormControl* GetPageControl(CPDF_Page* pPage, int index) const; 650 CPDF_FormControl* GetPageControl(CPDF_Page* pPage, int index) const;
656 651
657 CPDF_FormControl* GetControlAtPoint(CPDF_Page* pPage, 652 CPDF_FormControl* GetControlAtPoint(CPDF_Page* pPage,
658 FX_FLOAT pdf_x, 653 FX_FLOAT pdf_x,
659 FX_FLOAT pdf_y) const; 654 FX_FLOAT pdf_y,
655 int* z_order) const;
660 656
661 CPDF_FormControl* GetControlByDict(CPDF_Dictionary* pWidgetDict) const; 657 CPDF_FormControl* GetControlByDict(CPDF_Dictionary* pWidgetDict) const;
662 658
663 FX_DWORD CountInternalFields(const CFX_WideString& csFieldName = L"") const; 659 FX_DWORD CountInternalFields(const CFX_WideString& csFieldName = L"") const;
664 660
665 CPDF_Dictionary* GetInternalField( 661 CPDF_Dictionary* GetInternalField(
666 FX_DWORD index, 662 FX_DWORD index,
667 const CFX_WideString& csFieldName = L"") const; 663 const CFX_WideString& csFieldName = L"") const;
668 664
669 CPDF_Document* GetDocument() const { return m_pDocument; } 665 CPDF_Document* GetDocument() const { return m_pDocument; }
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
826 ComboBox, 822 ComboBox,
827 Sign 823 Sign
828 }; 824 };
829 825
830 CFX_WideString GetFullName(); 826 CFX_WideString GetFullName();
831 827
832 Type GetType() { return m_Type; } 828 Type GetType() { return m_Type; }
833 829
834 FX_DWORD GetFlags() { return m_Flags; } 830 FX_DWORD GetFlags() { return m_Flags; }
835 831
836 CPDF_InterForm* GetInterForm() const { return m_pForm; }
837
838 CPDF_Dictionary* GetFieldDict() const { return m_pDict; } 832 CPDF_Dictionary* GetFieldDict() const { return m_pDict; }
839 833
840 void SetFieldDict(CPDF_Dictionary* pDict) { m_pDict = pDict; } 834 void SetFieldDict(CPDF_Dictionary* pDict) { m_pDict = pDict; }
841 835
842 FX_BOOL ResetField(FX_BOOL bNotify = FALSE); 836 FX_BOOL ResetField(FX_BOOL bNotify = FALSE);
843 837
844 int CountControls() { return m_ControlList.GetSize(); } 838 int CountControls() { return m_ControlList.GetSize(); }
845 839
846 CPDF_FormControl* GetControl(int index) { 840 CPDF_FormControl* GetControl(int index) {
847 return (CPDF_FormControl*)m_ControlList.GetAt(index); 841 return (CPDF_FormControl*)m_ControlList.GetAt(index);
(...skipping 404 matching lines...) Expand 10 before | Expand all | Expand 10 after
1252 FX_FLOAT fc[4], 1246 FX_FLOAT fc[4],
1253 const CFX_ByteStringC& csEntry); 1247 const CFX_ByteStringC& csEntry);
1254 1248
1255 CFX_WideString GetCaption(const CFX_ByteStringC& csEntry); 1249 CFX_WideString GetCaption(const CFX_ByteStringC& csEntry);
1256 1250
1257 CPDF_Stream* GetIcon(const CFX_ByteStringC& csEntry); 1251 CPDF_Stream* GetIcon(const CFX_ByteStringC& csEntry);
1258 friend class CPDF_FormControl; 1252 friend class CPDF_FormControl;
1259 }; 1253 };
1260 1254
1261 #endif // CORE_INCLUDE_FPDFDOC_FPDF_DOC_H_ 1255 #endif // CORE_INCLUDE_FPDFDOC_FPDF_DOC_H_
OLDNEW
« no previous file with comments | « no previous file | core/src/fpdfdoc/doc_form.cpp » ('j') | core/src/fpdfdoc/doc_form.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698