OLD | NEW |
1 // Copyright 2016 PDFium Authors. All rights reserved. | 1 // Copyright 2016 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_FPDFTEXT_INCLUDE_CPDF_TEXTPAGEFIND_H_ | 7 #ifndef CORE_FPDFTEXT_INCLUDE_CPDF_TEXTPAGEFIND_H_ |
8 #define CORE_FPDFTEXT_INCLUDE_CPDF_TEXTPAGEFIND_H_ | 8 #define CORE_FPDFTEXT_INCLUDE_CPDF_TEXTPAGEFIND_H_ |
9 | 9 |
10 #include <vector> | 10 #include <vector> |
11 | 11 |
12 #include "core/fxcrt/include/fx_coordinates.h" | 12 #include "core/fxcrt/include/fx_coordinates.h" |
13 #include "core/fxcrt/include/fx_string.h" | 13 #include "core/fxcrt/include/fx_string.h" |
14 #include "core/fxcrt/include/fx_system.h" | 14 #include "core/fxcrt/include/fx_system.h" |
15 | 15 |
16 class CPDF_TextPage; | 16 class CPDF_TextPage; |
17 | 17 |
18 class CPDF_TextPageFind { | 18 class CPDF_TextPageFind { |
19 public: | 19 public: |
20 explicit CPDF_TextPageFind(const CPDF_TextPage* pTextPage); | 20 explicit CPDF_TextPageFind(const CPDF_TextPage* pTextPage); |
21 ~CPDF_TextPageFind() {} | 21 ~CPDF_TextPageFind() {} |
22 | 22 |
23 FX_BOOL FindFirst(const CFX_WideString& findwhat, | 23 FX_BOOL FindFirst(const CFX_WideString& findwhat, |
24 int flags, | 24 int flags, |
25 int startPos = 0); | 25 int startPos = 0); |
26 FX_BOOL FindNext(); | 26 FX_BOOL FindNext(); |
27 FX_BOOL FindPrev(); | 27 FX_BOOL FindPrev(); |
28 void GetRectArray(CFX_RectArray& rects) const; | |
29 int GetCurOrder() const; | 28 int GetCurOrder() const; |
30 int GetMatchedCount() const; | 29 int GetMatchedCount() const; |
31 | 30 |
32 protected: | 31 protected: |
33 void ExtractFindWhat(const CFX_WideString& findwhat); | 32 void ExtractFindWhat(const CFX_WideString& findwhat); |
34 FX_BOOL IsMatchWholeWord(const CFX_WideString& csPageText, | 33 FX_BOOL IsMatchWholeWord(const CFX_WideString& csPageText, |
35 int startPos, | 34 int startPos, |
36 int endPos); | 35 int endPos); |
37 FX_BOOL ExtractSubString(CFX_WideString& rString, | 36 FX_BOOL ExtractSubString(CFX_WideString& rString, |
38 const FX_WCHAR* lpszFullString, | 37 const FX_WCHAR* lpszFullString, |
(...skipping 12 matching lines...) Expand all Loading... |
51 CFX_WideString m_strText; | 50 CFX_WideString m_strText; |
52 CFX_WideString m_findWhat; | 51 CFX_WideString m_findWhat; |
53 int m_flags; | 52 int m_flags; |
54 std::vector<CFX_WideString> m_csFindWhatArray; | 53 std::vector<CFX_WideString> m_csFindWhatArray; |
55 int m_findNextStart; | 54 int m_findNextStart; |
56 int m_findPreStart; | 55 int m_findPreStart; |
57 FX_BOOL m_bMatchCase; | 56 FX_BOOL m_bMatchCase; |
58 FX_BOOL m_bMatchWholeWord; | 57 FX_BOOL m_bMatchWholeWord; |
59 int m_resStart; | 58 int m_resStart; |
60 int m_resEnd; | 59 int m_resEnd; |
61 CFX_RectArray m_resArray; | 60 std::vector<CFX_FloatRect> m_resArray; |
62 FX_BOOL m_IsFind; | 61 FX_BOOL m_IsFind; |
63 }; | 62 }; |
64 | 63 |
65 #endif // CORE_FPDFTEXT_INCLUDE_CPDF_TEXTPAGEFIND_H_ | 64 #endif // CORE_FPDFTEXT_INCLUDE_CPDF_TEXTPAGEFIND_H_ |
OLD | NEW |