2001-04-27 04:50:38 +04:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2012-05-21 15:12:37 +04:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
2001-04-27 04:50:38 +04:00
|
|
|
|
|
|
|
/*
|
|
|
|
* The sole purpose of the Find service is to store globally the
|
|
|
|
* last used Find settings
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
#include "nsFindService.h"
|
|
|
|
|
|
|
|
|
|
|
|
nsFindService::nsFindService()
|
2011-10-17 18:59:28 +04:00
|
|
|
: mFindBackwards(false)
|
|
|
|
, mWrapFind(true)
|
|
|
|
, mEntireWord(false)
|
|
|
|
, mMatchCase(false)
|
2001-04-27 04:50:38 +04:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2016-11-16 20:26:14 +03:00
|
|
|
nsFindService::~nsFindService() = default;
|
2001-04-27 04:50:38 +04:00
|
|
|
|
2014-04-27 11:06:00 +04:00
|
|
|
NS_IMPL_ISUPPORTS(nsFindService, nsIFindService)
|
2001-04-27 04:50:38 +04:00
|
|
|
|
2002-03-24 00:23:50 +03:00
|
|
|
NS_IMETHODIMP nsFindService::GetSearchString(nsAString & aSearchString)
|
2001-04-27 04:50:38 +04:00
|
|
|
{
|
|
|
|
aSearchString = mSearchString;
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
2002-03-24 00:23:50 +03:00
|
|
|
NS_IMETHODIMP nsFindService::SetSearchString(const nsAString & aSearchString)
|
2001-04-27 04:50:38 +04:00
|
|
|
{
|
|
|
|
mSearchString = aSearchString;
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
2002-03-24 00:23:50 +03:00
|
|
|
NS_IMETHODIMP nsFindService::GetReplaceString(nsAString & aReplaceString)
|
2001-04-27 04:50:38 +04:00
|
|
|
{
|
|
|
|
aReplaceString = mReplaceString;
|
|
|
|
return NS_OK;
|
|
|
|
}
|
2002-03-24 00:23:50 +03:00
|
|
|
NS_IMETHODIMP nsFindService::SetReplaceString(const nsAString & aReplaceString)
|
2001-04-27 04:50:38 +04:00
|
|
|
{
|
|
|
|
mReplaceString = aReplaceString;
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
2011-09-29 10:19:26 +04:00
|
|
|
NS_IMETHODIMP nsFindService::GetFindBackwards(bool *aFindBackwards)
|
2001-04-27 04:50:38 +04:00
|
|
|
{
|
|
|
|
NS_ENSURE_ARG_POINTER(aFindBackwards);
|
|
|
|
*aFindBackwards = mFindBackwards;
|
|
|
|
return NS_OK;
|
|
|
|
}
|
2011-09-29 10:19:26 +04:00
|
|
|
NS_IMETHODIMP nsFindService::SetFindBackwards(bool aFindBackwards)
|
2001-04-27 04:50:38 +04:00
|
|
|
{
|
|
|
|
mFindBackwards = aFindBackwards;
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
2011-09-29 10:19:26 +04:00
|
|
|
NS_IMETHODIMP nsFindService::GetWrapFind(bool *aWrapFind)
|
2001-04-27 04:50:38 +04:00
|
|
|
{
|
|
|
|
NS_ENSURE_ARG_POINTER(aWrapFind);
|
|
|
|
*aWrapFind = mWrapFind;
|
|
|
|
return NS_OK;
|
|
|
|
}
|
2011-09-29 10:19:26 +04:00
|
|
|
NS_IMETHODIMP nsFindService::SetWrapFind(bool aWrapFind)
|
2001-04-27 04:50:38 +04:00
|
|
|
{
|
|
|
|
mWrapFind = aWrapFind;
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
2011-09-29 10:19:26 +04:00
|
|
|
NS_IMETHODIMP nsFindService::GetEntireWord(bool *aEntireWord)
|
2001-04-27 04:50:38 +04:00
|
|
|
{
|
|
|
|
NS_ENSURE_ARG_POINTER(aEntireWord);
|
|
|
|
*aEntireWord = mEntireWord;
|
|
|
|
return NS_OK;
|
|
|
|
}
|
2011-09-29 10:19:26 +04:00
|
|
|
NS_IMETHODIMP nsFindService::SetEntireWord(bool aEntireWord)
|
2001-04-27 04:50:38 +04:00
|
|
|
{
|
|
|
|
mEntireWord = aEntireWord;
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
2011-09-29 10:19:26 +04:00
|
|
|
NS_IMETHODIMP nsFindService::GetMatchCase(bool *aMatchCase)
|
2001-04-27 04:50:38 +04:00
|
|
|
{
|
|
|
|
NS_ENSURE_ARG_POINTER(aMatchCase);
|
|
|
|
*aMatchCase = mMatchCase;
|
|
|
|
return NS_OK;
|
|
|
|
}
|
2011-09-29 10:19:26 +04:00
|
|
|
NS_IMETHODIMP nsFindService::SetMatchCase(bool aMatchCase)
|
2001-04-27 04:50:38 +04:00
|
|
|
{
|
|
|
|
mMatchCase = aMatchCase;
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|