Update ooo320-m1
[ooovba.git] / sc / source / ui / inc / filtdlg.hxx
blob7409b5a3090d567090c25aa0aa4822e8f496097b
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: filtdlg.hxx,v $
10 * $Revision: 1.7 $
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 ************************************************************************/
31 #ifndef SC_FILTDLG_HXX
32 #define SC_FILTDLG_HXX
34 #ifndef _MOREBTN_HXX //autogen
35 #include <vcl/morebtn.hxx>
36 #endif
37 #ifndef _COMBOBOX_HXX //autogen
38 #include <vcl/combobox.hxx>
39 #endif
40 #ifndef _LSTBOX_HXX //autogen
41 #include <vcl/lstbox.hxx>
42 #endif
43 #include <svtools/stdctrl.hxx>
44 #include "global.hxx" // -> ScQueryParam
45 #include "address.hxx"
46 #include "anyrefdg.hxx"
49 //----------------------------------------------------------------------------
51 class ScFilterOptionsMgr;
52 class ScRangeData;
53 class ScViewData;
54 class ScDocument;
55 class ScQueryItem;
56 class TypedScStrCollection;
58 //==================================================================
59 // Gemeinsame Resource-Objekte:
61 #define _COMMON_FILTER_RSCOBJS \
62 CheckBox aBtnCase; \
63 CheckBox aBtnRegExp; \
64 CheckBox aBtnHeader; \
65 CheckBox aBtnUnique; \
66 CheckBox aBtnCopyResult; \
67 ListBox aLbCopyArea; \
68 formula::RefEdit aEdCopyArea; \
69 formula::RefButton aRbCopyArea; \
70 CheckBox aBtnDestPers; \
71 FixedText aFtDbAreaLabel; \
72 FixedInfo aFtDbArea; \
73 const String aStrUndefined; \
74 const String aStrNoName; \
75 const String aStrNone;
78 #define _INIT_COMMON_FILTER_RSCOBJS \
79 aBtnCase ( this, ScResId( BTN_CASE ) ), \
80 aBtnRegExp ( this, ScResId( BTN_REGEXP ) ), \
81 aBtnHeader ( this, ScResId( BTN_HEADER ) ), \
82 aBtnUnique ( this, ScResId( BTN_UNIQUE ) ), \
83 aBtnCopyResult ( this, ScResId( BTN_COPY_RESULT ) ), \
84 aLbCopyArea ( this, ScResId( LB_COPY_AREA ) ), \
85 aEdCopyArea ( this, this, ScResId( ED_COPY_AREA ) ), \
86 aRbCopyArea ( this, ScResId( RB_COPY_AREA ), &aEdCopyArea, this ), \
87 aBtnDestPers ( this, ScResId( BTN_DEST_PERS ) ), \
88 aFtDbAreaLabel ( this, ScResId( FT_DBAREA_LABEL ) ), \
89 aFtDbArea ( this, ScResId( FT_DBAREA ) ), \
90 aStrUndefined ( ScResId( SCSTR_UNDEFINED ) ), \
91 aStrNoName ( ScGlobal::GetRscString(STR_DB_NONAME) ), \
92 aStrNone ( ScResId( SCSTR_NONE ) ),
95 //============================================================================
96 class ScFilterDlg : public ScAnyRefDlg
98 public:
99 ScFilterDlg( SfxBindings* pB, SfxChildWindow* pCW, Window* pParent,
100 const SfxItemSet& rArgSet );
101 ~ScFilterDlg();
103 virtual void SetReference( const ScRange& rRef, ScDocument* pDoc );
105 virtual BOOL IsRefInputMode() const;
106 virtual void SetActive();
108 virtual BOOL Close();
109 void SliderMoved();
110 USHORT GetSliderPos();
111 void RefreshEditRow( USHORT nOffset );
113 private:
114 FixedLine aFlCriteria;
115 //----------------------------
116 ListBox aLbConnect1;
117 ListBox aLbField1;
118 ListBox aLbCond1;
119 ComboBox aEdVal1;
120 //----------------------------
121 ListBox aLbConnect2;
122 ListBox aLbField2;
123 ListBox aLbCond2;
124 ComboBox aEdVal2;
125 //----------------------------
126 ListBox aLbConnect3;
127 ListBox aLbField3;
128 ListBox aLbCond3;
129 ComboBox aEdVal3;
130 //----------------------------
131 ListBox aLbConnect4;
132 ListBox aLbField4;
133 ListBox aLbCond4;
134 ComboBox aEdVal4;
135 //----------------------------
136 FixedText aFtConnect;
137 FixedText aFtField;
138 FixedText aFtCond;
139 FixedText aFtVal;
140 FixedLine aFlSeparator;
142 ScrollBar aScrollBar;
144 FixedLine aFlOptions;
145 MoreButton aBtnMore;
146 HelpButton aBtnHelp;
147 OKButton aBtnOk;
148 CancelButton aBtnCancel;
150 _COMMON_FILTER_RSCOBJS
152 const String aStrEmpty;
153 const String aStrNotEmpty;
154 const String aStrRow;
155 const String aStrColumn;
157 ScFilterOptionsMgr* pOptionsMgr;
159 const USHORT nWhichQuery;
160 const ScQueryParam theQueryData;
161 ScQueryItem* pOutItem;
162 ScViewData* pViewData;
163 ScDocument* pDoc;
164 SCTAB nSrcTab;
166 ComboBox* aValueEdArr[4];
167 ListBox* aFieldLbArr[4];
168 ListBox* aCondLbArr[4];
169 ListBox* aConnLbArr[4];
170 bool mbHasDates[MAXQUERY];
171 BOOL bRefreshExceptQuery[MAXQUERY];
172 USHORT nFieldCount;
173 BOOL bRefInputMode;
175 TypedScStrCollection* pEntryLists[MAXCOLCOUNT];
176 USHORT nHeaderPos[MAXCOLCOUNT];
178 // Hack: RefInput-Kontrolle
179 Timer* pTimer;
181 #ifdef _FILTDLG_CXX
182 private:
183 void Init ( const SfxItemSet& rArgSet );
184 void FillFieldLists ();
185 void FillAreaList ();
186 void UpdateValueList ( USHORT nList );
187 void UpdateHdrInValueList( USHORT nList );
188 void ClearValueList ( USHORT nList );
189 USHORT GetFieldSelPos ( SCCOL nField );
190 ScQueryItem* GetOutputItem ();
192 // Handler:
193 DECL_LINK( LbSelectHdl, ListBox* );
194 DECL_LINK( ValModifyHdl, ComboBox* );
195 DECL_LINK( CheckBoxHdl, CheckBox* );
196 DECL_LINK( EndDlgHdl, Button* );
197 DECL_LINK( MoreClickHdl, MoreButton* );
198 DECL_LINK( ScrollHdl, ScrollBar* );
200 // Hack: RefInput-Kontrolle
201 DECL_LINK( TimeOutHdl, Timer* );
202 #endif
206 //============================================================================
207 class ScSpecialFilterDlg : public ScAnyRefDlg
209 public:
210 ScSpecialFilterDlg( SfxBindings* pB, SfxChildWindow* pCW, Window* pParent,
211 const SfxItemSet& rArgSet );
212 ~ScSpecialFilterDlg();
214 virtual void SetReference( const ScRange& rRef, ScDocument* pDoc );
216 virtual BOOL IsRefInputMode() const;
217 virtual void SetActive();
219 virtual BOOL Close();
221 private:
222 ListBox aLbFilterArea;
223 FixedText aFtFilterArea;
224 formula::RefEdit aEdFilterArea;
225 formula::RefButton aRbFilterArea;
227 FixedLine aFlOptions;
229 _COMMON_FILTER_RSCOBJS
231 OKButton aBtnOk;
232 CancelButton aBtnCancel;
233 HelpButton aBtnHelp;
234 MoreButton aBtnMore;
236 ScFilterOptionsMgr* pOptionsMgr;
238 const USHORT nWhichQuery;
239 const ScQueryParam theQueryData;
240 ScQueryItem* pOutItem;
241 ScViewData* pViewData;
242 ScDocument* pDoc;
244 formula::RefEdit* pRefInputEdit;
245 BOOL bRefInputMode;
247 // Hack: RefInput-Kontrolle
248 Timer* pTimer;
250 #ifdef _SFILTDLG_CXX
251 private:
252 void Init( const SfxItemSet& rArgSet );
253 ScQueryItem* GetOutputItem( const ScQueryParam& rParam,
254 const ScRange& rSource );
256 // Handler
257 DECL_LINK( FilterAreaSelHdl, ListBox* );
258 DECL_LINK( FilterAreaModHdl, formula::RefEdit* );
259 DECL_LINK( EndDlgHdl, Button* );
260 DECL_LINK( ScrollHdl, ScrollBar* );
262 // Hack: RefInput-Kontrolle
263 DECL_LINK( TimeOutHdl, Timer* );
264 #endif
269 #endif // SC_FILTDLG_HXX