diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2020-05-07 22:01:22 +0200 |
---|---|---|
committer | Tomaž Vajngerl <quikee@gmail.com> | 2020-06-01 10:43:46 +0200 |
commit | efba780d6155317b592b6f5f73945a7851ec4d3b (patch) | |
tree | 94c513fa2d639fc9f9fff7cabb9a974501694424 /include | |
parent | 1ee221ad65ff5e3a725e80777406ac7f94ff3a72 (diff) |
vcl: VectorGraphicSearch - for searching text inside PDF
Change-Id: Iee940a3927330c8739774ff3c1af15998f89193b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95254
Tested-by: Tomaž Vajngerl <quikee@gmail.com>
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/vcl/VectorGraphicSearch.hxx | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/include/vcl/VectorGraphicSearch.hxx b/include/vcl/VectorGraphicSearch.hxx new file mode 100644 index 000000000000..3411d0a931e6 --- /dev/null +++ b/include/vcl/VectorGraphicSearch.hxx @@ -0,0 +1,39 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + */ + +#pragma once + +#include <vcl/graph.hxx> +#include <vcl/vectorgraphicdata.hxx> +#include <vcl/dllapi.h> + +#include <fpdf_doc.h> + +#include <memory> + +class SearchContext; + +class VCL_DLLPUBLIC VectorGraphicSearch final +{ +private: + Graphic maGraphic; + FPDF_DOCUMENT mpPdfDocument; + std::unique_ptr<SearchContext> mpSearchContext; + bool searchPDF(std::shared_ptr<VectorGraphicData> const& rData, OUString const& rSearchString); + +public: + VectorGraphicSearch(Graphic const& rGraphic); + ~VectorGraphicSearch(); + bool search(OUString const& rSearchString); + bool next(); + int index(); +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |