LibreOffice Module sw (master)
1
Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
sw
source
core
inc
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
>
15
#include <
basegfx/range/b2drange.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
26
struct
SearchIndexData
27
{
28
NodeType
meType
=
NodeType::Undefined
;
29
SwNodeOffset
mnNodeIndex
{ 0 };
30
OUString
maObjectName
;
31
32
SearchIndexData
() {}
33
34
SearchIndexData
(
NodeType
eType,
SwNodeOffset
nNodeIndex,
35
OUString
const
& aObjectName = OUString())
36
: meType(eType)
37
,
mnNodeIndex
(nNodeIndex)
38
, maObjectName(aObjectName)
39
{
40
}
41
};
42
43
struct
LocationResult
44
{
45
bool
mbFound
=
false
;
46
std::vector<basegfx::B2DRange>
maRectangles
;
47
};
48
49
class
SW_DLLPUBLIC
SearchResultLocator
50
{
51
SwDoc
*
mpDocument
;
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
:
60
SearchResultLocator
(
SwDoc
* pDoc)
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: */
sw::search::SearchIndexData::SearchIndexData
SearchIndexData()
Definition:
SearchResultLocator.hxx:32
sw::search::LocationResult
Definition:
SearchResultLocator.hxx:43
SwDoc
Definition:
doc.hxx:187
sw::search::SearchResultLocator::mpDocument
SwDoc * mpDocument
Definition:
SearchResultLocator.hxx:51
find
OSQLColumns::const_iterator find(const OSQLColumns::const_iterator &first, const OSQLColumns::const_iterator &last, std::u16string_view _rVal, const ::comphelper::UStringMixEqual &_rCase)
doc.hxx
o3tl::strong_int< sal_Int32, struct Tag_SwNodeOffset >
sw::search::NodeType::WriterNode
sw::search::SearchIndexData::mnNodeIndex
SwNodeOffset mnNodeIndex
Definition:
SearchResultLocator.hxx:29
sw::search::SearchIndexData::meType
NodeType meType
Definition:
SearchResultLocator.hxx:28
SW_DLLPUBLIC
#define SW_DLLPUBLIC
Definition:
swdllapi.h:28
sw::search::SearchIndexData
Definition:
SearchResultLocator.hxx:26
sw::search::SearchResultLocator
Definition:
SearchResultLocator.hxx:49
sw::search::SearchIndexData::maObjectName
OUString maObjectName
Definition:
SearchResultLocator.hxx:30
sw::search::LocationResult::mbFound
bool mbFound
Definition:
SearchResultLocator.hxx:45
swdllapi.h
sw::search::SearchResultLocator::SearchResultLocator
SearchResultLocator(SwDoc *pDoc)
Definition:
SearchResultLocator.hxx:60
sw::search::LocationResult::maRectangles
std::vector< basegfx::B2DRange > maRectangles
Definition:
SearchResultLocator.hxx:46
sw::search::SearchIndexData::SearchIndexData
SearchIndexData(NodeType eType, SwNodeOffset nNodeIndex, OUString const &aObjectName=OUString())
Definition:
SearchResultLocator.hxx:34
sw::search::NodeType::CommonNode
sw::search::NodeType::Undefined
sw::search
Definition:
SearchResultLocator.hxx:17
b2drange.hxx
sw::search::NodeType
NodeType
Definition:
SearchResultLocator.hxx:19
Generated on Tue May 17 2022 12:15:51 for LibreOffice Module sw (master) by
1.8.10