LibreOffice Module dbaccess (master) 1
TableWindowListBox.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
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 *
9 * This file incorporates work covered by the following license notice:
10 *
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 .
18 */
19#pragma once
20
21#include <vcl/transfer.hxx>
23#include "callbacks.hxx"
24
25struct AcceptDropEvent;
26struct ExecuteDropEvent;
27namespace dbaui
28{
29 class OTableWindowListBox;
31 {
32 public:
33 VclPtr<OTableWindowListBox> pListBox; // the ListBox inside the same (you can get the TabWin and the WinName out of it)
34 int nEntry; // the entry, which was dragged or to which was dropped on
35
37 OJoinExchangeData() : pListBox(nullptr), nEntry(-1) { }
38 };
39
41 {
44 };
45
46 class OJoinExchObj;
47 class OTableWindow;
49
51 : public InterimItemWindow
53 {
54 std::unique_ptr<weld::TreeView> m_xTreeView;
55 std::unique_ptr<TableWindowListBoxHelper> m_xDragDropTargetHelper;
56
57 DECL_LINK( OnDoubleClick, weld::TreeView&, bool );
58 DECL_LINK(CommandHdl, const CommandEvent&, bool);
59 DECL_LINK( DropHdl, void*, void );
60 DECL_LINK( LookForUiHdl, void*, void );
61 DECL_LINK( DragBeginHdl, bool&, bool );
62 DECL_LINK( ScrollHdl, weld::TreeView&, void );
63
65
70
71 protected:
72 virtual void LoseFocus() override;
73 virtual void GetFocus() override;
74
75 virtual void dragFinished( ) override;
76
77 public:
79 virtual ~OTableWindowListBox() override;
80 virtual void dispose() override;
81
82 const weld::TreeView& get_widget() const { return *m_xTreeView; }
84
85 // DnD stuff
88
89 // window
90 virtual void Command(const CommandEvent& rEvt) override;
91
93 int GetEntryFromText( std::u16string_view rEntryText );
94 };
95
96 class TableWindowListBoxHelper final : public DropTargetHelper
97 {
98 private:
100
101 virtual sal_Int8 AcceptDrop(const AcceptDropEvent& rEvt) override
102 {
103 return m_rParent.AcceptDrop(rEvt);
104 }
105
106 virtual sal_Int8 ExecuteDrop(const ExecuteDropEvent& rEvt) override
107 {
108 return m_rParent.ExecuteDrop(rEvt);
109 }
110
111 public:
112 TableWindowListBoxHelper(OTableWindowListBox& rParent, const css::uno::Reference<css::datatransfer::dnd::XDropTarget>& rDropTarget)
113 : DropTargetHelper(rDropTarget)
114 , m_rParent(rParent)
115 {
116 }
117 };
118}
119
120
121/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
VclPtr< OTableWindow > m_pTabWin
DECL_LINK(LookForUiHdl, void *, void)
virtual void dragFinished() override
called when a drag operation done with a Transferable has been finished
int GetEntryFromText(std::u16string_view rEntryText)
OTableWindowListBox(OTableWindow *pParent)
DECL_LINK(CommandHdl, const CommandEvent &, bool)
sal_Int8 AcceptDrop(const AcceptDropEvent &rEvt)
virtual void LoseFocus() override
virtual void dispose() override
DECL_LINK(DropHdl, void *, void)
std::unique_ptr< TableWindowListBoxHelper > m_xDragDropTargetHelper
sal_Int8 ExecuteDrop(const ExecuteDropEvent &rEvt)
virtual void GetFocus() override
virtual void Command(const CommandEvent &rEvt) override
const weld::TreeView & get_widget() const
std::unique_ptr< weld::TreeView > m_xTreeView
virtual ~OTableWindowListBox() override
DECL_LINK(ScrollHdl, weld::TreeView &, void)
DECL_LINK(DragBeginHdl, bool &, bool)
DECL_LINK(OnDoubleClick, weld::TreeView &, bool)
rtl::Reference< OJoinExchObj > m_xHelper
virtual sal_Int8 AcceptDrop(const AcceptDropEvent &rEvt) override
virtual sal_Int8 ExecuteDrop(const ExecuteDropEvent &rEvt) override
TableWindowListBoxHelper(OTableWindowListBox &rParent, const css::uno::Reference< css::datatransfer::dnd::XDropTarget > &rDropTarget)
OJoinExchangeData aDest
OJoinExchangeData aSource
VclPtr< OTableWindowListBox > pListBox
signed char sal_Int8