1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: fmsrccfg.hxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
34 #include <tools/string.hxx>
35 #include <unotools/configvaluecontainer.hxx>
36 #include <com/sun/star/uno/Sequence.hxx>
37 #include "svx/svxdllapi.h"
39 // ===================================================================================================
41 #define MATCHING_ANYWHERE 0
42 #define MATCHING_BEGINNING 1
43 #define MATCHING_END 2
44 #define MATCHING_WHOLETEXT 3
46 // diese Konstanten duerfen NICHT einfach geaendert werden, da der SearchDialog aus den Einstellungen seiner ListBox
47 // keine Umrechnungen vornimmt, sondern die einfach in die entsprechenden Methoden der SearchEngine steckt
48 // (wenn man also die Konstanten oder die Reihenfolge der Listbox-Eintraege im Dialog aendert, muss das jeweils andere
52 //........................................................................
55 //........................................................................
57 // ===================================================================================================
58 // = struct FmSearchParams - Parameter einer Suche
59 // ===================================================================================================
61 struct SVX_DLLPUBLIC FmSearchParams
64 sal_Int32 nTransliterationFlags
;
65 // they're way too sensitive for direct access ....
68 // no bit fields at all (want to pass the addresses to the OConfigurationValueContainer)
69 ::com::sun::star::uno::Sequence
< ::rtl::OUString
>
71 ::rtl::OUString sSingleSearchField
;
73 sal_Int16 nSearchForType
;
76 sal_Int16 nLevShorter
;
81 sal_Bool bUseFormatter
;
85 sal_Bool bApproxSearch
;
86 // the last three are mutually exclusive
88 sal_Bool bSoundsLikeCJK
;
90 // ......................................
93 sal_Bool
isIgnoreWidthCJK( ) const;
94 void setIgnoreWidthCJK( sal_Bool _bIgnore
);
96 sal_Int32
getTransliterationFlags( ) const { return nTransliterationFlags
; }
97 void setTransliterationFlags( sal_Int32 _nFlags
) { nTransliterationFlags
= _nFlags
; }
99 sal_Bool
isCaseSensitive( ) const;
100 void setCaseSensitive( sal_Bool _bCase
);
103 // ===================================================================================================
104 // = class FmSearchConfigItem - ein ConfigItem, dass sich Suchparameter merkt
105 // ===================================================================================================
107 class SVX_DLLPUBLIC FmSearchConfigItem
108 :protected FmSearchParams
109 ,public ::utl::OConfigurationValueContainer
113 ::osl::Mutex m_aMutex
;
115 // wrapper properties:
116 // some of the members of FmSearchParams are must be translated to be stored in the configuration
117 ::rtl::OUString m_sSearchForType
;
118 ::rtl::OUString m_sSearchPosition
;
120 sal_Bool m_bIsMatchCase
;
121 sal_Bool m_bIsMatchFullHalfWidthForms
;
122 sal_Bool m_bIsMatchHiraganaKatakana
;
123 sal_Bool m_bIsMatchContractions
;
124 sal_Bool m_bIsMatchMinusDashCho_on
;
125 sal_Bool m_bIsMatchRepeatCharMarks
;
126 sal_Bool m_bIsMatchVariantFormKanji
;
127 sal_Bool m_bIsMatchOldKanaForms
;
128 sal_Bool m_bIsMatch_DiZi_DuZu
;
129 sal_Bool m_bIsMatch_BaVa_HaFa
;
130 sal_Bool m_bIsMatch_TsiThiChi_DhiZi
;
131 sal_Bool m_bIsMatch_HyuIyu_ByuVyu
;
132 sal_Bool m_bIsMatch_SeShe_ZeJe
;
133 sal_Bool m_bIsMatch_IaIya
;
134 sal_Bool m_bIsMatch_KiKu
;
135 sal_Bool m_bIsIgnorePunctuation
;
136 sal_Bool m_bIsIgnoreWhitespace
;
137 sal_Bool m_bIsIgnoreProlongedSoundMark
;
138 sal_Bool m_bIsIgnoreMiddleDot
;
141 FmSearchConfigItem();
142 ~FmSearchConfigItem();
144 const FmSearchParams
& getParams( ) const;
145 void setParams( const FmSearchParams
& _rParams
);
148 SVX_DLLPRIVATE
void implTranslateFromConfig( );
149 SVX_DLLPRIVATE
void implTranslateToConfig( );
152 //........................................................................
153 } // namespace svxform
154 //........................................................................
156 // ===================================================================================================
158 #endif // _FMSRCCF_HXX_