Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
cpdf_linkextract.h
Go to the documentation of this file.
1// Copyright 2014 The PDFium Authors
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6
7#ifndef CORE_FPDFTEXT_CPDF_LINKEXTRACT_H_
8#define CORE_FPDFTEXT_CPDF_LINKEXTRACT_H_
9
10#include <stddef.h>
11#include <stdint.h>
12
13#include <vector>
14
15#include "core/fxcrt/fx_coordinates.h"
16#include "core/fxcrt/unowned_ptr.h"
17#include "core/fxcrt/widestring.h"
18#include "third_party/abseil-cpp/absl/types/optional.h"
19
20class CPDF_TextPage;
21
23 public:
28
29 explicit CPDF_LinkExtract(const CPDF_TextPage* pTextPage);
31
32 void ExtractLinks();
33 size_t CountLinks() const { return m_LinkArray.size(); }
34 WideString GetURL(size_t index) const;
35 std::vector<CFX_FloatRect> GetRects(size_t index) const;
36 absl::optional<Range> GetTextRange(size_t index) const;
37
38 protected:
39 struct Link : public Range {
40 WideString m_strUrl;
41 };
42
43 absl::optional<Link> CheckWebLink(const WideString& str);
44 bool CheckMailLink(WideString* str);
45
48};
49
50#endif // CORE_FPDFTEXT_CPDF_LINKEXTRACT_H_
std::vector< CFX_FloatRect > GetRects(size_t index) const
WideString GetURL(size_t index) const
UnownedPtr< const CPDF_TextPage > const m_pTextPage
absl::optional< Range > GetTextRange(size_t index) const
CPDF_LinkExtract(const CPDF_TextPage *pTextPage)
absl::optional< Link > CheckWebLink(const WideString &str)
std::vector< Link > m_LinkArray
bool CheckMailLink(WideString *str)
size_t CountLinks() const
WideString & operator=(WideString &&that) noexcept
void TrimRight(wchar_t target)
CharType Back() const
Definition widestring.h:152
bool FXSYS_iswalnum(wchar_t c)
WideString operator+(const wchar_t *str1, const WideString &str2)
Definition widestring.h:281