LibreOffice Module i18nutil (master) 1
searchopt.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 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19#ifndef INCLUDED_I18NUTIL_SEARCHOPT_HXX
20#define INCLUDED_I18NUTIL_SEARCHOPT_HXX
21
22#include <sal/types.h>
23#include <com/sun/star/lang/Locale.hpp>
24#include <com/sun/star/util/SearchAlgorithms.hpp>
25#include <com/sun/star/util/SearchOptions2.hpp>
27#include <utility>
28
29namespace i18nutil
30{
31
37 css::util::SearchAlgorithms algorithmType;
38 sal_Int32 searchFlag;
39 OUString searchString;
40 OUString replaceString;
41 css::lang::Locale Locale;
42 sal_Int32 changedChars;
43 sal_Int32 deletedChars;
44 sal_Int32 insertedChars;
46
47 SearchOptions& operator=(css::util::SearchOptions const & other)
48 {
49 algorithmType = other.algorithmType;
50 searchFlag = other.searchFlag;
51 searchString = other.searchString;
52 replaceString = other.replaceString;
53 Locale = other.Locale;
54 changedChars = other.changedChars;
55 deletedChars = other.deletedChars;
56 insertedChars = other.insertedChars;
57 transliterateFlags = static_cast<TransliterationFlags>(other.transliterateFlags);
58 return *this;
59 }
60
62 : algorithmType(::css::util::SearchAlgorithms_ABSOLUTE)
63 , searchFlag(0)
64 , changedChars(0)
65 , deletedChars(0)
66 , insertedChars(0)
67 , transliterateFlags(TransliterationFlags::NONE)
68 {
69 }
70
71 SearchOptions(const css::util::SearchAlgorithms& algorithmType_, const sal_Int32 searchFlag_,
72 OUString searchString_, OUString replaceString_,
73 css::lang::Locale Locale_,
74 const sal_Int32 changedChars_, const sal_Int32 deletedChars_, const sal_Int32 insertedChars_,
75 const TransliterationFlags& transliterateFlags_)
76 : algorithmType(algorithmType_)
77 , searchFlag(searchFlag_)
78 , searchString(std::move(searchString_))
79 , replaceString(std::move(replaceString_))
80 , Locale(std::move(Locale_))
81 , changedChars(changedChars_)
82 , deletedChars(deletedChars_)
83 , insertedChars(insertedChars_)
84 , transliterateFlags(transliterateFlags_)
85 {
86 }
87};
88
94
95 sal_Int16 AlgorithmType2;
97
98 SearchOptions2& operator=(css::util::SearchOptions2 const & other)
99 {
101 AlgorithmType2 = other.AlgorithmType2;
102 WildcardEscapeCharacter = other.WildcardEscapeCharacter;
103 return *this;
104 }
105
106
107 css::util::SearchOptions2 toUnoSearchOptions2() const
108 {
109 return css::util::SearchOptions2(algorithmType, searchFlag,
110 searchString, replaceString,
111 Locale,
112 changedChars, deletedChars, insertedChars,
113 static_cast<sal_Int32>(transliterateFlags),
114 AlgorithmType2, WildcardEscapeCharacter);
115 }
116
118 : AlgorithmType2(0)
119 , WildcardEscapeCharacter(0)
120 {}
121
122 SearchOptions2(const css::util::SearchAlgorithms& algorithmType_, const sal_Int32 searchFlag_,
123 const OUString& searchString_, const OUString& replaceString_,
124 const css::lang::Locale& Locale_,
125 const sal_Int32 changedChars_, const sal_Int32 deletedChars_, const sal_Int32 insertedChars_,
126 const TransliterationFlags& transliterateFlags_,
127 const sal_Int16 AlgorithmType2_, const sal_Int32 WildcardEscapeCharacter_)
128 : SearchOptions(algorithmType_, searchFlag_, searchString_, replaceString_, Locale_, changedChars_, deletedChars_, insertedChars_, transliterateFlags_)
129 , AlgorithmType2(AlgorithmType2_)
130 , WildcardEscapeCharacter(WildcardEscapeCharacter_)
131 {}
132};
133
134}; // namespace
135
136#endif
137
138/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
NONE
This is a wrapper around com::sun::star::util::SearchOptions and SearchOptions2, but using the more t...
Definition: searchopt.hxx:93
SearchOptions2(const css::util::SearchAlgorithms &algorithmType_, const sal_Int32 searchFlag_, const OUString &searchString_, const OUString &replaceString_, const css::lang::Locale &Locale_, const sal_Int32 changedChars_, const sal_Int32 deletedChars_, const sal_Int32 insertedChars_, const TransliterationFlags &transliterateFlags_, const sal_Int16 AlgorithmType2_, const sal_Int32 WildcardEscapeCharacter_)
Definition: searchopt.hxx:122
css::util::SearchOptions2 toUnoSearchOptions2() const
Definition: searchopt.hxx:107
SearchOptions2 & operator=(css::util::SearchOptions2 const &other)
Definition: searchopt.hxx:98
sal_Int32 WildcardEscapeCharacter
Definition: searchopt.hxx:96
This is a wrapper around com::sun::star::util::SearchOptions but using the more type-safe Translitera...
Definition: searchopt.hxx:36
SearchOptions & operator=(css::util::SearchOptions const &other)
Definition: searchopt.hxx:47
css::lang::Locale Locale
Definition: searchopt.hxx:41
SearchOptions(const css::util::SearchAlgorithms &algorithmType_, const sal_Int32 searchFlag_, OUString searchString_, OUString replaceString_, css::lang::Locale Locale_, const sal_Int32 changedChars_, const sal_Int32 deletedChars_, const sal_Int32 insertedChars_, const TransliterationFlags &transliterateFlags_)
Definition: searchopt.hxx:71
css::util::SearchAlgorithms algorithmType
Definition: searchopt.hxx:37
TransliterationFlags transliterateFlags
Definition: searchopt.hxx:45
TransliterationFlags
This is a superset type of the com::sun::star::i18n::TransliterationModules and TransliterationModule...
#define SAL_WARN_UNUSED