xref: /aoo41x/main/sc/source/ui/inc/filtdlg.hxx (revision 38d50f7b)
1*38d50f7bSAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*38d50f7bSAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*38d50f7bSAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*38d50f7bSAndrew Rist  * distributed with this work for additional information
6*38d50f7bSAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*38d50f7bSAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*38d50f7bSAndrew Rist  * "License"); you may not use this file except in compliance
9*38d50f7bSAndrew Rist  * with the License.  You may obtain a copy of the License at
10*38d50f7bSAndrew Rist  *
11*38d50f7bSAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*38d50f7bSAndrew Rist  *
13*38d50f7bSAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*38d50f7bSAndrew Rist  * software distributed under the License is distributed on an
15*38d50f7bSAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*38d50f7bSAndrew Rist  * KIND, either express or implied.  See the License for the
17*38d50f7bSAndrew Rist  * specific language governing permissions and limitations
18*38d50f7bSAndrew Rist  * under the License.
19*38d50f7bSAndrew Rist  *
20*38d50f7bSAndrew Rist  *************************************************************/
21*38d50f7bSAndrew Rist 
22*38d50f7bSAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir #ifndef SC_FILTDLG_HXX
25cdf0e10cSrcweir #define SC_FILTDLG_HXX
26cdf0e10cSrcweir 
27cdf0e10cSrcweir #ifndef _MOREBTN_HXX //autogen
28cdf0e10cSrcweir #include <vcl/morebtn.hxx>
29cdf0e10cSrcweir #endif
30cdf0e10cSrcweir #ifndef _COMBOBOX_HXX //autogen
31cdf0e10cSrcweir #include <vcl/combobox.hxx>
32cdf0e10cSrcweir #endif
33cdf0e10cSrcweir #ifndef _LSTBOX_HXX //autogen
34cdf0e10cSrcweir #include <vcl/lstbox.hxx>
35cdf0e10cSrcweir #endif
36cdf0e10cSrcweir #include <svtools/stdctrl.hxx>
37cdf0e10cSrcweir #include "global.hxx" // -> ScQueryParam
38cdf0e10cSrcweir #include "address.hxx"
39cdf0e10cSrcweir #include "anyrefdg.hxx"
40cdf0e10cSrcweir 
41cdf0e10cSrcweir 
42cdf0e10cSrcweir //----------------------------------------------------------------------------
43cdf0e10cSrcweir 
44cdf0e10cSrcweir class ScFilterOptionsMgr;
45cdf0e10cSrcweir class ScRangeData;
46cdf0e10cSrcweir class ScViewData;
47cdf0e10cSrcweir class ScDocument;
48cdf0e10cSrcweir class ScQueryItem;
49cdf0e10cSrcweir class TypedScStrCollection;
50cdf0e10cSrcweir 
51cdf0e10cSrcweir //==================================================================
52cdf0e10cSrcweir // Gemeinsame Resource-Objekte:
53cdf0e10cSrcweir 
54cdf0e10cSrcweir #define _COMMON_FILTER_RSCOBJS \
55cdf0e10cSrcweir 	CheckBox		aBtnCase; \
56cdf0e10cSrcweir 	CheckBox		aBtnRegExp; \
57cdf0e10cSrcweir 	CheckBox		aBtnHeader; \
58cdf0e10cSrcweir 	CheckBox		aBtnUnique; \
59cdf0e10cSrcweir 	CheckBox		aBtnCopyResult; \
60cdf0e10cSrcweir 	ListBox			aLbCopyArea; \
61cdf0e10cSrcweir 	formula::RefEdit		aEdCopyArea; \
62cdf0e10cSrcweir 	formula::RefButton		aRbCopyArea; \
63cdf0e10cSrcweir 	CheckBox		aBtnDestPers; \
64cdf0e10cSrcweir 	FixedText		aFtDbAreaLabel; \
65cdf0e10cSrcweir 	FixedInfo		aFtDbArea; \
66cdf0e10cSrcweir 	const String	aStrUndefined; \
67cdf0e10cSrcweir 	const String	aStrNoName; \
68cdf0e10cSrcweir 	const String	aStrNone;
69cdf0e10cSrcweir 
70cdf0e10cSrcweir 
71cdf0e10cSrcweir #define _INIT_COMMON_FILTER_RSCOBJS \
72cdf0e10cSrcweir 	aBtnCase		( this, ScResId( BTN_CASE ) ), \
73cdf0e10cSrcweir 	aBtnRegExp		( this, ScResId( BTN_REGEXP ) ), \
74cdf0e10cSrcweir 	aBtnHeader		( this, ScResId( BTN_HEADER ) ), \
75cdf0e10cSrcweir 	aBtnUnique		( this, ScResId( BTN_UNIQUE ) ), \
76cdf0e10cSrcweir 	aBtnCopyResult	( this, ScResId( BTN_COPY_RESULT ) ), \
77cdf0e10cSrcweir 	aLbCopyArea		( this, ScResId( LB_COPY_AREA ) ), \
78cdf0e10cSrcweir     aEdCopyArea     ( this, this, ScResId( ED_COPY_AREA ) ), \
79cdf0e10cSrcweir 	aRbCopyArea		( this, ScResId( RB_COPY_AREA ), &aEdCopyArea, this ), \
80cdf0e10cSrcweir 	aBtnDestPers	( this, ScResId( BTN_DEST_PERS ) ), \
81cdf0e10cSrcweir 	aFtDbAreaLabel	( this, ScResId( FT_DBAREA_LABEL ) ), \
82cdf0e10cSrcweir 	aFtDbArea		( this, ScResId( FT_DBAREA ) ), \
83cdf0e10cSrcweir 	aStrUndefined	( ScResId( SCSTR_UNDEFINED ) ), \
84cdf0e10cSrcweir 	aStrNoName		( ScGlobal::GetRscString(STR_DB_NONAME) ), \
85cdf0e10cSrcweir 	aStrNone		( ScResId( SCSTR_NONE ) ),
86cdf0e10cSrcweir 
87cdf0e10cSrcweir 
88cdf0e10cSrcweir //============================================================================
89cdf0e10cSrcweir class ScFilterDlg : public ScAnyRefDlg
90cdf0e10cSrcweir {
91cdf0e10cSrcweir public:
92cdf0e10cSrcweir 					ScFilterDlg( SfxBindings* pB, SfxChildWindow* pCW, Window* pParent,
93cdf0e10cSrcweir 								 const SfxItemSet&	rArgSet );
94cdf0e10cSrcweir 					~ScFilterDlg();
95cdf0e10cSrcweir 
96cdf0e10cSrcweir 	virtual void	SetReference( const ScRange& rRef, ScDocument* pDoc );
97cdf0e10cSrcweir 
98cdf0e10cSrcweir 	virtual sal_Bool	IsRefInputMode() const;
99cdf0e10cSrcweir 	virtual void	SetActive();
100cdf0e10cSrcweir 
101cdf0e10cSrcweir 	virtual sal_Bool	Close();
102cdf0e10cSrcweir 	void			SliderMoved();
103cdf0e10cSrcweir 	sal_uInt16			GetSliderPos();
104cdf0e10cSrcweir 	void			RefreshEditRow( sal_uInt16 nOffset );
105cdf0e10cSrcweir 
106cdf0e10cSrcweir private:
107cdf0e10cSrcweir     FixedLine       aFlCriteria;
108cdf0e10cSrcweir 	//----------------------------
109cdf0e10cSrcweir 	ListBox			aLbConnect1;
110cdf0e10cSrcweir 	ListBox			aLbField1;
111cdf0e10cSrcweir 	ListBox			aLbCond1;
112cdf0e10cSrcweir 	ComboBox		aEdVal1;
113cdf0e10cSrcweir 	//----------------------------
114cdf0e10cSrcweir 	ListBox			aLbConnect2;
115cdf0e10cSrcweir 	ListBox			aLbField2;
116cdf0e10cSrcweir 	ListBox			aLbCond2;
117cdf0e10cSrcweir 	ComboBox		aEdVal2;
118cdf0e10cSrcweir 	//----------------------------
119cdf0e10cSrcweir 	ListBox			aLbConnect3;
120cdf0e10cSrcweir 	ListBox			aLbField3;
121cdf0e10cSrcweir 	ListBox			aLbCond3;
122cdf0e10cSrcweir 	ComboBox		aEdVal3;
123cdf0e10cSrcweir 	//----------------------------
124cdf0e10cSrcweir 	ListBox			aLbConnect4;
125cdf0e10cSrcweir 	ListBox			aLbField4;
126cdf0e10cSrcweir 	ListBox			aLbCond4;
127cdf0e10cSrcweir 	ComboBox		aEdVal4;
128cdf0e10cSrcweir 	//----------------------------
129cdf0e10cSrcweir 	FixedText		aFtConnect;
130cdf0e10cSrcweir 	FixedText		aFtField;
131cdf0e10cSrcweir 	FixedText		aFtCond;
132cdf0e10cSrcweir 	FixedText		aFtVal;
133cdf0e10cSrcweir 	FixedLine       aFlSeparator;
134cdf0e10cSrcweir 
135cdf0e10cSrcweir 	ScrollBar       aScrollBar;
136cdf0e10cSrcweir 
137cdf0e10cSrcweir     FixedLine       aFlOptions;
138cdf0e10cSrcweir     MoreButton      aBtnMore;
139cdf0e10cSrcweir     HelpButton      aBtnHelp;
140cdf0e10cSrcweir     OKButton        aBtnOk;
141cdf0e10cSrcweir     CancelButton    aBtnCancel;
142cdf0e10cSrcweir 
143cdf0e10cSrcweir 	_COMMON_FILTER_RSCOBJS
144cdf0e10cSrcweir 
145cdf0e10cSrcweir 	const String	aStrEmpty;
146cdf0e10cSrcweir 	const String	aStrNotEmpty;
147cdf0e10cSrcweir 	const String	aStrRow;
148cdf0e10cSrcweir 	const String	aStrColumn;
149cdf0e10cSrcweir 
150cdf0e10cSrcweir 	ScFilterOptionsMgr*	pOptionsMgr;
151cdf0e10cSrcweir 
152cdf0e10cSrcweir 	const sal_uInt16		nWhichQuery;
153cdf0e10cSrcweir 	const ScQueryParam	theQueryData;
154cdf0e10cSrcweir 	ScQueryItem*		pOutItem;
155cdf0e10cSrcweir 	ScViewData*			pViewData;
156cdf0e10cSrcweir 	ScDocument*			pDoc;
157cdf0e10cSrcweir 	SCTAB				nSrcTab;
158cdf0e10cSrcweir 
159cdf0e10cSrcweir 	ComboBox*			aValueEdArr[4];
160cdf0e10cSrcweir 	ListBox*			aFieldLbArr[4];
161cdf0e10cSrcweir 	ListBox*			aCondLbArr[4];
162cdf0e10cSrcweir 	ListBox*			aConnLbArr[4];
163cdf0e10cSrcweir     bool                mbHasDates[MAXQUERY];
164cdf0e10cSrcweir 	sal_Bool                bRefreshExceptQuery[MAXQUERY];
165cdf0e10cSrcweir 	sal_uInt16				nFieldCount;
166cdf0e10cSrcweir 	sal_Bool				bRefInputMode;
167cdf0e10cSrcweir 
168cdf0e10cSrcweir 	TypedScStrCollection*	pEntryLists[MAXCOLCOUNT];
169cdf0e10cSrcweir 	sal_uInt16				nHeaderPos[MAXCOLCOUNT];
170cdf0e10cSrcweir 
171cdf0e10cSrcweir 	// Hack: RefInput-Kontrolle
172cdf0e10cSrcweir 	Timer*	pTimer;
173cdf0e10cSrcweir 
174cdf0e10cSrcweir #ifdef _FILTDLG_CXX
175cdf0e10cSrcweir private:
176cdf0e10cSrcweir 	void			Init			( const SfxItemSet&	rArgSet );
177cdf0e10cSrcweir 	void			FillFieldLists	();
178cdf0e10cSrcweir 	void			FillAreaList	();
179cdf0e10cSrcweir 	void			UpdateValueList	( sal_uInt16 nList );
180cdf0e10cSrcweir 	void			UpdateHdrInValueList( sal_uInt16 nList );
181cdf0e10cSrcweir 	void			ClearValueList	( sal_uInt16 nList );
182cdf0e10cSrcweir 	sal_uInt16			GetFieldSelPos	( SCCOL nField );
183cdf0e10cSrcweir 	ScQueryItem*	GetOutputItem	();
184cdf0e10cSrcweir 
185cdf0e10cSrcweir 	// Handler:
186cdf0e10cSrcweir 	DECL_LINK( LbSelectHdl,	 ListBox* );
187cdf0e10cSrcweir 	DECL_LINK( ValModifyHdl, ComboBox* );
188cdf0e10cSrcweir 	DECL_LINK( CheckBoxHdl,	 CheckBox* );
189cdf0e10cSrcweir 	DECL_LINK( EndDlgHdl,	 Button* );
190cdf0e10cSrcweir 	DECL_LINK( MoreClickHdl, MoreButton* );
191cdf0e10cSrcweir 	DECL_LINK( ScrollHdl, ScrollBar* );
192cdf0e10cSrcweir 
193cdf0e10cSrcweir 	// Hack: RefInput-Kontrolle
194cdf0e10cSrcweir 	DECL_LINK( TimeOutHdl,	 Timer* );
195cdf0e10cSrcweir #endif
196cdf0e10cSrcweir };
197cdf0e10cSrcweir 
198cdf0e10cSrcweir 
199cdf0e10cSrcweir //============================================================================
200cdf0e10cSrcweir class ScSpecialFilterDlg : public ScAnyRefDlg
201cdf0e10cSrcweir {
202cdf0e10cSrcweir public:
203cdf0e10cSrcweir 					ScSpecialFilterDlg( SfxBindings* pB, SfxChildWindow* pCW, Window* pParent,
204cdf0e10cSrcweir 										const SfxItemSet&	rArgSet );
205cdf0e10cSrcweir 					~ScSpecialFilterDlg();
206cdf0e10cSrcweir 
207cdf0e10cSrcweir 	virtual void	SetReference( const ScRange& rRef, ScDocument* pDoc );
208cdf0e10cSrcweir 
209cdf0e10cSrcweir 	virtual sal_Bool	IsRefInputMode() const;
210cdf0e10cSrcweir 	virtual void	SetActive();
211cdf0e10cSrcweir 
212cdf0e10cSrcweir 	virtual sal_Bool	Close();
213cdf0e10cSrcweir 
214cdf0e10cSrcweir private:
215cdf0e10cSrcweir 	FixedText	aFtFilterArea;
216cdf0e10cSrcweir 	ListBox		aLbFilterArea;
217cdf0e10cSrcweir 	formula::RefEdit	aEdFilterArea;
218cdf0e10cSrcweir 	formula::RefButton	aRbFilterArea;
219cdf0e10cSrcweir 
220cdf0e10cSrcweir     FixedLine       aFlOptions;
221cdf0e10cSrcweir 
222cdf0e10cSrcweir 	_COMMON_FILTER_RSCOBJS
223cdf0e10cSrcweir 
224cdf0e10cSrcweir     OKButton        aBtnOk;
225cdf0e10cSrcweir     CancelButton    aBtnCancel;
226cdf0e10cSrcweir     HelpButton      aBtnHelp;
227cdf0e10cSrcweir     MoreButton      aBtnMore;
228cdf0e10cSrcweir 
229cdf0e10cSrcweir 	ScFilterOptionsMgr*	pOptionsMgr;
230cdf0e10cSrcweir 
231cdf0e10cSrcweir 	const sal_uInt16		nWhichQuery;
232cdf0e10cSrcweir 	const ScQueryParam	theQueryData;
233cdf0e10cSrcweir 	ScQueryItem*		pOutItem;
234cdf0e10cSrcweir 	ScViewData*			pViewData;
235cdf0e10cSrcweir 	ScDocument*			pDoc;
236cdf0e10cSrcweir 
237cdf0e10cSrcweir 	formula::RefEdit*			pRefInputEdit;
238cdf0e10cSrcweir 	sal_Bool				bRefInputMode;
239cdf0e10cSrcweir 
240cdf0e10cSrcweir 	// Hack: RefInput-Kontrolle
241cdf0e10cSrcweir 	Timer*	pTimer;
242cdf0e10cSrcweir 
243cdf0e10cSrcweir #ifdef _SFILTDLG_CXX
244cdf0e10cSrcweir private:
245cdf0e10cSrcweir 	void			Init( const SfxItemSet& rArgSet );
246cdf0e10cSrcweir 	ScQueryItem*	GetOutputItem( const ScQueryParam& rParam,
247cdf0e10cSrcweir 									const ScRange& rSource );
248cdf0e10cSrcweir 
249cdf0e10cSrcweir 	// Handler
250cdf0e10cSrcweir 	DECL_LINK( FilterAreaSelHdl, ListBox* );
251cdf0e10cSrcweir 	DECL_LINK( FilterAreaModHdl, formula::RefEdit* );
252cdf0e10cSrcweir 	DECL_LINK( EndDlgHdl,		 Button* );
253cdf0e10cSrcweir 	DECL_LINK( ScrollHdl, ScrollBar* );
254cdf0e10cSrcweir 
255cdf0e10cSrcweir 	// Hack: RefInput-Kontrolle
256cdf0e10cSrcweir 	DECL_LINK( TimeOutHdl,		 Timer* );
257cdf0e10cSrcweir #endif
258cdf0e10cSrcweir };
259cdf0e10cSrcweir 
260cdf0e10cSrcweir 
261cdf0e10cSrcweir 
262cdf0e10cSrcweir #endif // SC_FILTDLG_HXX
263cdf0e10cSrcweir 
264