Stop leaking all ScPostIt instances.
[LibreOffice.git] / sc / source / ui / inc / sortkeydlg.hxx
blob88e6012cc1a9ee078862cda5219e46d60ef59f74
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/.
8 */
10 #ifndef SC_SORTKEYDLG_HXX
11 #define SC_SORTKEYDLG_HXX
13 #include <boost/ptr_container/ptr_vector.hpp>
15 #include "anyrefdg.hxx"
16 #include "sortdlg.hrc"
18 #include <vcl/edit.hxx>
19 #include <vcl/fixed.hxx>
20 #include <vcl/layout.hxx>
21 #include <vcl/lstbox.hxx>
22 #include <vcl/scrbar.hxx>
23 #include <vcl/ctrl.hxx>
24 #include <svtools/stdctrl.hxx>
25 #include <svx/langbox.hxx>
27 // =======================================================================
29 struct ScSortKeyItem : public VclBuilderContainer
31 VclFrame* m_pFrame;
32 FixedText* m_pFlSort;
33 ListBox* m_pLbSort;
34 RadioButton* m_pBtnUp;
35 RadioButton* m_pBtnDown;
37 ScSortKeyItem(Window* pParent);
39 void DisableField();
40 void EnableField();
42 long getItemHeight() const;
45 typedef boost::ptr_vector<ScSortKeyItem> ScSortKeyItems;
47 // =======================================================================
49 class ScSortKeyWindow
51 private:
52 VclBox* m_pBox;
53 sal_Int32 nItemHeight;
55 ScSortKeyItems& mrSortKeyItems;
57 public:
58 ScSortKeyWindow(SfxTabPage* pParent, ScSortKeyItems& mrSortKeyItems);
59 ~ScSortKeyWindow();
61 void AddSortKey( sal_uInt16 nItem );
62 void DoScroll( sal_Int32 nNewPos );
63 sal_Int32 GetItemHeight() const { return nItemHeight; }
64 sal_Int32 GetTotalHeight() const { return m_pBox->GetSizePixel().Height(); }
67 // =======================================================================
69 class ScSortKeyCtrl
71 private:
72 ScSortKeyWindow m_aSortWin;
73 VclScrolledWindow& m_rScrolledWindow;
74 ScrollBar& m_rVertScroll;
76 DECL_LINK(ScrollHdl, ScrollBar*);
78 void checkAutoVScroll();
80 public:
81 ScSortKeyCtrl(SfxTabPage* pParent, ScSortKeyItems& mrSortKeyItems);
82 void setScrollRange();
83 void AddSortKey( sal_uInt16 nItem );
86 #endif // SC_SORTKEYDLG_HXX
88 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */