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 
17 namespace sw::search
18 {
19 enum class NodeType
20 {
21  Undefined = 0,
22  WriterNode = 1,
23  CommonNode = 2 // node in a SdrObject
24 };
25 
27 {
30  OUString maObjectName;
31 
33 
35  OUString const& aObjectName = OUString())
36  : meType(eType)
37  , mnNodeIndex(nNodeIndex)
38  , maObjectName(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 
59 public:
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:187
OSQLColumns::const_iterator find(const OSQLColumns::const_iterator &first, const OSQLColumns::const_iterator &last, std::u16string_view _rVal, const ::comphelper::UStringMixEqual &_rCase)
#define SW_DLLPUBLIC
Definition: swdllapi.h:28
std::vector< basegfx::B2DRange > maRectangles
SearchIndexData(NodeType eType, SwNodeOffset nNodeIndex, OUString const &aObjectName=OUString())