Stop leaking all ScPostIt instances.
[LibreOffice.git] / sc / source / ui / inc / filtdlg.hxx
blob0f2d71a74dda671d72bbe6490f514179bff47c52
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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>
28 #include "global.hxx"
29 #include "address.hxx"
30 #include "anyrefdg.hxx"
31 #include "queryparam.hxx"
32 #include "typedstrdata.hxx"
34 #include <deque>
35 #include <vector>
36 #include <map>
37 #include <boost/ptr_container/ptr_map.hpp>
38 #include <boost/noncopyable.hpp>
39 #include <boost/scoped_ptr.hpp>
41 //----------------------------------------------------------------------------
43 class ScFilterOptionsMgr;
44 class ScViewData;
45 class ScDocument;
46 class ScQueryItem;
48 class ScFilterDlg : public ScAnyRefDlg
50 struct EntryList : boost::noncopyable
52 std::vector<ScTypedStrData> maList;
53 size_t mnHeaderPos;
54 EntryList();
56 typedef boost::ptr_map<SCCOL,EntryList> EntryListsMap;
57 public:
58 ScFilterDlg( SfxBindings* pB, SfxChildWindow* pCW, Window* pParent,
59 const SfxItemSet& rArgSet );
60 ~ScFilterDlg();
62 virtual void SetReference( const ScRange& rRef, ScDocument* pDoc );
64 virtual sal_Bool IsRefInputMode() const;
65 virtual void SetActive();
67 virtual sal_Bool Close();
68 void SliderMoved();
69 size_t GetSliderPos();
70 void RefreshEditRow( size_t nOffset );
72 private:
73 ListBox* pLbConnect1;
74 ListBox* pLbField1;
75 ListBox* pLbCond1;
76 ComboBox* pEdVal1;
77 //----------------------------
78 ListBox* pLbConnect2;
79 ListBox* pLbField2;
80 ListBox* pLbCond2;
81 ComboBox* pEdVal2;
82 //----------------------------
83 ListBox* pLbConnect3;
84 ListBox* pLbField3;
85 ListBox* pLbCond3;
86 ComboBox* pEdVal3;
87 //----------------------------
88 ListBox* pLbConnect4;
89 ListBox* pLbField4;
90 ListBox* pLbCond4;
91 ComboBox* pEdVal4;
92 //----------------------------
93 ScrollBar* pScrollBar;
94 VclExpander* pExpander;
96 HelpButton* pBtnHelp;
97 OKButton* pBtnOk;
98 CancelButton* pBtnCancel;
100 CheckBox* pBtnCase;
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;
124 ScDocument* pDoc;
125 SCTAB nSrcTab;
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;
134 bool bRefInputMode;
136 EntryListsMap maEntryLists;
138 // Hack: RefInput control
139 Timer* pTimer;
141 private:
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 ();
151 // Handler:
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
165 public:
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();
177 private:
178 ListBox* pLbFilterArea;
179 formula::RefEdit* pEdFilterArea;
180 formula::RefButton* pRbFilterArea;
182 VclExpander* pExpander;
183 CheckBox* pBtnCase;
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;
197 OKButton* pBtnOk;
198 CancelButton* pBtnCancel;
199 HelpButton* pBtnHelp;
201 ScFilterOptionsMgr* pOptionsMgr;
203 const sal_uInt16 nWhichQuery;
204 const ScQueryParam theQueryData;
205 ScQueryItem* pOutItem;
206 ScViewData* pViewData;
207 ScDocument* pDoc;
209 formula::RefEdit* pRefInputEdit;
210 bool bRefInputMode;
212 // Hack: RefInput control
213 Timer* pTimer;
215 private:
216 void Init( const SfxItemSet& rArgSet );
217 ScQueryItem* GetOutputItem( const ScQueryParam& rParam,
218 const ScRange& rSource );
220 // Handler
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: */