Version 5.2.6.1, tag libreoffice-5.2.6.1
[LibreOffice.git] / sc / source / ui / inc / sortkeydlg.hxx
blob8ed729b2d2b626a4c4ffc6b925e147d88bb3ea01
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 INCLUDED_SC_SOURCE_UI_INC_SORTKEYDLG_HXX
11 #define INCLUDED_SC_SOURCE_UI_INC_SORTKEYDLG_HXX
13 #include <vector>
14 #include <memory>
16 #include "anyrefdg.hxx"
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 struct ScSortKeyItem : public VclBuilderContainer
29 VclPtr<VclFrame> m_pFrame;
30 VclPtr<FixedText> m_pFlSort;
31 VclPtr<ListBox> m_pLbSort;
32 VclPtr<RadioButton> m_pBtnUp;
33 VclPtr<RadioButton> m_pBtnDown;
35 ScSortKeyItem(vcl::Window* pParent);
37 void DisableField();
38 void EnableField();
40 long getItemHeight() const;
43 typedef std::vector<std::unique_ptr<ScSortKeyItem> > ScSortKeyItems;
45 class ScSortKeyWindow
47 private:
48 VclPtr<VclBox> m_pBox;
49 sal_Int32 nItemHeight;
51 ScSortKeyItems& mrSortKeyItems;
53 public:
54 ScSortKeyWindow(SfxTabPage* pParent, ScSortKeyItems& mrSortKeyItems);
55 ~ScSortKeyWindow();
56 void dispose();
58 void AddSortKey( sal_uInt16 nItem );
59 void DoScroll( sal_Int32 nNewPos );
60 sal_Int32 GetItemHeight() const { return nItemHeight; }
63 class ScSortKeyCtrl
65 private:
66 ScSortKeyWindow m_aSortWin;
67 VclScrolledWindow& m_rScrolledWindow;
68 ScrollBar& m_rVertScroll;
70 DECL_LINK_TYPED(ScrollHdl, ScrollBar*, void);
72 void checkAutoVScroll();
74 public:
75 ScSortKeyCtrl(SfxTabPage* pParent, ScSortKeyItems& mrSortKeyItems);
76 void dispose();
77 void setScrollRange();
78 void AddSortKey( sal_uInt16 nItem );
81 #endif // INCLUDED_SC_SOURCE_UI_INC_SORTKEYDLG_HXX
83 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */