1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef SC_FILTDLG_HXX
21 #define SC_FILTDLG_HXX
23 #include <vcl/combobox.hxx>
24 #include <vcl/lstbox.hxx>
25 #include <vcl/layout.hxx>
26 #include <vcl/morebtn.hxx>
27 #include <svtools/stdctrl.hxx>
29 #include "address.hxx"
30 #include "anyrefdg.hxx"
31 #include "queryparam.hxx"
32 #include "typedstrdata.hxx"
37 #include <boost/ptr_container/ptr_map.hpp>
38 #include <boost/noncopyable.hpp>
39 #include <boost/scoped_ptr.hpp>
41 //----------------------------------------------------------------------------
43 class ScFilterOptionsMgr
;
48 class ScFilterDlg
: public ScAnyRefDlg
50 struct EntryList
: boost::noncopyable
52 std::vector
<ScTypedStrData
> maList
;
56 typedef boost::ptr_map
<SCCOL
,EntryList
> EntryListsMap
;
58 ScFilterDlg( SfxBindings
* pB
, SfxChildWindow
* pCW
, Window
* pParent
,
59 const SfxItemSet
& rArgSet
);
62 virtual void SetReference( const ScRange
& rRef
, ScDocument
* pDoc
);
64 virtual sal_Bool
IsRefInputMode() const;
65 virtual void SetActive();
67 virtual sal_Bool
Close();
69 size_t GetSliderPos();
70 void RefreshEditRow( size_t nOffset
);
77 //----------------------------
82 //----------------------------
87 //----------------------------
92 //----------------------------
93 ScrollBar
* pScrollBar
;
94 VclExpander
* pExpander
;
98 CancelButton
* pBtnCancel
;
101 CheckBox
* pBtnRegExp
;
102 CheckBox
* pBtnHeader
;
103 CheckBox
* pBtnUnique
;
104 CheckBox
* pBtnCopyResult
;
105 ListBox
* pLbCopyArea
;
106 formula::RefEdit
* pEdCopyArea
;
107 formula::RefButton
* pRbCopyArea
;
108 CheckBox
* pBtnDestPers
;
109 FixedText
* pFtDbAreaLabel
;
110 FixedText
* pFtDbArea
;
111 const OUString aStrUndefined
;
112 const OUString aStrNone
;
114 const OUString aStrEmpty
;
115 const OUString aStrNotEmpty
;
116 const OUString aStrColumn
;
118 ScFilterOptionsMgr
* pOptionsMgr
;
120 const sal_uInt16 nWhichQuery
;
121 ScQueryParam theQueryData
;
122 ScQueryItem
* pOutItem
;
123 ScViewData
* pViewData
;
127 std::vector
<ComboBox
*> maValueEdArr
;
128 std::vector
<ListBox
*> maFieldLbArr
;
129 std::vector
<ListBox
*> maCondLbArr
;
130 std::vector
<ListBox
*> maConnLbArr
;
132 std::deque
<bool> maHasDates
;
133 std::deque
<bool> maRefreshExceptQuery
;
136 EntryListsMap maEntryLists
;
138 // Hack: RefInput control
142 void Init ( const SfxItemSet
& rArgSet
);
143 void FillFieldLists ();
144 void FillAreaList ();
145 void UpdateValueList ( size_t nList
);
146 void UpdateHdrInValueList( size_t nList
);
147 void ClearValueList ( size_t nList
);
148 size_t GetFieldSelPos ( SCCOL nField
);
149 ScQueryItem
* GetOutputItem ();
152 DECL_LINK( LbSelectHdl
, ListBox
* );
153 DECL_LINK( ValModifyHdl
, ComboBox
* );
154 DECL_LINK( CheckBoxHdl
, CheckBox
* );
155 DECL_LINK( EndDlgHdl
, Button
* );
156 DECL_LINK( ScrollHdl
, void* );
157 DECL_LINK( MoreExpandedHdl
, void* );
159 // Hack: RefInput control
160 DECL_LINK( TimeOutHdl
, Timer
* );
163 class ScSpecialFilterDlg
: public ScAnyRefDlg
166 ScSpecialFilterDlg( SfxBindings
* pB
, SfxChildWindow
* pCW
, Window
* pParent
,
167 const SfxItemSet
& rArgSet
);
168 ~ScSpecialFilterDlg();
170 virtual void SetReference( const ScRange
& rRef
, ScDocument
* pDoc
);
172 virtual sal_Bool
IsRefInputMode() const;
173 virtual void SetActive();
175 virtual sal_Bool
Close();
178 ListBox
* pLbFilterArea
;
179 formula::RefEdit
* pEdFilterArea
;
180 formula::RefButton
* pRbFilterArea
;
182 VclExpander
* pExpander
;
184 CheckBox
* pBtnRegExp
;
185 CheckBox
* pBtnHeader
;
186 CheckBox
* pBtnUnique
;
187 CheckBox
* pBtnCopyResult
;
188 ListBox
* pLbCopyArea
;
189 formula::RefEdit
* pEdCopyArea
;
190 formula::RefButton
* pRbCopyArea
;
191 CheckBox
* pBtnDestPers
;
192 FixedText
* pFtDbAreaLabel
;
193 FixedText
* pFtDbArea
;
194 const OUString aStrUndefined
;
195 const OUString aStrNoName
;
198 CancelButton
* pBtnCancel
;
199 HelpButton
* pBtnHelp
;
201 ScFilterOptionsMgr
* pOptionsMgr
;
203 const sal_uInt16 nWhichQuery
;
204 const ScQueryParam theQueryData
;
205 ScQueryItem
* pOutItem
;
206 ScViewData
* pViewData
;
209 formula::RefEdit
* pRefInputEdit
;
212 // Hack: RefInput control
216 void Init( const SfxItemSet
& rArgSet
);
217 ScQueryItem
* GetOutputItem( const ScQueryParam
& rParam
,
218 const ScRange
& rSource
);
221 DECL_LINK( FilterAreaSelHdl
, ListBox
* );
222 DECL_LINK( FilterAreaModHdl
, formula::RefEdit
* );
223 DECL_LINK( EndDlgHdl
, Button
* );
224 DECL_LINK( ScrollHdl
, ScrollBar
* );
226 // Hack: RefInput control
227 DECL_LINK( TimeOutHdl
, Timer
* );
232 #endif // SC_FILTDLG_HXX
234 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */