OLD | NEW |
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 FPDFSDK_INCLUDE_FSDK_BASEFORM_H_ | 7 #ifndef FPDFSDK_INCLUDE_FSDK_BASEFORM_H_ |
8 #define FPDFSDK_INCLUDE_FSDK_BASEFORM_H_ | 8 #define FPDFSDK_INCLUDE_FSDK_BASEFORM_H_ |
9 | 9 |
10 #if _FX_OS_ == _FX_ANDROID_ | 10 #if _FX_OS_ == _FX_ANDROID_ |
11 #include "time.h" | 11 #include "time.h" |
12 #else | 12 #else |
13 #include <ctime> | 13 #include <ctime> |
14 #endif | 14 #endif |
15 | 15 |
16 #include <map> | 16 #include <map> |
| 17 #include <vector> |
17 | 18 |
18 #include "core/include/fpdfapi/fpdf_parser.h" | 19 #include "core/include/fpdfapi/fpdf_parser.h" |
19 #include "core/include/fpdfdoc/fpdf_doc.h" | 20 #include "core/include/fpdfdoc/fpdf_doc.h" |
20 #include "core/include/fxcrt/fx_basic.h" | 21 #include "core/include/fxcrt/fx_basic.h" |
21 #include "core/include/fxge/fx_dib.h" | 22 #include "core/include/fxge/fx_dib.h" |
22 #include "fsdk_baseannot.h" | 23 #include "fpdfsdk/include/fsdk_baseannot.h" |
23 | 24 |
24 class CFFL_FormFiller; | 25 class CFFL_FormFiller; |
25 class CPDFSDK_Annot; | 26 class CPDFSDK_Annot; |
26 class CPDFSDK_DateTime; | 27 class CPDFSDK_DateTime; |
27 class CPDFSDK_Document; | 28 class CPDFSDK_Document; |
28 class CPDFSDK_InterForm; | 29 class CPDFSDK_InterForm; |
29 class CPDFSDK_PageView; | 30 class CPDFSDK_PageView; |
30 class CPDF_Action; | 31 class CPDF_Action; |
31 class CPDF_FormField; | 32 class CPDF_FormField; |
32 struct CPWL_Color; | 33 struct CPWL_Color; |
(...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
366 static const int kNumFieldTypes = 6; | 367 static const int kNumFieldTypes = 6; |
367 #else // PDF_ENABLE_XFA | 368 #else // PDF_ENABLE_XFA |
368 static const int kNumFieldTypes = 7; | 369 static const int kNumFieldTypes = 7; |
369 #endif // PDF_ENABLE_XFA | 370 #endif // PDF_ENABLE_XFA |
370 | 371 |
371 FX_COLORREF m_aHighlightColor[kNumFieldTypes]; | 372 FX_COLORREF m_aHighlightColor[kNumFieldTypes]; |
372 uint8_t m_iHighlightAlpha; | 373 uint8_t m_iHighlightAlpha; |
373 FX_BOOL m_bNeedHightlight[kNumFieldTypes]; | 374 FX_BOOL m_bNeedHightlight[kNumFieldTypes]; |
374 }; | 375 }; |
375 | 376 |
376 #define BAI_STRUCTURE 0 | |
377 #define BAI_ROW 1 | |
378 #define BAI_COLUMN 2 | |
379 | |
380 #define CPDFSDK_Annots CFX_ArrayTemplate<CPDFSDK_Annot*> | |
381 #define CPDFSDK_SortAnnots CGW_ArrayTemplate<CPDFSDK_Annot*> | |
382 class CBA_AnnotIterator { | 377 class CBA_AnnotIterator { |
383 public: | 378 public: |
| 379 enum TabOrder { STRUCTURE = 0, ROW, COLUMN }; |
| 380 |
384 CBA_AnnotIterator(CPDFSDK_PageView* pPageView, | 381 CBA_AnnotIterator(CPDFSDK_PageView* pPageView, |
385 const CFX_ByteString& sType, | 382 const CFX_ByteString& sType, |
386 const CFX_ByteString& sSubType); | 383 const CFX_ByteString& sSubType); |
387 ~CBA_AnnotIterator(); | 384 ~CBA_AnnotIterator(); |
388 | 385 |
389 CPDFSDK_Annot* GetFirstAnnot(); | 386 CPDFSDK_Annot* GetFirstAnnot(); |
390 CPDFSDK_Annot* GetLastAnnot(); | 387 CPDFSDK_Annot* GetLastAnnot(); |
391 CPDFSDK_Annot* GetNextAnnot(CPDFSDK_Annot* pAnnot); | 388 CPDFSDK_Annot* GetNextAnnot(CPDFSDK_Annot* pAnnot); |
392 CPDFSDK_Annot* GetPrevAnnot(CPDFSDK_Annot* pAnnot); | 389 CPDFSDK_Annot* GetPrevAnnot(CPDFSDK_Annot* pAnnot); |
393 | 390 |
394 private: | 391 private: |
395 void GenerateResults(); | 392 void GenerateResults(); |
396 static int CompareByLeft(CPDFSDK_Annot* p1, CPDFSDK_Annot* p2); | 393 static CPDF_Rect GetAnnotRect(const CPDFSDK_Annot* pAnnot); |
397 static int CompareByTop(CPDFSDK_Annot* p1, CPDFSDK_Annot* p2); | |
398 static CPDF_Rect GetAnnotRect(CPDFSDK_Annot* pAnnot); | |
399 | 394 |
| 395 // Function signature compatible with std::sort(). |
| 396 static bool CompareByLeftAscending(const CPDFSDK_Annot* p1, |
| 397 const CPDFSDK_Annot* p2); |
| 398 static bool CompareByTopDescending(const CPDFSDK_Annot* p1, |
| 399 const CPDFSDK_Annot* p2); |
| 400 |
| 401 TabOrder m_eTabOrder; |
400 CPDFSDK_PageView* m_pPageView; | 402 CPDFSDK_PageView* m_pPageView; |
401 CFX_ByteString m_sType; | 403 CFX_ByteString m_sType; |
402 CFX_ByteString m_sSubType; | 404 CFX_ByteString m_sSubType; |
403 int m_nTabs; | 405 std::vector<CPDFSDK_Annot*> m_Annots; |
404 CPDFSDK_Annots m_Annots; | |
405 }; | 406 }; |
406 | 407 |
407 #endif // FPDFSDK_INCLUDE_FSDK_BASEFORM_H_ | 408 #endif // FPDFSDK_INCLUDE_FSDK_BASEFORM_H_ |
OLD | NEW |