summaryrefslogtreecommitdiff
path: root/core/fpdftext/include/cpdf_linkextract.h
diff options
context:
space:
mode:
authordsinclair <dsinclair@chromium.org>2016-04-19 10:39:24 -0700
committerCommit bot <commit-bot@chromium.org>2016-04-19 10:39:24 -0700
commita28ae388f3859c52630deb6ef3d0ea468e5177e3 (patch)
tree1ab55ded754a5d1fc6ab5702e9d2244e5830ed68 /core/fpdftext/include/cpdf_linkextract.h
parent11178284eccf22306338cf0d252b8dbb946feb16 (diff)
downloadpdfium-a28ae388f3859c52630deb6ef3d0ea468e5177e3.tar.xz
Remove IPDF_TextPage, IPDF_TextPageFind and IPDF_LinkExtract interfaces.
Each was only used by one subclass. Removed and used the concrete classes. BUG=pdfium:468 Review URL: https://codereview.chromium.org/1897993002
Diffstat (limited to 'core/fpdftext/include/cpdf_linkextract.h')
-rw-r--r--core/fpdftext/include/cpdf_linkextract.h54
1 files changed, 54 insertions, 0 deletions
diff --git a/core/fpdftext/include/cpdf_linkextract.h b/core/fpdftext/include/cpdf_linkextract.h
new file mode 100644
index 0000000000..263768ee5d
--- /dev/null
+++ b/core/fpdftext/include/cpdf_linkextract.h
@@ -0,0 +1,54 @@
+// Copyright 2014 PDFium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+
+#ifndef CORE_FPDFTEXT_INCLUDE_CPDF_LINKEXTRACT_H_
+#define CORE_FPDFTEXT_INCLUDE_CPDF_LINKEXTRACT_H_
+
+#include "core/fxcrt/include/fx_basic.h"
+#include "core/fxcrt/include/fx_coordinates.h"
+#include "core/fxcrt/include/fx_string.h"
+#include "core/fxcrt/include/fx_system.h"
+
+class CPDF_TextPage;
+
+class CPDF_LinkExt {
+ public:
+ CPDF_LinkExt() {}
+ ~CPDF_LinkExt() {}
+
+ int m_Start;
+ int m_Count;
+ CFX_WideString m_strUrl;
+};
+
+class CPDF_LinkExtract {
+ public:
+ CPDF_LinkExtract();
+ ~CPDF_LinkExtract();
+
+ FX_BOOL ExtractLinks(const CPDF_TextPage* pTextPage);
+ int CountLinks() const;
+ CFX_WideString GetURL(int index) const;
+ void GetBoundedSegment(int index, int& start, int& count) const;
+ void GetRects(int index, CFX_RectArray& rects) const;
+
+ FX_BOOL IsExtract() const { return m_bIsParsed; }
+
+ protected:
+ void ParseLink();
+ void DeleteLinkList();
+ FX_BOOL CheckWebLink(CFX_WideString& strBeCheck);
+ bool CheckMailLink(CFX_WideString& str);
+ void AppendToLinkList(int start, int count, const CFX_WideString& strUrl);
+
+ private:
+ CFX_ArrayTemplate<CPDF_LinkExt*> m_LinkList;
+ const CPDF_TextPage* m_pTextPage;
+ CFX_WideString m_strPageText;
+ bool m_bIsParsed;
+};
+
+#endif // CORE_FPDFTEXT_INCLUDE_CPDF_LINKEXTRACT_H_