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 {
29  sal_Int32 mnNodeIndex = 0;
30  OUString maObjectName;
31 
33 
34  SearchIndexData(NodeType eType, sal_Int32 nNodeIndex, OUString const& aObjectName = OUString())
35  : meType(eType)
36  , mnNodeIndex(nNodeIndex)
37  , maObjectName(aObjectName)
38  {
39  }
40 };
41 
43 {
44  bool mbFound = false;
45  std::vector<basegfx::B2DRange> maRectangles;
46 };
47 
49 {
51 
52  void findOne(LocationResult& rResult, SearchIndexData const& rSearchIndexData);
53  static bool tryParseJSON(const char* pPayload,
54  std::vector<sw::search::SearchIndexData>& rDataVector);
55  static bool tryParseXML(const char* pPayload,
56  std::vector<sw::search::SearchIndexData>& rDataVector);
57 
58 public:
60  : mpDocument(pDoc)
61  {
62  }
63 
64  LocationResult find(std::vector<SearchIndexData> const& rSearchIndexDataVector);
65  LocationResult findForPayload(const char* pPayload);
66 };
67 
68 } // end sw namespace
69 
70 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Definition: doc.hxx:188
OSQLColumns::const_iterator find(const OSQLColumns::const_iterator &first, const OSQLColumns::const_iterator &last, std::u16string_view _rVal, const ::comphelper::UStringMixEqual &_rCase)
SearchIndexData(NodeType eType, sal_Int32 nNodeIndex, OUString const &aObjectName=OUString())
#define SW_DLLPUBLIC
Definition: swdllapi.h:28
std::vector< basegfx::B2DRange > maRectangles