2007-03-22 10:30:00 -07:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2012-05-21 04:12:37 -07: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/. */
|
2007-03-22 10:30:00 -07: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 07:59:28 -07:00
|
|
|
: mFindBackwards(false)
|
|
|
|
, mWrapFind(true)
|
|
|
|
, mEntireWord(false)
|
|
|
|
, mMatchCase(false)
|
2007-03-22 10:30:00 -07:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
nsFindService::~nsFindService()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
NS_IMPL_ISUPPORTS1(nsFindService, nsIFindService)
|
|
|
|
|
|
|
|
/* attribute AString searchString; */
|
|
|
|
NS_IMETHODIMP nsFindService::GetSearchString(nsAString & aSearchString)
|
|
|
|
{
|
|
|
|
aSearchString = mSearchString;
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
NS_IMETHODIMP nsFindService::SetSearchString(const nsAString & aSearchString)
|
|
|
|
{
|
|
|
|
mSearchString = aSearchString;
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* attribute AString replaceString; */
|
|
|
|
NS_IMETHODIMP nsFindService::GetReplaceString(nsAString & aReplaceString)
|
|
|
|
{
|
|
|
|
aReplaceString = mReplaceString;
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
NS_IMETHODIMP nsFindService::SetReplaceString(const nsAString & aReplaceString)
|
|
|
|
{
|
|
|
|
mReplaceString = aReplaceString;
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* attribute boolean findBackwards; */
|
2011-09-28 23:19:26 -07:00
|
|
|
NS_IMETHODIMP nsFindService::GetFindBackwards(bool *aFindBackwards)
|
2007-03-22 10:30:00 -07:00
|
|
|
{
|
|
|
|
NS_ENSURE_ARG_POINTER(aFindBackwards);
|
|
|
|
*aFindBackwards = mFindBackwards;
|
|
|
|
return NS_OK;
|
|
|
|
}
|
2011-09-28 23:19:26 -07:00
|
|
|
NS_IMETHODIMP nsFindService::SetFindBackwards(bool aFindBackwards)
|
2007-03-22 10:30:00 -07:00
|
|
|
{
|
|
|
|
mFindBackwards = aFindBackwards;
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* attribute boolean wrapFind; */
|
2011-09-28 23:19:26 -07:00
|
|
|
NS_IMETHODIMP nsFindService::GetWrapFind(bool *aWrapFind)
|
2007-03-22 10:30:00 -07:00
|
|
|
{
|
|
|
|
NS_ENSURE_ARG_POINTER(aWrapFind);
|
|
|
|
*aWrapFind = mWrapFind;
|
|
|
|
return NS_OK;
|
|
|
|
}
|
2011-09-28 23:19:26 -07:00
|
|
|
NS_IMETHODIMP nsFindService::SetWrapFind(bool aWrapFind)
|
2007-03-22 10:30:00 -07:00
|
|
|
{
|
|
|
|
mWrapFind = aWrapFind;
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* attribute boolean entireWord; */
|
2011-09-28 23:19:26 -07:00
|
|
|
NS_IMETHODIMP nsFindService::GetEntireWord(bool *aEntireWord)
|
2007-03-22 10:30:00 -07:00
|
|
|
{
|
|
|
|
NS_ENSURE_ARG_POINTER(aEntireWord);
|
|
|
|
*aEntireWord = mEntireWord;
|
|
|
|
return NS_OK;
|
|
|
|
}
|
2011-09-28 23:19:26 -07:00
|
|
|
NS_IMETHODIMP nsFindService::SetEntireWord(bool aEntireWord)
|
2007-03-22 10:30:00 -07:00
|
|
|
{
|
|
|
|
mEntireWord = aEntireWord;
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* attribute boolean matchCase; */
|
2011-09-28 23:19:26 -07:00
|
|
|
NS_IMETHODIMP nsFindService::GetMatchCase(bool *aMatchCase)
|
2007-03-22 10:30:00 -07:00
|
|
|
{
|
|
|
|
NS_ENSURE_ARG_POINTER(aMatchCase);
|
|
|
|
*aMatchCase = mMatchCase;
|
|
|
|
return NS_OK;
|
|
|
|
}
|
2011-09-28 23:19:26 -07:00
|
|
|
NS_IMETHODIMP nsFindService::SetMatchCase(bool aMatchCase)
|
2007-03-22 10:30:00 -07:00
|
|
|
{
|
|
|
|
mMatchCase = aMatchCase;
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|