michael@0: /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: /* michael@0: * The sole purpose of the Find service is to store globally the michael@0: * last used Find settings michael@0: * michael@0: */ michael@0: michael@0: michael@0: #include "nsFindService.h" michael@0: michael@0: michael@0: nsFindService::nsFindService() michael@0: : mFindBackwards(false) michael@0: , mWrapFind(true) michael@0: , mEntireWord(false) michael@0: , mMatchCase(false) michael@0: { michael@0: } michael@0: michael@0: michael@0: nsFindService::~nsFindService() michael@0: { michael@0: } michael@0: michael@0: NS_IMPL_ISUPPORTS(nsFindService, nsIFindService) michael@0: michael@0: /* attribute AString searchString; */ michael@0: NS_IMETHODIMP nsFindService::GetSearchString(nsAString & aSearchString) michael@0: { michael@0: aSearchString = mSearchString; michael@0: return NS_OK; michael@0: } michael@0: michael@0: NS_IMETHODIMP nsFindService::SetSearchString(const nsAString & aSearchString) michael@0: { michael@0: mSearchString = aSearchString; michael@0: return NS_OK; michael@0: } michael@0: michael@0: /* attribute AString replaceString; */ michael@0: NS_IMETHODIMP nsFindService::GetReplaceString(nsAString & aReplaceString) michael@0: { michael@0: aReplaceString = mReplaceString; michael@0: return NS_OK; michael@0: } michael@0: NS_IMETHODIMP nsFindService::SetReplaceString(const nsAString & aReplaceString) michael@0: { michael@0: mReplaceString = aReplaceString; michael@0: return NS_OK; michael@0: } michael@0: michael@0: /* attribute boolean findBackwards; */ michael@0: NS_IMETHODIMP nsFindService::GetFindBackwards(bool *aFindBackwards) michael@0: { michael@0: NS_ENSURE_ARG_POINTER(aFindBackwards); michael@0: *aFindBackwards = mFindBackwards; michael@0: return NS_OK; michael@0: } michael@0: NS_IMETHODIMP nsFindService::SetFindBackwards(bool aFindBackwards) michael@0: { michael@0: mFindBackwards = aFindBackwards; michael@0: return NS_OK; michael@0: } michael@0: michael@0: /* attribute boolean wrapFind; */ michael@0: NS_IMETHODIMP nsFindService::GetWrapFind(bool *aWrapFind) michael@0: { michael@0: NS_ENSURE_ARG_POINTER(aWrapFind); michael@0: *aWrapFind = mWrapFind; michael@0: return NS_OK; michael@0: } michael@0: NS_IMETHODIMP nsFindService::SetWrapFind(bool aWrapFind) michael@0: { michael@0: mWrapFind = aWrapFind; michael@0: return NS_OK; michael@0: } michael@0: michael@0: /* attribute boolean entireWord; */ michael@0: NS_IMETHODIMP nsFindService::GetEntireWord(bool *aEntireWord) michael@0: { michael@0: NS_ENSURE_ARG_POINTER(aEntireWord); michael@0: *aEntireWord = mEntireWord; michael@0: return NS_OK; michael@0: } michael@0: NS_IMETHODIMP nsFindService::SetEntireWord(bool aEntireWord) michael@0: { michael@0: mEntireWord = aEntireWord; michael@0: return NS_OK; michael@0: } michael@0: michael@0: /* attribute boolean matchCase; */ michael@0: NS_IMETHODIMP nsFindService::GetMatchCase(bool *aMatchCase) michael@0: { michael@0: NS_ENSURE_ARG_POINTER(aMatchCase); michael@0: *aMatchCase = mMatchCase; michael@0: return NS_OK; michael@0: } michael@0: NS_IMETHODIMP nsFindService::SetMatchCase(bool aMatchCase) michael@0: { michael@0: mMatchCase = aMatchCase; michael@0: return NS_OK; michael@0: } michael@0: