1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 * The sole purpose of the Find service is to store globally the
8 * last used Find settings
12 #include "nsFindService.h"
14 nsFindService::nsFindService()
15 : mFindBackwards(false),
20 nsFindService::~nsFindService() = default;
22 NS_IMPL_ISUPPORTS(nsFindService
, nsIFindService
)
24 NS_IMETHODIMP
nsFindService::GetSearchString(nsAString
& aSearchString
) {
25 aSearchString
= mSearchString
;
29 NS_IMETHODIMP
nsFindService::SetSearchString(const nsAString
& aSearchString
) {
30 mSearchString
= aSearchString
;
34 NS_IMETHODIMP
nsFindService::GetReplaceString(nsAString
& aReplaceString
) {
35 aReplaceString
= mReplaceString
;
38 NS_IMETHODIMP
nsFindService::SetReplaceString(const nsAString
& aReplaceString
) {
39 mReplaceString
= aReplaceString
;
43 NS_IMETHODIMP
nsFindService::GetFindBackwards(bool* aFindBackwards
) {
44 NS_ENSURE_ARG_POINTER(aFindBackwards
);
45 *aFindBackwards
= mFindBackwards
;
48 NS_IMETHODIMP
nsFindService::SetFindBackwards(bool aFindBackwards
) {
49 mFindBackwards
= aFindBackwards
;
53 NS_IMETHODIMP
nsFindService::GetWrapFind(bool* aWrapFind
) {
54 NS_ENSURE_ARG_POINTER(aWrapFind
);
55 *aWrapFind
= mWrapFind
;
58 NS_IMETHODIMP
nsFindService::SetWrapFind(bool aWrapFind
) {
59 mWrapFind
= aWrapFind
;
63 NS_IMETHODIMP
nsFindService::GetEntireWord(bool* aEntireWord
) {
64 NS_ENSURE_ARG_POINTER(aEntireWord
);
65 *aEntireWord
= mEntireWord
;
68 NS_IMETHODIMP
nsFindService::SetEntireWord(bool aEntireWord
) {
69 mEntireWord
= aEntireWord
;
73 NS_IMETHODIMP
nsFindService::GetMatchCase(bool* aMatchCase
) {
74 NS_ENSURE_ARG_POINTER(aMatchCase
);
75 *aMatchCase
= mMatchCase
;
78 NS_IMETHODIMP
nsFindService::SetMatchCase(bool aMatchCase
) {
79 mMatchCase
= aMatchCase
;
83 NS_IMETHODIMP
nsFindService::GetMatchDiacritics(bool* aMatchDiacritics
) {
84 NS_ENSURE_ARG_POINTER(aMatchDiacritics
);
85 *aMatchDiacritics
= mMatchDiacritics
;
88 NS_IMETHODIMP
nsFindService::SetMatchDiacritics(bool aMatchDiacritics
) {
89 mMatchDiacritics
= aMatchDiacritics
;