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 bRefreshExceptQuery
[MAXQUERY
];
174 TypedScStrCollection
* pEntryLists
[MAXCOLCOUNT
];
175 USHORT nHeaderPos
[MAXCOLCOUNT
];
177 // Hack: RefInput-Kontrolle
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 ();
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
* );
205 //============================================================================
206 class ScSpecialFilterDlg
: public ScAnyRefDlg
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();
221 ListBox aLbFilterArea
;
222 FixedText aFtFilterArea
;
223 formula::RefEdit aEdFilterArea
;
224 formula::RefButton aRbFilterArea
;
226 FixedLine aFlOptions
;
228 _COMMON_FILTER_RSCOBJS
231 CancelButton aBtnCancel
;
235 ScFilterOptionsMgr
* pOptionsMgr
;
237 const USHORT nWhichQuery
;
238 const ScQueryParam theQueryData
;
239 ScQueryItem
* pOutItem
;
240 ScViewData
* pViewData
;
243 formula::RefEdit
* pRefInputEdit
;
246 // Hack: RefInput-Kontrolle
251 void Init( const SfxItemSet
& rArgSet
);
252 ScQueryItem
* GetOutputItem( const ScQueryParam
& rParam
,
253 const ScRange
& rSource
);
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
* );
268 #endif // SC_FILTDLG_HXX