Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*************************************************************************
3 : : *
4 : : * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 : : *
6 : : * Copyright 2000, 2010 Oracle and/or its affiliates.
7 : : *
8 : : * OpenOffice.org - a multi-platform office productivity suite
9 : : *
10 : : * This file is part of OpenOffice.org.
11 : : *
12 : : * OpenOffice.org is free software: you can redistribute it and/or modify
13 : : * it under the terms of the GNU Lesser General Public License version 3
14 : : * only, as published by the Free Software Foundation.
15 : : *
16 : : * OpenOffice.org is distributed in the hope that it will be useful,
17 : : * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 : : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 : : * GNU Lesser General Public License version 3 for more details
20 : : * (a copy is included in the LICENSE file that accompanied this code).
21 : : *
22 : : * You should have received a copy of the GNU Lesser General Public License
23 : : * version 3 along with OpenOffice.org. If not, see
24 : : * <http://www.openoffice.org/license.html>
25 : : * for a copy of the LGPLv3 License.
26 : : *
27 : : ************************************************************************/
28 : :
29 : : #ifndef _FMSRCCF_HXX_
30 : : #define _FMSRCCF_HXX_
31 : :
32 : : #include <unotools/configvaluecontainer.hxx>
33 : : #include <com/sun/star/uno/Sequence.hxx>
34 : : #include "svx/svxdllapi.h"
35 : :
36 : : // ===================================================================================================
37 : :
38 : : #define MATCHING_ANYWHERE 0
39 : : #define MATCHING_BEGINNING 1
40 : : #define MATCHING_END 2
41 : : #define MATCHING_WHOLETEXT 3
42 : :
43 : : // this constants should NOT be just changed, since the SearchDialog performs no conversion of the settings of
44 : : // its ListBox, but instead just passes them along to the appropriate methods of SearchEngine
45 : : // (so if you change the constants or the order of the listbox entries in the dialog, then the other has
46 : : // to be adapted)
47 : :
48 : :
49 : : //........................................................................
50 : : namespace svxform
51 : : {
52 : : //........................................................................
53 : :
54 : : // ===================================================================================================
55 : : // = struct FmSearchParams - parameters of a search
56 : : // ===================================================================================================
57 : :
58 : 0 : struct SVX_DLLPUBLIC FmSearchParams
59 : : {
60 : : protected:
61 : : sal_Int32 nTransliterationFlags;
62 : : // they're way too sensitive for direct access ....
63 : :
64 : : public:
65 : : // no bit fields at all (want to pass the addresses to the OConfigurationValueContainer)
66 : : ::com::sun::star::uno::Sequence< ::rtl::OUString >
67 : : aHistory;
68 : : ::rtl::OUString sSingleSearchField;
69 : :
70 : : sal_Int16 nSearchForType;
71 : : sal_Int16 nPosition;
72 : : sal_Int16 nLevOther;
73 : : sal_Int16 nLevShorter;
74 : : sal_Int16 nLevLonger;
75 : : sal_Bool bLevRelaxed;
76 : :
77 : : sal_Bool bAllFields;
78 : : sal_Bool bUseFormatter;
79 : : sal_Bool bBackwards;
80 : : sal_Bool bWildcard;
81 : : sal_Bool bRegular;
82 : : sal_Bool bApproxSearch;
83 : : // the last three are mutually exclusive
84 : :
85 : : sal_Bool bSoundsLikeCJK;
86 : :
87 : : // ......................................
88 : : FmSearchParams();
89 : :
90 : : sal_Bool isIgnoreWidthCJK( ) const;
91 : :
92 : 0 : sal_Int32 getTransliterationFlags( ) const { return nTransliterationFlags; }
93 : 0 : void setTransliterationFlags( sal_Int32 _nFlags ) { nTransliterationFlags = _nFlags; }
94 : :
95 : : sal_Bool isCaseSensitive( ) const;
96 : : void setCaseSensitive( sal_Bool _bCase );
97 : : };
98 : :
99 : : // ===================================================================================================
100 : : // = class FmSearchConfigItem - a ConfigItem, that remembers search parameters
101 : : // ===================================================================================================
102 : :
103 : : class SVX_DLLPUBLIC FmSearchConfigItem
104 : : :protected FmSearchParams
105 : : ,public ::utl::OConfigurationValueContainer
106 : : // order matters!
107 : : {
108 : : private:
109 : : ::osl::Mutex m_aMutex;
110 : :
111 : : // wrapper properties:
112 : : // some of the members of FmSearchParams are must be translated to be stored in the configuration
113 : : ::rtl::OUString m_sSearchForType;
114 : : ::rtl::OUString m_sSearchPosition;
115 : :
116 : : sal_Bool m_bIsMatchCase;
117 : : sal_Bool m_bIsMatchFullHalfWidthForms;
118 : : sal_Bool m_bIsMatchHiraganaKatakana;
119 : : sal_Bool m_bIsMatchContractions;
120 : : sal_Bool m_bIsMatchMinusDashCho_on;
121 : : sal_Bool m_bIsMatchRepeatCharMarks;
122 : : sal_Bool m_bIsMatchVariantFormKanji;
123 : : sal_Bool m_bIsMatchOldKanaForms;
124 : : sal_Bool m_bIsMatch_DiZi_DuZu;
125 : : sal_Bool m_bIsMatch_BaVa_HaFa;
126 : : sal_Bool m_bIsMatch_TsiThiChi_DhiZi;
127 : : sal_Bool m_bIsMatch_HyuIyu_ByuVyu;
128 : : sal_Bool m_bIsMatch_SeShe_ZeJe;
129 : : sal_Bool m_bIsMatch_IaIya;
130 : : sal_Bool m_bIsMatch_KiKu;
131 : : sal_Bool m_bIsIgnorePunctuation;
132 : : sal_Bool m_bIsIgnoreWhitespace;
133 : : sal_Bool m_bIsIgnoreProlongedSoundMark;
134 : : sal_Bool m_bIsIgnoreMiddleDot;
135 : :
136 : : public:
137 : : FmSearchConfigItem();
138 : : ~FmSearchConfigItem();
139 : :
140 : : const FmSearchParams& getParams( ) const;
141 : : void setParams( const FmSearchParams& _rParams );
142 : :
143 : : private:
144 : : SVX_DLLPRIVATE void implTranslateFromConfig( );
145 : : SVX_DLLPRIVATE void implTranslateToConfig( );
146 : : };
147 : :
148 : : //........................................................................
149 : : } // namespace svxform
150 : : //........................................................................
151 : :
152 : : // ===================================================================================================
153 : :
154 : : #endif // _FMSRCCF_HXX_
155 : :
156 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|