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: filtdlg.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 ************************************************************************/
31 #ifndef SC_FILTDLG_HXX
32 #define SC_FILTDLG_HXX
34 #ifndef _MOREBTN_HXX //autogen
35 #include <vcl/morebtn.hxx>
37 #ifndef _COMBOBOX_HXX //autogen
38 #include <vcl/combobox.hxx>
40 #ifndef _LSTBOX_HXX //autogen
41 #include <vcl/lstbox.hxx>
43 #include <svtools/stdctrl.hxx>
44 #include "global.hxx" // -> ScQueryParam
45 #include "address.hxx"
46 #include "anyrefdg.hxx"
49 //----------------------------------------------------------------------------
51 class ScFilterOptionsMgr
;
56 class TypedScStrCollection
;
58 //==================================================================
59 // Gemeinsame Resource-Objekte:
61 #define _COMMON_FILTER_RSCOBJS \
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
99 ScFilterDlg( SfxBindings
* pB
, SfxChildWindow
* pCW
, Window
* pParent
,
100 const SfxItemSet
& rArgSet
);
103 virtual void SetReference( const ScRange
& rRef
, ScDocument
* pDoc
);
105 virtual BOOL
IsRefInputMode() const;
106 virtual void SetActive();
108 virtual BOOL
Close();
110 USHORT
GetSliderPos();
111 void RefreshEditRow( USHORT nOffset
);
114 FixedLine aFlCriteria
;
115 //----------------------------
120 //----------------------------
125 //----------------------------
130 //----------------------------
135 //----------------------------
136 FixedText aFtConnect
;
140 FixedLine aFlSeparator
;
142 ScrollBar aScrollBar
;
144 FixedLine aFlOptions
;
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
;
166 ComboBox
* aValueEdArr
[4];
167 ListBox
* aFieldLbArr
[4];
168 ListBox
* aCondLbArr
[4];
169 ListBox
* aConnLbArr
[4];
170 bool mbHasDates
[MAXQUERY
];
171 BOOL bRefreshExceptQuery
[MAXQUERY
];
175 TypedScStrCollection
* pEntryLists
[MAXCOLCOUNT
];
176 USHORT nHeaderPos
[MAXCOLCOUNT
];
178 // Hack: RefInput-Kontrolle
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 ();
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
* );
206 //============================================================================
207 class ScSpecialFilterDlg
: public ScAnyRefDlg
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();
222 ListBox aLbFilterArea
;
223 FixedText aFtFilterArea
;
224 formula::RefEdit aEdFilterArea
;
225 formula::RefButton aRbFilterArea
;
227 FixedLine aFlOptions
;
229 _COMMON_FILTER_RSCOBJS
232 CancelButton aBtnCancel
;
236 ScFilterOptionsMgr
* pOptionsMgr
;
238 const USHORT nWhichQuery
;
239 const ScQueryParam theQueryData
;
240 ScQueryItem
* pOutItem
;
241 ScViewData
* pViewData
;
244 formula::RefEdit
* pRefInputEdit
;
247 // Hack: RefInput-Kontrolle
252 void Init( const SfxItemSet
& rArgSet
);
253 ScQueryItem
* GetOutputItem( const ScQueryParam
& rParam
,
254 const ScRange
& rSource
);
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
* );
269 #endif // SC_FILTDLG_HXX