LibreOffice Module sw (master) 1
SearchResultLocator.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 *
9 */
10
11#pragma once
12
13#include <swdllapi.h>
14#include <doc.hxx>
16#include <utility>
17
18namespace sw::search
19{
20enum class NodeType
21{
22 Undefined = 0,
23 WriterNode = 1,
24 CommonNode = 2 // node in a SdrObject
25};
26
28{
31 OUString maObjectName;
32
34
35 SearchIndexData(NodeType eType, SwNodeOffset nNodeIndex, OUString aObjectName = OUString())
36 : meType(eType)
37 , mnNodeIndex(nNodeIndex)
38 , maObjectName(std::move(aObjectName))
39 {
40 }
41};
42
44{
45 bool mbFound = false;
46 std::vector<basegfx::B2DRange> maRectangles;
47};
48
50{
52
53 void findOne(LocationResult& rResult, SearchIndexData const& rSearchIndexData);
54 static bool tryParseJSON(const char* pPayload,
55 std::vector<sw::search::SearchIndexData>& rDataVector);
56 static bool tryParseXML(const char* pPayload,
57 std::vector<sw::search::SearchIndexData>& rDataVector);
58
59public:
61 : mpDocument(pDoc)
62 {
63 }
64
65 LocationResult find(std::vector<SearchIndexData> const& rSearchIndexDataVector);
66 LocationResult findForPayload(const char* pPayload);
67};
68
69} // end sw namespace
70
71/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Definition: doc.hxx:194
DocumentType eType
OSQLColumns::const_iterator find(const OSQLColumns::const_iterator &first, const OSQLColumns::const_iterator &last, std::u16string_view _rVal, const ::comphelper::UStringMixEqual &_rCase)
std::vector< basegfx::B2DRange > maRectangles
SearchIndexData(NodeType eType, SwNodeOffset nNodeIndex, OUString aObjectName=OUString())
#define SW_DLLPUBLIC
Definition: swdllapi.h:28