summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorSzymon Kłos <szymon.klos@collabora.com>2020-12-19 15:52:33 +0100
committerSzymon Kłos <szymon.klos@collabora.com>2020-12-19 17:54:01 +0100
commitd4268144906ef261c6a7e32502925edd5c6dc16b (patch)
tree2ad50faeaf4e910bef9edc28737ec5db2454edd9 /include
parent12b10714003693a238c5f5b66c26d61e26c05a7a (diff)
Start Drag event support
part of 19d17a7 Change-Id: I1a1b5fd4f4aedbf79f64fdb4334aadc014b4eabb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108026 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
Diffstat (limited to 'include')
-rw-r--r--include/vcl/salvtables.hxx5
-rw-r--r--include/vcl/transfer.hxx2
-rw-r--r--include/vcl/treelistbox.hxx6
-rw-r--r--include/vcl/weld.hxx10
4 files changed, 21 insertions, 2 deletions
diff --git a/include/vcl/salvtables.hxx b/include/vcl/salvtables.hxx
index 401cbb0702a3..b96d02f0a5a8 100644
--- a/include/vcl/salvtables.hxx
+++ b/include/vcl/salvtables.hxx
@@ -1138,7 +1138,7 @@ protected:
DECL_LINK(HeaderBarClickedHdl, HeaderBar*, void);
DECL_LINK(ToggleHdl, SvLBoxButtonData*, void);
DECL_LINK(ModelChangedHdl, SvTreeListBox*, void);
- DECL_LINK(StartDragHdl, SvTreeListBox*, void);
+ DECL_LINK(StartDragHdl, SvTreeListBox*, bool);
DECL_STATIC_LINK(SalInstanceTreeView, FinishDragHdl, SvTreeListBox*, void);
DECL_LINK(EditingEntryHdl, SvTreeListEntry*, bool);
typedef std::pair<SvTreeListEntry*, OUString> IterString;
@@ -1373,6 +1373,9 @@ public:
virtual void set_id(const weld::TreeIter& rIter, const OUString& rId) override;
+ virtual void enable_drag_source(rtl::Reference<TransferDataContainer>& rHelper,
+ sal_uInt8 eDNDConstants) override;
+
virtual void set_selection_mode(SelectionMode eMode) override;
virtual void all_foreach(const std::function<bool(weld::TreeIter&)>& func) override;
diff --git a/include/vcl/transfer.hxx b/include/vcl/transfer.hxx
index 75af922a007c..a0b773984d3b 100644
--- a/include/vcl/transfer.hxx
+++ b/include/vcl/transfer.hxx
@@ -483,7 +483,7 @@ public:
struct TransferDataContainer_Impl;
-class VCL_DLLPUBLIC TransferDataContainer final : public TransferableHelper
+class VCL_DLLPUBLIC TransferDataContainer : public TransferableHelper
{
std::unique_ptr<TransferDataContainer_Impl> pImpl;
diff --git a/include/vcl/treelistbox.hxx b/include/vcl/treelistbox.hxx
index d0fcfabd9e01..537e4abc7a8d 100644
--- a/include/vcl/treelistbox.hxx
+++ b/include/vcl/treelistbox.hxx
@@ -227,9 +227,13 @@ class VCL_DLLPUBLIC SvTreeListBox
SelectionMode eSelMode;
sal_Int32 nMinWidthInChars;
+ sal_Int8 mnDragAction;
+
SvTreeListEntry* pEdEntry;
SvLBoxItem* pEdItem;
+ rtl::Reference<TransferDataContainer> m_xTransferHelper;
+
protected:
std::unique_ptr<SvImpLBox> pImpl;
short nColumns;
@@ -736,6 +740,8 @@ public:
void SetForceMakeVisible(bool bEnable);
virtual FactoryFunction GetUITestFactory() const override;
+
+ void SetDragHelper(rtl::Reference<TransferDataContainer>& rHelper, sal_uInt8 eDNDConstants);
};
class SvInplaceEdit2
diff --git a/include/vcl/weld.hxx b/include/vcl/weld.hxx
index 496f1e718f7c..3acf96b1fcf7 100644
--- a/include/vcl/weld.hxx
+++ b/include/vcl/weld.hxx
@@ -63,6 +63,7 @@ enum class PointerStyle;
class SvNumberFormatter;
class KeyEvent;
class MouseEvent;
+class TransferDataContainer;
class OutputDevice;
class VirtualDevice;
struct SystemEnvData;
@@ -709,7 +710,10 @@ protected:
Link<const TreeIter&, bool> m_aCollapsingHdl;
Link<TreeView&, void> m_aVisibleRangeChangedHdl;
Link<TreeView&, void> m_aModelChangedHdl;
+ // if handler returns true, then menu has been show and event is consumed
Link<const CommandEvent&, bool> m_aPopupMenuHdl;
+ // if handler returns true, drag is disallowed
+ Link<TreeView&, bool> m_aDragBeginHdl;
std::function<int(const weld::TreeIter&, const weld::TreeIter&)> m_aCustomSort;
std::vector<int> m_aRadioIndexes;
@@ -978,6 +982,12 @@ public:
m_aPopupMenuHdl = rLink;
}
+ virtual void enable_drag_source(rtl::Reference<TransferDataContainer>& rTransferrable,
+ sal_uInt8 eDNDConstants)
+ = 0;
+
+ void connect_drag_begin(const Link<TreeView&, bool>& rLink) { m_aDragBeginHdl = rLink; }
+
//all of them
void select_all() { unselect(-1); }
void unselect_all() { select(-1); }