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

Unified 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: nits 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | core/src/fpdfdoc/doc_form.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/include/fpdfdoc/fpdf_doc.h
diff --git a/core/include/fpdfdoc/fpdf_doc.h b/core/include/fpdfdoc/fpdf_doc.h
index e0c6d337cae87ef7296f4d39aa47fc12fd689ade..2d37a481535f912edb7ce84583974d06d0047a70 100644
--- a/core/include/fpdfdoc/fpdf_doc.h
+++ b/core/include/fpdfdoc/fpdf_doc.h
@@ -8,6 +8,7 @@
#define CORE_INCLUDE_FPDFDOC_FPDF_DOC_H_
#include <map>
+#include <vector>
#include "../../../third_party/base/nonstd_unique_ptr.h"
#include "../fpdfapi/fpdf_parser.h"
@@ -32,7 +33,6 @@ class CPDF_FormNotify;
class CPDF_IconFit;
class CPDF_InterForm;
class CPDF_Link;
-class CPDF_LinkList;
class CPDF_LWinParam;
class CPDF_Metadata;
class CPDF_NumberTree;
@@ -357,29 +357,25 @@ class CPDF_FileSpec {
protected:
CPDF_Object* m_pObj;
};
+
class CPDF_LinkList {
public:
- CPDF_LinkList(CPDF_Document* pDoc) { m_pDocument = pDoc; }
-
+ CPDF_LinkList();
~CPDF_LinkList();
- CPDF_Link GetLinkAtPoint(CPDF_Page* pPage, FX_FLOAT pdf_x, FX_FLOAT pdf_y);
-
- int CountLinks(CPDF_Page* pPage);
-
- CPDF_Link GetLink(CPDF_Page* pPage, int index);
-
- CPDF_Document* GetDocument() const { return m_pDocument; }
-
- protected:
- CPDF_Document* m_pDocument;
+ CPDF_Link GetLinkAtPoint(CPDF_Page* pPage,
+ FX_FLOAT pdf_x,
+ FX_FLOAT pdf_y,
+ int* z_order);
- CFX_MapPtrToPtr m_PageMap;
+ private:
+ const std::vector<CPDF_Dictionary*>* GetPageLinks(CPDF_Page* pPage);
- CFX_PtrArray* GetPageLinks(CPDF_Page* pPage);
+ void LoadPageLinks(CPDF_Page* pPage, std::vector<CPDF_Dictionary*>* pList);
- void LoadPageLinks(CPDF_Page* pPage, CFX_PtrArray* pList);
+ std::map<FX_DWORD, std::vector<CPDF_Dictionary*>> m_PageMap;
};
+
class CPDF_Link {
public:
CPDF_Link() : m_pDict(nullptr) {}
@@ -642,29 +638,13 @@ class CPDF_InterForm : public CFX_PrivateData {
CPDF_FormField* GetFieldByDict(CPDF_Dictionary* pFieldDict) const;
- FX_DWORD CountControls(CFX_WideString csFieldName = L"");
-
- CPDF_FormControl* GetControl(FX_DWORD index,
- CFX_WideString csFieldName = L"");
-
- FX_BOOL IsValidFormControl(const void* pControl);
-
- int CountPageControls(CPDF_Page* pPage) const;
-
- CPDF_FormControl* GetPageControl(CPDF_Page* pPage, int index) const;
-
CPDF_FormControl* GetControlAtPoint(CPDF_Page* pPage,
FX_FLOAT pdf_x,
- FX_FLOAT pdf_y) const;
+ FX_FLOAT pdf_y,
+ int* z_order) const;
CPDF_FormControl* GetControlByDict(CPDF_Dictionary* pWidgetDict) const;
- FX_DWORD CountInternalFields(const CFX_WideString& csFieldName = L"") const;
-
- CPDF_Dictionary* GetInternalField(
- FX_DWORD index,
- const CFX_WideString& csFieldName = L"") const;
-
CPDF_Document* GetDocument() const { return m_pDocument; }
CPDF_Dictionary* GetFormDict() const { return m_pFormDict; }
@@ -738,14 +718,10 @@ class CPDF_InterForm : public CFX_PrivateData {
FX_BOOL ResetForm(FX_BOOL bNotify = FALSE);
- void ReloadForm();
-
CPDF_FormNotify* GetFormNotify() const { return m_pFormNotify; }
void SetFormNotify(const CPDF_FormNotify* pNotify);
- int GetPageWithWidget(int iCurPage, FX_BOOL bNext);
-
FX_BOOL IsUpdated() { return m_bUpdated; }
void ClearUpdatedFlag() { m_bUpdated = FALSE; }
@@ -788,7 +764,7 @@ class CPDF_InterForm : public CFX_PrivateData {
CPDF_Dictionary* m_pFormDict;
- CFX_MapPtrToPtr m_ControlMap;
+ std::map<const CPDF_Dictionary*, CPDF_FormControl*> m_ControlMap;
CFieldTree* m_pFieldTree;
@@ -832,8 +808,6 @@ class CPDF_FormField {
FX_DWORD GetFlags() { return m_Flags; }
- CPDF_InterForm* GetInterForm() const { return m_pForm; }
-
CPDF_Dictionary* GetFieldDict() const { return m_pDict; }
void SetFieldDict(CPDF_Dictionary* pDict) { m_pDict = pDict; }
@@ -1000,7 +974,7 @@ class CPDF_FormControl {
CPDF_Dictionary* GetWidget() const { return m_pWidgetDict; }
- CFX_FloatRect GetRect();
+ CFX_FloatRect GetRect() const;
void DrawControl(CFX_RenderDevice* pDevice,
CFX_AffineMatrix* pMatrix,
« no previous file with comments | « no previous file | core/src/fpdfdoc/doc_form.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698