1*cdf0e10cSrcweir /*************************************************************************
2*cdf0e10cSrcweir  *
3*cdf0e10cSrcweir  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4*cdf0e10cSrcweir  *
5*cdf0e10cSrcweir  * Copyright 2000, 2010 Oracle and/or its affiliates.
6*cdf0e10cSrcweir  *
7*cdf0e10cSrcweir  * OpenOffice.org - a multi-platform office productivity suite
8*cdf0e10cSrcweir  *
9*cdf0e10cSrcweir  * This file is part of OpenOffice.org.
10*cdf0e10cSrcweir  *
11*cdf0e10cSrcweir  * OpenOffice.org is free software: you can redistribute it and/or modify
12*cdf0e10cSrcweir  * it under the terms of the GNU Lesser General Public License version 3
13*cdf0e10cSrcweir  * only, as published by the Free Software Foundation.
14*cdf0e10cSrcweir  *
15*cdf0e10cSrcweir  * OpenOffice.org is distributed in the hope that it will be useful,
16*cdf0e10cSrcweir  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17*cdf0e10cSrcweir  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18*cdf0e10cSrcweir  * GNU Lesser General Public License version 3 for more details
19*cdf0e10cSrcweir  * (a copy is included in the LICENSE file that accompanied this code).
20*cdf0e10cSrcweir  *
21*cdf0e10cSrcweir  * You should have received a copy of the GNU Lesser General Public License
22*cdf0e10cSrcweir  * version 3 along with OpenOffice.org.  If not, see
23*cdf0e10cSrcweir  * <http://www.openoffice.org/license.html>
24*cdf0e10cSrcweir  * for a copy of the LGPLv3 License.
25*cdf0e10cSrcweir  *
26*cdf0e10cSrcweir  ************************************************************************/
27*cdf0e10cSrcweir 
28*cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove
29*cdf0e10cSrcweir #include "precompiled_unotools.hxx"
30*cdf0e10cSrcweir 
31*cdf0e10cSrcweir #include <unotools/searchopt.hxx>
32*cdf0e10cSrcweir #include <tools/solar.h>
33*cdf0e10cSrcweir #include <tools/debug.hxx>
34*cdf0e10cSrcweir #include <unotools/configitem.hxx>
35*cdf0e10cSrcweir #include <com/sun/star/i18n/TransliterationModules.hpp>
36*cdf0e10cSrcweir #include <com/sun/star/uno/Sequence.hxx>
37*cdf0e10cSrcweir #include <com/sun/star/uno/Any.h>
38*cdf0e10cSrcweir #include <rtl/logfile.hxx>
39*cdf0e10cSrcweir 
40*cdf0e10cSrcweir 
41*cdf0e10cSrcweir using namespace rtl;
42*cdf0e10cSrcweir using namespace utl;
43*cdf0e10cSrcweir using namespace com::sun::star::uno;
44*cdf0e10cSrcweir using namespace com::sun::star::i18n;
45*cdf0e10cSrcweir 
46*cdf0e10cSrcweir #define MAX_FLAGS_OFFSET	25
47*cdf0e10cSrcweir 
48*cdf0e10cSrcweir //////////////////////////////////////////////////////////////////////
49*cdf0e10cSrcweir 
50*cdf0e10cSrcweir 
51*cdf0e10cSrcweir class SvtSearchOptions_Impl : public ConfigItem
52*cdf0e10cSrcweir {
53*cdf0e10cSrcweir 	sal_Int32	nFlags;
54*cdf0e10cSrcweir 	sal_Bool	bModified;
55*cdf0e10cSrcweir 
56*cdf0e10cSrcweir 	// disallow copy-constructor and assignment-operator for now
57*cdf0e10cSrcweir 	SvtSearchOptions_Impl( const SvtSearchOptions_Impl & );
58*cdf0e10cSrcweir 	SvtSearchOptions_Impl & operator = ( const SvtSearchOptions_Impl & );
59*cdf0e10cSrcweir 
60*cdf0e10cSrcweir protected:
61*cdf0e10cSrcweir 	sal_Bool			IsModified() const { return bModified; }
62*cdf0e10cSrcweir     using ConfigItem::SetModified;
63*cdf0e10cSrcweir 	void			SetModified( sal_Bool bVal );
64*cdf0e10cSrcweir 	sal_Bool			Load();
65*cdf0e10cSrcweir 	sal_Bool			Save();
66*cdf0e10cSrcweir 
67*cdf0e10cSrcweir 	Sequence< OUString >	GetPropertyNames() const;
68*cdf0e10cSrcweir 
69*cdf0e10cSrcweir public:
70*cdf0e10cSrcweir 	SvtSearchOptions_Impl();
71*cdf0e10cSrcweir 	virtual ~SvtSearchOptions_Impl();
72*cdf0e10cSrcweir 
73*cdf0e10cSrcweir 	// ConfigItem
74*cdf0e10cSrcweir 	virtual void	Commit();
75*cdf0e10cSrcweir     virtual void    Notify( const com::sun::star::uno::Sequence< rtl::OUString >& aPropertyNames );
76*cdf0e10cSrcweir 
77*cdf0e10cSrcweir 	sal_Bool			GetFlag( sal_uInt16 nOffset ) const;
78*cdf0e10cSrcweir 	void			SetFlag( sal_uInt16 nOffset, sal_Bool bVal );
79*cdf0e10cSrcweir };
80*cdf0e10cSrcweir 
81*cdf0e10cSrcweir 
82*cdf0e10cSrcweir 
83*cdf0e10cSrcweir SvtSearchOptions_Impl::SvtSearchOptions_Impl() :
84*cdf0e10cSrcweir 	ConfigItem( OUString::createFromAscii( "Office.Common/SearchOptions" ) )
85*cdf0e10cSrcweir {
86*cdf0e10cSrcweir     RTL_LOGFILE_CONTEXT(aLog, "unotools SvtSearchOptions_Impl::SvtSearchOptions_Impl()");
87*cdf0e10cSrcweir 	nFlags = 0x0003FFFF;	// set all options values to 'true'
88*cdf0e10cSrcweir 	Load();
89*cdf0e10cSrcweir 	SetModified( sal_False );
90*cdf0e10cSrcweir }
91*cdf0e10cSrcweir 
92*cdf0e10cSrcweir 
93*cdf0e10cSrcweir SvtSearchOptions_Impl::~SvtSearchOptions_Impl()
94*cdf0e10cSrcweir {
95*cdf0e10cSrcweir 	Commit();
96*cdf0e10cSrcweir }
97*cdf0e10cSrcweir 
98*cdf0e10cSrcweir 
99*cdf0e10cSrcweir void SvtSearchOptions_Impl::Commit()
100*cdf0e10cSrcweir {
101*cdf0e10cSrcweir 	if (IsModified())
102*cdf0e10cSrcweir 		Save();
103*cdf0e10cSrcweir }
104*cdf0e10cSrcweir 
105*cdf0e10cSrcweir void SvtSearchOptions_Impl::Notify( const Sequence< rtl::OUString >&  )
106*cdf0e10cSrcweir {
107*cdf0e10cSrcweir }
108*cdf0e10cSrcweir 
109*cdf0e10cSrcweir 
110*cdf0e10cSrcweir sal_Bool SvtSearchOptions_Impl::GetFlag( sal_uInt16 nOffset ) const
111*cdf0e10cSrcweir {
112*cdf0e10cSrcweir 	DBG_ASSERT( nOffset <= MAX_FLAGS_OFFSET, "offset out of range");
113*cdf0e10cSrcweir 	return ((nFlags >> nOffset) & 0x01) ? sal_True : sal_False;
114*cdf0e10cSrcweir }
115*cdf0e10cSrcweir 
116*cdf0e10cSrcweir 
117*cdf0e10cSrcweir void SvtSearchOptions_Impl::SetFlag( sal_uInt16 nOffset, sal_Bool bVal )
118*cdf0e10cSrcweir {
119*cdf0e10cSrcweir 	DBG_ASSERT( nOffset <= MAX_FLAGS_OFFSET, "offset out of range");
120*cdf0e10cSrcweir 	sal_Int32 nOldFlags = nFlags;
121*cdf0e10cSrcweir 	sal_Int32 nMask = ((sal_Int32) 1)  << nOffset;
122*cdf0e10cSrcweir 	if (bVal)
123*cdf0e10cSrcweir 		nFlags |= nMask;
124*cdf0e10cSrcweir 	else
125*cdf0e10cSrcweir 		nFlags &= ~nMask;
126*cdf0e10cSrcweir 	if (nFlags != nOldFlags)
127*cdf0e10cSrcweir 		SetModified( sal_True );
128*cdf0e10cSrcweir }
129*cdf0e10cSrcweir 
130*cdf0e10cSrcweir 
131*cdf0e10cSrcweir void SvtSearchOptions_Impl::SetModified( sal_Bool bVal )
132*cdf0e10cSrcweir {
133*cdf0e10cSrcweir     bModified = bVal;
134*cdf0e10cSrcweir 	if (bModified)
135*cdf0e10cSrcweir 	{
136*cdf0e10cSrcweir 		ConfigItem::SetModified();
137*cdf0e10cSrcweir 	}
138*cdf0e10cSrcweir }
139*cdf0e10cSrcweir 
140*cdf0e10cSrcweir 
141*cdf0e10cSrcweir Sequence< OUString > SvtSearchOptions_Impl::GetPropertyNames() const
142*cdf0e10cSrcweir {
143*cdf0e10cSrcweir 	static const char* aPropNames[ MAX_FLAGS_OFFSET + 1 ] =
144*cdf0e10cSrcweir 	{
145*cdf0e10cSrcweir 		"IsWholeWordsOnly",						//  0
146*cdf0e10cSrcweir 		"IsBackwards",							//  1
147*cdf0e10cSrcweir 		"IsUseRegularExpression",				//  2
148*cdf0e10cSrcweir 		//"IsCurrentSelectionOnly",				// interactively set or not...
149*cdf0e10cSrcweir 		"IsSearchForStyles",					//  3
150*cdf0e10cSrcweir 		"IsSimilaritySearch",					//  4
151*cdf0e10cSrcweir 		"IsUseAsianOptions",					//  5
152*cdf0e10cSrcweir 		"IsMatchCase",							//  6
153*cdf0e10cSrcweir 		"Japanese/IsMatchFullHalfWidthForms",	//  7
154*cdf0e10cSrcweir 		"Japanese/IsMatchHiraganaKatakana",		//  8
155*cdf0e10cSrcweir 		"Japanese/IsMatchContractions",			//  9
156*cdf0e10cSrcweir 		"Japanese/IsMatchMinusDashCho-on",		// 10
157*cdf0e10cSrcweir 		"Japanese/IsMatchRepeatCharMarks",		// 11
158*cdf0e10cSrcweir 		"Japanese/IsMatchVariantFormKanji",		// 12
159*cdf0e10cSrcweir 		"Japanese/IsMatchOldKanaForms",			// 13
160*cdf0e10cSrcweir 		"Japanese/IsMatch_DiZi_DuZu",			// 14
161*cdf0e10cSrcweir 		"Japanese/IsMatch_BaVa_HaFa",			// 15
162*cdf0e10cSrcweir 		"Japanese/IsMatch_TsiThiChi_DhiZi",		// 16
163*cdf0e10cSrcweir 		"Japanese/IsMatch_HyuIyu_ByuVyu",		// 17
164*cdf0e10cSrcweir 		"Japanese/IsMatch_SeShe_ZeJe",			// 18
165*cdf0e10cSrcweir 		"Japanese/IsMatch_IaIya",				// 19
166*cdf0e10cSrcweir 		"Japanese/IsMatch_KiKu",				// 20
167*cdf0e10cSrcweir 		"Japanese/IsIgnorePunctuation",			// 21
168*cdf0e10cSrcweir 		"Japanese/IsIgnoreWhitespace",			// 22
169*cdf0e10cSrcweir 		"Japanese/IsIgnoreProlongedSoundMark",		// 23
170*cdf0e10cSrcweir 		"Japanese/IsIgnoreMiddleDot",			// 24
171*cdf0e10cSrcweir 		"IsNotes"					// 25
172*cdf0e10cSrcweir 	};
173*cdf0e10cSrcweir 
174*cdf0e10cSrcweir     const int nCount = sizeof( aPropNames ) / sizeof( aPropNames[0] );
175*cdf0e10cSrcweir 	Sequence< OUString > aNames( nCount );
176*cdf0e10cSrcweir 	OUString* pNames = aNames.getArray();
177*cdf0e10cSrcweir 	for (sal_Int32 i = 0;  i < nCount;  ++i)
178*cdf0e10cSrcweir 		pNames[i] = OUString::createFromAscii( aPropNames[i] );
179*cdf0e10cSrcweir 
180*cdf0e10cSrcweir 	return aNames;
181*cdf0e10cSrcweir }
182*cdf0e10cSrcweir 
183*cdf0e10cSrcweir 
184*cdf0e10cSrcweir sal_Bool SvtSearchOptions_Impl::Load()
185*cdf0e10cSrcweir {
186*cdf0e10cSrcweir 	sal_Bool bSucc = sal_False;
187*cdf0e10cSrcweir 
188*cdf0e10cSrcweir 	Sequence< OUString > aNames = GetPropertyNames();
189*cdf0e10cSrcweir 	sal_Int32 nProps = aNames.getLength();
190*cdf0e10cSrcweir 
191*cdf0e10cSrcweir 	const Sequence< Any > aValues = GetProperties( aNames );
192*cdf0e10cSrcweir 	DBG_ASSERT( aValues.getLength() == aNames.getLength(),
193*cdf0e10cSrcweir 			"GetProperties failed" );
194*cdf0e10cSrcweir 	//EnableNotification( aNames );
195*cdf0e10cSrcweir 
196*cdf0e10cSrcweir 	if (nProps  &&  aValues.getLength() == nProps)
197*cdf0e10cSrcweir 	{
198*cdf0e10cSrcweir 		bSucc = sal_True;
199*cdf0e10cSrcweir 
200*cdf0e10cSrcweir 		const Any* pValues = aValues.getConstArray();
201*cdf0e10cSrcweir 		for (sal_uInt16 i = 0;  i < nProps;  ++i)
202*cdf0e10cSrcweir 		{
203*cdf0e10cSrcweir 			const Any &rVal = pValues[i];
204*cdf0e10cSrcweir 			DBG_ASSERT( rVal.hasValue(), "property value missing" );
205*cdf0e10cSrcweir 			if (rVal.hasValue())
206*cdf0e10cSrcweir 			{
207*cdf0e10cSrcweir 				sal_Bool bVal = sal_Bool();
208*cdf0e10cSrcweir 				if (rVal >>= bVal)
209*cdf0e10cSrcweir 				{
210*cdf0e10cSrcweir 					if (i <= MAX_FLAGS_OFFSET)
211*cdf0e10cSrcweir 					{
212*cdf0e10cSrcweir 						// use index in sequence as flag index
213*cdf0e10cSrcweir 						SetFlag( i, bVal );
214*cdf0e10cSrcweir 					}
215*cdf0e10cSrcweir 					else {
216*cdf0e10cSrcweir 						DBG_ERROR( "unexpected index" );
217*cdf0e10cSrcweir                     }
218*cdf0e10cSrcweir 				}
219*cdf0e10cSrcweir 				else
220*cdf0e10cSrcweir 				{
221*cdf0e10cSrcweir 					DBG_ERROR( "unexpected type" );
222*cdf0e10cSrcweir 					bSucc = sal_False;
223*cdf0e10cSrcweir 				}
224*cdf0e10cSrcweir 			}
225*cdf0e10cSrcweir 			else
226*cdf0e10cSrcweir 			{
227*cdf0e10cSrcweir 				DBG_ERROR( "value missing" );
228*cdf0e10cSrcweir 				bSucc = sal_False;
229*cdf0e10cSrcweir 			}
230*cdf0e10cSrcweir 		}
231*cdf0e10cSrcweir 	}
232*cdf0e10cSrcweir 	DBG_ASSERT( bSucc, "LoadConfig failed" );
233*cdf0e10cSrcweir 
234*cdf0e10cSrcweir 	return bSucc;
235*cdf0e10cSrcweir }
236*cdf0e10cSrcweir 
237*cdf0e10cSrcweir 
238*cdf0e10cSrcweir sal_Bool SvtSearchOptions_Impl::Save()
239*cdf0e10cSrcweir {
240*cdf0e10cSrcweir 	sal_Bool bSucc = sal_False;
241*cdf0e10cSrcweir 
242*cdf0e10cSrcweir 	const Sequence< OUString > aNames = GetPropertyNames();
243*cdf0e10cSrcweir 	sal_Int32 nProps = aNames.getLength();
244*cdf0e10cSrcweir 
245*cdf0e10cSrcweir 	Sequence< Any > aValues( nProps );
246*cdf0e10cSrcweir 	Any *pValue = aValues.getArray();
247*cdf0e10cSrcweir 
248*cdf0e10cSrcweir 	DBG_ASSERT( nProps == MAX_FLAGS_OFFSET + 1,
249*cdf0e10cSrcweir 			"unexpected size of index" );
250*cdf0e10cSrcweir 	if (nProps  &&  nProps == MAX_FLAGS_OFFSET + 1)
251*cdf0e10cSrcweir 	{
252*cdf0e10cSrcweir 		for (sal_uInt16 i = 0;  i < nProps;  ++i)
253*cdf0e10cSrcweir 			pValue[i] <<= (sal_Bool) GetFlag(i);
254*cdf0e10cSrcweir 		bSucc |= PutProperties( aNames, aValues );
255*cdf0e10cSrcweir 	}
256*cdf0e10cSrcweir 
257*cdf0e10cSrcweir 	if (bSucc)
258*cdf0e10cSrcweir 		SetModified( sal_False );
259*cdf0e10cSrcweir 
260*cdf0e10cSrcweir 	return bSucc;
261*cdf0e10cSrcweir }
262*cdf0e10cSrcweir 
263*cdf0e10cSrcweir 
264*cdf0e10cSrcweir //////////////////////////////////////////////////////////////////////
265*cdf0e10cSrcweir 
266*cdf0e10cSrcweir SvtSearchOptions::SvtSearchOptions()
267*cdf0e10cSrcweir {
268*cdf0e10cSrcweir 	pImpl = new SvtSearchOptions_Impl;
269*cdf0e10cSrcweir }
270*cdf0e10cSrcweir 
271*cdf0e10cSrcweir 
272*cdf0e10cSrcweir SvtSearchOptions::~SvtSearchOptions()
273*cdf0e10cSrcweir {
274*cdf0e10cSrcweir 	delete pImpl;
275*cdf0e10cSrcweir }
276*cdf0e10cSrcweir 
277*cdf0e10cSrcweir 
278*cdf0e10cSrcweir sal_Int32 SvtSearchOptions::GetTransliterationFlags() const
279*cdf0e10cSrcweir {
280*cdf0e10cSrcweir 	sal_Int32 nRes = 0;
281*cdf0e10cSrcweir 
282*cdf0e10cSrcweir     if (!IsMatchCase()) // 'IsMatchCase' means act case sensitive
283*cdf0e10cSrcweir 		nRes |= TransliterationModules_IGNORE_CASE;
284*cdf0e10cSrcweir     if ( IsMatchFullHalfWidthForms())
285*cdf0e10cSrcweir 		nRes |= TransliterationModules_IGNORE_WIDTH;
286*cdf0e10cSrcweir     if ( IsMatchHiraganaKatakana())
287*cdf0e10cSrcweir 		nRes |= TransliterationModules_IGNORE_KANA;
288*cdf0e10cSrcweir     if ( IsMatchContractions())
289*cdf0e10cSrcweir 		nRes |= TransliterationModules_ignoreSize_ja_JP;
290*cdf0e10cSrcweir     if ( IsMatchMinusDashChoon())
291*cdf0e10cSrcweir 		nRes |= TransliterationModules_ignoreMinusSign_ja_JP;
292*cdf0e10cSrcweir     if ( IsMatchRepeatCharMarks())
293*cdf0e10cSrcweir 		nRes |= TransliterationModules_ignoreIterationMark_ja_JP;
294*cdf0e10cSrcweir     if ( IsMatchVariantFormKanji())
295*cdf0e10cSrcweir 		nRes |= TransliterationModules_ignoreTraditionalKanji_ja_JP;
296*cdf0e10cSrcweir     if ( IsMatchOldKanaForms())
297*cdf0e10cSrcweir 		nRes |= TransliterationModules_ignoreTraditionalKana_ja_JP;
298*cdf0e10cSrcweir     if ( IsMatchDiziDuzu())
299*cdf0e10cSrcweir 		nRes |= TransliterationModules_ignoreZiZu_ja_JP;
300*cdf0e10cSrcweir     if ( IsMatchBavaHafa())
301*cdf0e10cSrcweir 		nRes |= TransliterationModules_ignoreBaFa_ja_JP;
302*cdf0e10cSrcweir     if ( IsMatchTsithichiDhizi())
303*cdf0e10cSrcweir 		nRes |= TransliterationModules_ignoreTiJi_ja_JP;
304*cdf0e10cSrcweir     if ( IsMatchHyuiyuByuvyu())
305*cdf0e10cSrcweir 		nRes |= TransliterationModules_ignoreHyuByu_ja_JP;
306*cdf0e10cSrcweir     if ( IsMatchSesheZeje())
307*cdf0e10cSrcweir 		nRes |= TransliterationModules_ignoreSeZe_ja_JP;
308*cdf0e10cSrcweir     if ( IsMatchIaiya())
309*cdf0e10cSrcweir 		nRes |= TransliterationModules_ignoreIandEfollowedByYa_ja_JP;
310*cdf0e10cSrcweir     if ( IsMatchKiku())
311*cdf0e10cSrcweir 		nRes |= TransliterationModules_ignoreKiKuFollowedBySa_ja_JP;
312*cdf0e10cSrcweir 	if ( IsIgnorePunctuation())
313*cdf0e10cSrcweir 		nRes |= TransliterationModules_ignoreSeparator_ja_JP;
314*cdf0e10cSrcweir 	if ( IsIgnoreWhitespace())
315*cdf0e10cSrcweir 		nRes |= TransliterationModules_ignoreSpace_ja_JP;
316*cdf0e10cSrcweir 	if ( IsIgnoreProlongedSoundMark())
317*cdf0e10cSrcweir 		nRes |= TransliterationModules_ignoreProlongedSoundMark_ja_JP;
318*cdf0e10cSrcweir 	if ( IsIgnoreMiddleDot())
319*cdf0e10cSrcweir 		nRes |= TransliterationModules_ignoreMiddleDot_ja_JP;
320*cdf0e10cSrcweir 
321*cdf0e10cSrcweir 	return nRes;
322*cdf0e10cSrcweir }
323*cdf0e10cSrcweir 
324*cdf0e10cSrcweir 
325*cdf0e10cSrcweir sal_Bool SvtSearchOptions::IsWholeWordsOnly() const
326*cdf0e10cSrcweir {
327*cdf0e10cSrcweir 	return pImpl->GetFlag( 0 );
328*cdf0e10cSrcweir }
329*cdf0e10cSrcweir 
330*cdf0e10cSrcweir 
331*cdf0e10cSrcweir void SvtSearchOptions::SetWholeWordsOnly( sal_Bool bVal )
332*cdf0e10cSrcweir {
333*cdf0e10cSrcweir 	pImpl->SetFlag( 0, bVal );
334*cdf0e10cSrcweir }
335*cdf0e10cSrcweir 
336*cdf0e10cSrcweir 
337*cdf0e10cSrcweir sal_Bool SvtSearchOptions::IsBackwards() const
338*cdf0e10cSrcweir {
339*cdf0e10cSrcweir 	return pImpl->GetFlag( 1 );
340*cdf0e10cSrcweir }
341*cdf0e10cSrcweir 
342*cdf0e10cSrcweir 
343*cdf0e10cSrcweir void SvtSearchOptions::SetBackwards( sal_Bool bVal )
344*cdf0e10cSrcweir {
345*cdf0e10cSrcweir 	pImpl->SetFlag( 1, bVal );
346*cdf0e10cSrcweir }
347*cdf0e10cSrcweir 
348*cdf0e10cSrcweir 
349*cdf0e10cSrcweir sal_Bool SvtSearchOptions::IsUseRegularExpression() const
350*cdf0e10cSrcweir {
351*cdf0e10cSrcweir 	return pImpl->GetFlag( 2 );
352*cdf0e10cSrcweir }
353*cdf0e10cSrcweir 
354*cdf0e10cSrcweir 
355*cdf0e10cSrcweir void SvtSearchOptions::SetUseRegularExpression( sal_Bool bVal )
356*cdf0e10cSrcweir {
357*cdf0e10cSrcweir 	pImpl->SetFlag( 2, bVal );
358*cdf0e10cSrcweir }
359*cdf0e10cSrcweir 
360*cdf0e10cSrcweir 
361*cdf0e10cSrcweir sal_Bool SvtSearchOptions::IsSearchForStyles() const
362*cdf0e10cSrcweir {
363*cdf0e10cSrcweir 	return pImpl->GetFlag( 3 );
364*cdf0e10cSrcweir }
365*cdf0e10cSrcweir 
366*cdf0e10cSrcweir 
367*cdf0e10cSrcweir void SvtSearchOptions::SetSearchForStyles( sal_Bool bVal )
368*cdf0e10cSrcweir {
369*cdf0e10cSrcweir 	pImpl->SetFlag( 3, bVal );
370*cdf0e10cSrcweir }
371*cdf0e10cSrcweir 
372*cdf0e10cSrcweir 
373*cdf0e10cSrcweir sal_Bool SvtSearchOptions::IsSimilaritySearch() const
374*cdf0e10cSrcweir {
375*cdf0e10cSrcweir 	return pImpl->GetFlag( 4 );
376*cdf0e10cSrcweir }
377*cdf0e10cSrcweir 
378*cdf0e10cSrcweir 
379*cdf0e10cSrcweir void SvtSearchOptions::SetSimilaritySearch( sal_Bool bVal )
380*cdf0e10cSrcweir {
381*cdf0e10cSrcweir 	pImpl->SetFlag( 4, bVal );
382*cdf0e10cSrcweir }
383*cdf0e10cSrcweir 
384*cdf0e10cSrcweir 
385*cdf0e10cSrcweir sal_Bool SvtSearchOptions::IsUseAsianOptions() const
386*cdf0e10cSrcweir {
387*cdf0e10cSrcweir 	return pImpl->GetFlag( 5 );
388*cdf0e10cSrcweir }
389*cdf0e10cSrcweir 
390*cdf0e10cSrcweir 
391*cdf0e10cSrcweir void SvtSearchOptions::SetUseAsianOptions( sal_Bool bVal )
392*cdf0e10cSrcweir {
393*cdf0e10cSrcweir 	pImpl->SetFlag( 5, bVal );
394*cdf0e10cSrcweir }
395*cdf0e10cSrcweir 
396*cdf0e10cSrcweir 
397*cdf0e10cSrcweir sal_Bool SvtSearchOptions::IsMatchCase() const
398*cdf0e10cSrcweir {
399*cdf0e10cSrcweir 	return pImpl->GetFlag( 6 );
400*cdf0e10cSrcweir }
401*cdf0e10cSrcweir 
402*cdf0e10cSrcweir 
403*cdf0e10cSrcweir void SvtSearchOptions::SetMatchCase( sal_Bool bVal )
404*cdf0e10cSrcweir {
405*cdf0e10cSrcweir 	pImpl->SetFlag( 6, bVal );
406*cdf0e10cSrcweir }
407*cdf0e10cSrcweir 
408*cdf0e10cSrcweir 
409*cdf0e10cSrcweir sal_Bool SvtSearchOptions::IsMatchFullHalfWidthForms() const
410*cdf0e10cSrcweir {
411*cdf0e10cSrcweir 	return pImpl->GetFlag( 7 );
412*cdf0e10cSrcweir }
413*cdf0e10cSrcweir 
414*cdf0e10cSrcweir 
415*cdf0e10cSrcweir void SvtSearchOptions::SetMatchFullHalfWidthForms( sal_Bool bVal )
416*cdf0e10cSrcweir {
417*cdf0e10cSrcweir 	pImpl->SetFlag( 7, bVal );
418*cdf0e10cSrcweir }
419*cdf0e10cSrcweir 
420*cdf0e10cSrcweir 
421*cdf0e10cSrcweir sal_Bool SvtSearchOptions::IsMatchHiraganaKatakana() const
422*cdf0e10cSrcweir {
423*cdf0e10cSrcweir 	return pImpl->GetFlag( 8 );
424*cdf0e10cSrcweir }
425*cdf0e10cSrcweir 
426*cdf0e10cSrcweir 
427*cdf0e10cSrcweir void SvtSearchOptions::SetMatchHiraganaKatakana( sal_Bool bVal )
428*cdf0e10cSrcweir {
429*cdf0e10cSrcweir 	pImpl->SetFlag( 8, bVal );
430*cdf0e10cSrcweir }
431*cdf0e10cSrcweir 
432*cdf0e10cSrcweir 
433*cdf0e10cSrcweir sal_Bool SvtSearchOptions::IsMatchContractions() const
434*cdf0e10cSrcweir {
435*cdf0e10cSrcweir 	return pImpl->GetFlag( 9 );
436*cdf0e10cSrcweir }
437*cdf0e10cSrcweir 
438*cdf0e10cSrcweir 
439*cdf0e10cSrcweir void SvtSearchOptions::SetMatchContractions( sal_Bool bVal )
440*cdf0e10cSrcweir {
441*cdf0e10cSrcweir 	pImpl->SetFlag( 9, bVal );
442*cdf0e10cSrcweir }
443*cdf0e10cSrcweir 
444*cdf0e10cSrcweir 
445*cdf0e10cSrcweir sal_Bool SvtSearchOptions::IsMatchMinusDashChoon() const
446*cdf0e10cSrcweir {
447*cdf0e10cSrcweir 	return pImpl->GetFlag( 10 );
448*cdf0e10cSrcweir }
449*cdf0e10cSrcweir 
450*cdf0e10cSrcweir 
451*cdf0e10cSrcweir void SvtSearchOptions::SetMatchMinusDashChoon( sal_Bool bVal )
452*cdf0e10cSrcweir {
453*cdf0e10cSrcweir 	pImpl->SetFlag( 10, bVal );
454*cdf0e10cSrcweir }
455*cdf0e10cSrcweir 
456*cdf0e10cSrcweir 
457*cdf0e10cSrcweir sal_Bool SvtSearchOptions::IsMatchRepeatCharMarks() const
458*cdf0e10cSrcweir {
459*cdf0e10cSrcweir 	return pImpl->GetFlag( 11 );
460*cdf0e10cSrcweir }
461*cdf0e10cSrcweir 
462*cdf0e10cSrcweir 
463*cdf0e10cSrcweir void SvtSearchOptions::SetMatchRepeatCharMarks( sal_Bool bVal )
464*cdf0e10cSrcweir {
465*cdf0e10cSrcweir 	pImpl->SetFlag( 11, bVal );
466*cdf0e10cSrcweir }
467*cdf0e10cSrcweir 
468*cdf0e10cSrcweir 
469*cdf0e10cSrcweir sal_Bool SvtSearchOptions::IsMatchVariantFormKanji() const
470*cdf0e10cSrcweir {
471*cdf0e10cSrcweir 	return pImpl->GetFlag( 12 );
472*cdf0e10cSrcweir }
473*cdf0e10cSrcweir 
474*cdf0e10cSrcweir 
475*cdf0e10cSrcweir void SvtSearchOptions::SetMatchVariantFormKanji( sal_Bool bVal )
476*cdf0e10cSrcweir {
477*cdf0e10cSrcweir 	pImpl->SetFlag( 12, bVal );
478*cdf0e10cSrcweir }
479*cdf0e10cSrcweir 
480*cdf0e10cSrcweir 
481*cdf0e10cSrcweir sal_Bool SvtSearchOptions::IsMatchOldKanaForms() const
482*cdf0e10cSrcweir {
483*cdf0e10cSrcweir 	return pImpl->GetFlag( 13 );
484*cdf0e10cSrcweir }
485*cdf0e10cSrcweir 
486*cdf0e10cSrcweir 
487*cdf0e10cSrcweir void SvtSearchOptions::SetMatchOldKanaForms( sal_Bool bVal )
488*cdf0e10cSrcweir {
489*cdf0e10cSrcweir 	pImpl->SetFlag( 13, bVal );
490*cdf0e10cSrcweir }
491*cdf0e10cSrcweir 
492*cdf0e10cSrcweir 
493*cdf0e10cSrcweir sal_Bool SvtSearchOptions::IsMatchDiziDuzu() const
494*cdf0e10cSrcweir {
495*cdf0e10cSrcweir 	return pImpl->GetFlag( 14 );
496*cdf0e10cSrcweir }
497*cdf0e10cSrcweir 
498*cdf0e10cSrcweir 
499*cdf0e10cSrcweir void SvtSearchOptions::SetMatchDiziDuzu( sal_Bool bVal )
500*cdf0e10cSrcweir {
501*cdf0e10cSrcweir 	pImpl->SetFlag( 14, bVal );
502*cdf0e10cSrcweir }
503*cdf0e10cSrcweir 
504*cdf0e10cSrcweir 
505*cdf0e10cSrcweir sal_Bool SvtSearchOptions::IsMatchBavaHafa() const
506*cdf0e10cSrcweir {
507*cdf0e10cSrcweir 	return pImpl->GetFlag( 15 );
508*cdf0e10cSrcweir }
509*cdf0e10cSrcweir 
510*cdf0e10cSrcweir 
511*cdf0e10cSrcweir void SvtSearchOptions::SetMatchBavaHafa( sal_Bool bVal )
512*cdf0e10cSrcweir {
513*cdf0e10cSrcweir 	pImpl->SetFlag( 15, bVal );
514*cdf0e10cSrcweir }
515*cdf0e10cSrcweir 
516*cdf0e10cSrcweir 
517*cdf0e10cSrcweir sal_Bool SvtSearchOptions::IsMatchTsithichiDhizi() const
518*cdf0e10cSrcweir {
519*cdf0e10cSrcweir 	return pImpl->GetFlag( 16 );
520*cdf0e10cSrcweir }
521*cdf0e10cSrcweir 
522*cdf0e10cSrcweir 
523*cdf0e10cSrcweir void SvtSearchOptions::SetMatchTsithichiDhizi( sal_Bool bVal )
524*cdf0e10cSrcweir {
525*cdf0e10cSrcweir 	pImpl->SetFlag( 16, bVal );
526*cdf0e10cSrcweir }
527*cdf0e10cSrcweir 
528*cdf0e10cSrcweir 
529*cdf0e10cSrcweir sal_Bool SvtSearchOptions::IsMatchHyuiyuByuvyu() const
530*cdf0e10cSrcweir {
531*cdf0e10cSrcweir 	return pImpl->GetFlag( 17 );
532*cdf0e10cSrcweir }
533*cdf0e10cSrcweir 
534*cdf0e10cSrcweir 
535*cdf0e10cSrcweir void SvtSearchOptions::SetMatchHyuiyuByuvyu( sal_Bool bVal )
536*cdf0e10cSrcweir {
537*cdf0e10cSrcweir 	pImpl->SetFlag( 17, bVal );
538*cdf0e10cSrcweir }
539*cdf0e10cSrcweir 
540*cdf0e10cSrcweir 
541*cdf0e10cSrcweir sal_Bool SvtSearchOptions::IsMatchSesheZeje() const
542*cdf0e10cSrcweir {
543*cdf0e10cSrcweir 	return pImpl->GetFlag( 18 );
544*cdf0e10cSrcweir }
545*cdf0e10cSrcweir 
546*cdf0e10cSrcweir 
547*cdf0e10cSrcweir void SvtSearchOptions::SetMatchSesheZeje( sal_Bool bVal )
548*cdf0e10cSrcweir {
549*cdf0e10cSrcweir 	pImpl->SetFlag( 18, bVal );
550*cdf0e10cSrcweir }
551*cdf0e10cSrcweir 
552*cdf0e10cSrcweir 
553*cdf0e10cSrcweir sal_Bool SvtSearchOptions::IsMatchIaiya() const
554*cdf0e10cSrcweir {
555*cdf0e10cSrcweir 	return pImpl->GetFlag( 19 );
556*cdf0e10cSrcweir }
557*cdf0e10cSrcweir 
558*cdf0e10cSrcweir 
559*cdf0e10cSrcweir void SvtSearchOptions::SetMatchIaiya( sal_Bool bVal )
560*cdf0e10cSrcweir {
561*cdf0e10cSrcweir 	pImpl->SetFlag( 19, bVal );
562*cdf0e10cSrcweir }
563*cdf0e10cSrcweir 
564*cdf0e10cSrcweir 
565*cdf0e10cSrcweir sal_Bool SvtSearchOptions::IsMatchKiku() const
566*cdf0e10cSrcweir {
567*cdf0e10cSrcweir 	return pImpl->GetFlag( 20 );
568*cdf0e10cSrcweir }
569*cdf0e10cSrcweir 
570*cdf0e10cSrcweir 
571*cdf0e10cSrcweir void SvtSearchOptions::SetMatchKiku( sal_Bool bVal )
572*cdf0e10cSrcweir {
573*cdf0e10cSrcweir 	pImpl->SetFlag( 20, bVal );
574*cdf0e10cSrcweir }
575*cdf0e10cSrcweir 
576*cdf0e10cSrcweir 
577*cdf0e10cSrcweir sal_Bool SvtSearchOptions::IsIgnorePunctuation() const
578*cdf0e10cSrcweir {
579*cdf0e10cSrcweir 	return pImpl->GetFlag( 21 );
580*cdf0e10cSrcweir }
581*cdf0e10cSrcweir 
582*cdf0e10cSrcweir 
583*cdf0e10cSrcweir void SvtSearchOptions::SetIgnorePunctuation( sal_Bool bVal )
584*cdf0e10cSrcweir {
585*cdf0e10cSrcweir 	pImpl->SetFlag( 21, bVal );
586*cdf0e10cSrcweir }
587*cdf0e10cSrcweir 
588*cdf0e10cSrcweir 
589*cdf0e10cSrcweir sal_Bool SvtSearchOptions::IsIgnoreWhitespace() const
590*cdf0e10cSrcweir {
591*cdf0e10cSrcweir 	return pImpl->GetFlag( 22 );
592*cdf0e10cSrcweir }
593*cdf0e10cSrcweir 
594*cdf0e10cSrcweir 
595*cdf0e10cSrcweir void SvtSearchOptions::SetIgnoreWhitespace( sal_Bool bVal )
596*cdf0e10cSrcweir {
597*cdf0e10cSrcweir 	pImpl->SetFlag( 22, bVal );
598*cdf0e10cSrcweir }
599*cdf0e10cSrcweir 
600*cdf0e10cSrcweir 
601*cdf0e10cSrcweir sal_Bool SvtSearchOptions::IsIgnoreProlongedSoundMark() const
602*cdf0e10cSrcweir {
603*cdf0e10cSrcweir 	return pImpl->GetFlag( 23 );
604*cdf0e10cSrcweir }
605*cdf0e10cSrcweir 
606*cdf0e10cSrcweir 
607*cdf0e10cSrcweir void SvtSearchOptions::SetIgnoreProlongedSoundMark( sal_Bool bVal )
608*cdf0e10cSrcweir {
609*cdf0e10cSrcweir 	pImpl->SetFlag( 23, bVal );
610*cdf0e10cSrcweir }
611*cdf0e10cSrcweir 
612*cdf0e10cSrcweir 
613*cdf0e10cSrcweir sal_Bool SvtSearchOptions::IsIgnoreMiddleDot() const
614*cdf0e10cSrcweir {
615*cdf0e10cSrcweir 	return pImpl->GetFlag( 24 );
616*cdf0e10cSrcweir }
617*cdf0e10cSrcweir 
618*cdf0e10cSrcweir 
619*cdf0e10cSrcweir void SvtSearchOptions::SetIgnoreMiddleDot( sal_Bool bVal )
620*cdf0e10cSrcweir {
621*cdf0e10cSrcweir 	pImpl->SetFlag( 24, bVal );
622*cdf0e10cSrcweir }
623*cdf0e10cSrcweir 
624*cdf0e10cSrcweir sal_Bool SvtSearchOptions::IsNotes() const
625*cdf0e10cSrcweir {
626*cdf0e10cSrcweir         return pImpl->GetFlag( 25 );
627*cdf0e10cSrcweir }
628*cdf0e10cSrcweir 
629*cdf0e10cSrcweir 
630*cdf0e10cSrcweir void SvtSearchOptions::SetNotes( sal_Bool bVal )
631*cdf0e10cSrcweir {
632*cdf0e10cSrcweir         pImpl->SetFlag( 25, bVal );
633*cdf0e10cSrcweir }
634*cdf0e10cSrcweir 
635*cdf0e10cSrcweir //////////////////////////////////////////////////////////////////////
636*cdf0e10cSrcweir 
637