update dev300-m57
[ooovba.git] / sc / source / ui / inc / filtdlg.hxx
blobc418e829ce6e0002587d15320254f900f7a392e7
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 bRefreshExceptQuery[MAXQUERY];
171 USHORT nFieldCount;
172 BOOL bRefInputMode;
174 TypedScStrCollection* pEntryLists[MAXCOLCOUNT];
175 USHORT nHeaderPos[MAXCOLCOUNT];
177 // Hack: RefInput-Kontrolle
178 Timer* pTimer;
180 #ifdef _FILTDLG_CXX
181 private:
182 void Init ( const SfxItemSet& rArgSet );
183 void FillFieldLists ();
184 void FillAreaList ();
185 void UpdateValueList ( USHORT nList );
186 void UpdateHdrInValueList( USHORT nList );
187 void ClearValueList ( USHORT nList );
188 USHORT GetFieldSelPos ( SCCOL nField );
189 ScQueryItem* GetOutputItem ();
191 // Handler:
192 DECL_LINK( LbSelectHdl, ListBox* );
193 DECL_LINK( ValModifyHdl, ComboBox* );
194 DECL_LINK( CheckBoxHdl, CheckBox* );
195 DECL_LINK( EndDlgHdl, Button* );
196 DECL_LINK( MoreClickHdl, MoreButton* );
197 DECL_LINK( ScrollHdl, ScrollBar* );
199 // Hack: RefInput-Kontrolle
200 DECL_LINK( TimeOutHdl, Timer* );
201 #endif
205 //============================================================================
206 class ScSpecialFilterDlg : public ScAnyRefDlg
208 public:
209 ScSpecialFilterDlg( SfxBindings* pB, SfxChildWindow* pCW, Window* pParent,
210 const SfxItemSet& rArgSet );
211 ~ScSpecialFilterDlg();
213 virtual void SetReference( const ScRange& rRef, ScDocument* pDoc );
215 virtual BOOL IsRefInputMode() const;
216 virtual void SetActive();
218 virtual BOOL Close();
220 private:
221 ListBox aLbFilterArea;
222 FixedText aFtFilterArea;
223 formula::RefEdit aEdFilterArea;
224 formula::RefButton aRbFilterArea;
226 FixedLine aFlOptions;
228 _COMMON_FILTER_RSCOBJS
230 OKButton aBtnOk;
231 CancelButton aBtnCancel;
232 HelpButton aBtnHelp;
233 MoreButton aBtnMore;
235 ScFilterOptionsMgr* pOptionsMgr;
237 const USHORT nWhichQuery;
238 const ScQueryParam theQueryData;
239 ScQueryItem* pOutItem;
240 ScViewData* pViewData;
241 ScDocument* pDoc;
243 formula::RefEdit* pRefInputEdit;
244 BOOL bRefInputMode;
246 // Hack: RefInput-Kontrolle
247 Timer* pTimer;
249 #ifdef _SFILTDLG_CXX
250 private:
251 void Init( const SfxItemSet& rArgSet );
252 ScQueryItem* GetOutputItem( const ScQueryParam& rParam,
253 const ScRange& rSource );
255 // Handler
256 DECL_LINK( FilterAreaSelHdl, ListBox* );
257 DECL_LINK( FilterAreaModHdl, formula::RefEdit* );
258 DECL_LINK( EndDlgHdl, Button* );
259 DECL_LINK( ScrollHdl, ScrollBar* );
261 // Hack: RefInput-Kontrolle
262 DECL_LINK( TimeOutHdl, Timer* );
263 #endif
268 #endif // SC_FILTDLG_HXX