tdf#130857 qt weld: Implement QtInstanceWidget::strip_mnemonic
[LibreOffice.git] / sc / source / ui / inc / PivotLayoutTreeListBase.hxx
blob51858de68530b0c6e52200fd585f09d909008c26
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 */
11 #pragma once
13 #include <vcl/transfer.hxx>
14 #include <vcl/weld.hxx>
15 #include <pivot.hxx>
17 class ScPivotLayoutDialog;
18 class ScPivotLayoutTreeListBase;
19 class ScItemValue;
21 class ScPivotLayoutTreeDropTarget : public DropTargetHelper
23 private:
24 ScPivotLayoutTreeListBase& m_rTreeView;
26 virtual sal_Int8 AcceptDrop(const AcceptDropEvent& rEvt) override;
27 virtual sal_Int8 ExecuteDrop(const ExecuteDropEvent& rEvt) override;
29 public:
30 ScPivotLayoutTreeDropTarget(ScPivotLayoutTreeListBase& rTreeView);
33 class ScPivotLayoutTreeListBase
35 public:
36 enum SvPivotTreeListType
38 UNDEFINED,
39 LABEL_LIST,
40 PAGE_LIST,
41 ROW_LIST,
42 COLUMN_LIST
45 protected:
46 std::unique_ptr<weld::TreeView> mxControl;
47 ScPivotLayoutTreeDropTarget maDropTargetHelper;
48 SvPivotTreeListType meType;
49 ScPivotLayoutDialog* mpParent;
51 DECL_LINK(GetFocusHdl, weld::Widget&, void);
52 DECL_LINK(MnemonicActivateHdl, weld::Widget&, bool);
53 DECL_LINK(LoseFocusHdl, weld::Widget&, void);
55 public:
56 void Setup(ScPivotLayoutDialog* pParent);
58 ScPivotLayoutTreeListBase(std::unique_ptr<weld::TreeView> xControl,
59 SvPivotTreeListType eType = UNDEFINED);
60 weld::TreeView& get_widget() { return *mxControl; }
61 virtual ~ScPivotLayoutTreeListBase();
63 void PushEntriesToPivotFieldVector(ScPivotFieldVector& rVector);
65 void RemoveEntryForItem(const ScItemValue* pItemValue);
67 virtual void InsertEntryForSourceTarget(weld::TreeView& rSource, int nTarget);
70 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */