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