1 | /* $Id: UIDnDDropSource_win.h 103803 2024-03-12 11:15:18Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * VBox Qt GUI - UIDnDDropSource class declaration.
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2014-2023 Oracle and/or its affiliates.
|
---|
8 | *
|
---|
9 | * This file is part of VirtualBox base platform packages, as
|
---|
10 | * available from https://www.virtualbox.org.
|
---|
11 | *
|
---|
12 | * This program is free software; you can redistribute it and/or
|
---|
13 | * modify it under the terms of the GNU General Public License
|
---|
14 | * as published by the Free Software Foundation, in version 3 of the
|
---|
15 | * License.
|
---|
16 | *
|
---|
17 | * This program is distributed in the hope that it will be useful, but
|
---|
18 | * WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
---|
20 | * General Public License for more details.
|
---|
21 | *
|
---|
22 | * You should have received a copy of the GNU General Public License
|
---|
23 | * along with this program; if not, see <https://www.gnu.org/licenses>.
|
---|
24 | *
|
---|
25 | * SPDX-License-Identifier: GPL-3.0-only
|
---|
26 | */
|
---|
27 |
|
---|
28 | #ifndef FEQT_INCLUDED_SRC_runtime_UIDnDDropSource_win_h
|
---|
29 | #define FEQT_INCLUDED_SRC_runtime_UIDnDDropSource_win_h
|
---|
30 | #ifndef RT_WITHOUT_PRAGMA_ONCE
|
---|
31 | # pragma once
|
---|
32 | #endif
|
---|
33 |
|
---|
34 | /* COM includes: */
|
---|
35 |
|
---|
36 | class UIDnDDataObject;
|
---|
37 |
|
---|
38 | /**
|
---|
39 | * Implementation of IDropSource for drag and drop on the host.
|
---|
40 | */
|
---|
41 | class UIDnDDropSource : public IDropSource
|
---|
42 | {
|
---|
43 | public:
|
---|
44 |
|
---|
45 | UIDnDDropSource(QWidget *pParent, UIDnDDataObject *pDataObject);
|
---|
46 | virtual ~UIDnDDropSource(void);
|
---|
47 |
|
---|
48 | public:
|
---|
49 |
|
---|
50 | uint32_t GetCurrentAction(void) const { return m_uCurAction; }
|
---|
51 |
|
---|
52 | public: /* IUnknown methods. */
|
---|
53 |
|
---|
54 | STDMETHOD(QueryInterface)(REFIID iid, void ** ppvObject);
|
---|
55 | STDMETHOD_(ULONG, AddRef)(void);
|
---|
56 | STDMETHOD_(ULONG, Release)(void);
|
---|
57 |
|
---|
58 | public: /* IDropSource methods. */
|
---|
59 |
|
---|
60 | STDMETHOD(QueryContinueDrag)(BOOL fEscapePressed, DWORD dwKeyState);
|
---|
61 | STDMETHOD(GiveFeedback)(DWORD dwEffect);
|
---|
62 |
|
---|
63 | protected:
|
---|
64 |
|
---|
65 | /** Pointer to parent widget. */
|
---|
66 | QWidget *m_pParent;
|
---|
67 | /** Pointer to current data object. */
|
---|
68 | UIDnDDataObject *m_pDataObject;
|
---|
69 | /** The current reference count. */
|
---|
70 | LONG m_cRefCount;
|
---|
71 | /** Current (last) drop effect issued. */
|
---|
72 | DWORD m_dwCurEffect;
|
---|
73 | /** Current drop action to perform in case of a successful drop. */
|
---|
74 | Qt::DropActions m_uCurAction;
|
---|
75 | };
|
---|
76 |
|
---|
77 | #endif /* !FEQT_INCLUDED_SRC_runtime_UIDnDDropSource_win_h */
|
---|
78 |
|
---|