summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2020-05-07 22:01:22 +0200
committerTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2020-07-29 20:43:19 +0200
commit71adf9126b99405d7928b0d4295d586e4551ac12 (patch)
treeb6fd7f48829d618185cc80d5470f4830cffef69f /include
parent7b9cbd12fde96242ddb6fc6467010ae5611cead8 (diff)
vcl: VectorGraphicSearch - for searching text inside PDF
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95254 Tested-by: Tomaž Vajngerl <quikee@gmail.com> Reviewed-by: Tomaž Vajngerl <quikee@gmail.com> (cherry picked from commit efba780d6155317b592b6f5f73945a7851ec4d3b) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95801 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Tomaž Vajngerl <quikee@gmail.com> (cherry picked from commit c0de8e44e92c8d83c98afe8f807deb2633b3d2bd) Change-Id: Iee940a3927330c8739774ff3c1af15998f89193b
Diffstat (limited to 'include')
-rw-r--r--include/vcl/VectorGraphicSearch.hxx39
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: */