1 | /** @file
|
---|
2 | * Definition of GuestDnD
|
---|
3 | */
|
---|
4 |
|
---|
5 | /*
|
---|
6 | * Copyright (C) 2011-2014 Oracle Corporation
|
---|
7 | *
|
---|
8 | * This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
9 | * available from http://www.virtualbox.org. This file is free software;
|
---|
10 | * you can redistribute it and/or modify it under the terms of the GNU
|
---|
11 | * General Public License (GPL) as published by the Free Software
|
---|
12 | * Foundation, in version 2 as it comes in the "COPYING" file of the
|
---|
13 | * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
|
---|
14 | * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
15 | */
|
---|
16 |
|
---|
17 | #ifndef ____H_GUESTDND
|
---|
18 | #define ____H_GUESTDND
|
---|
19 |
|
---|
20 | /* Forward declaration of the d-pointer. */
|
---|
21 | class GuestDnDPrivate;
|
---|
22 | #ifdef VBOX_WITH_DRAG_AND_DROP_GH
|
---|
23 | class DnDGuestResponse;
|
---|
24 | #endif
|
---|
25 |
|
---|
26 | class GuestDnD
|
---|
27 | {
|
---|
28 | public:
|
---|
29 | GuestDnD(const ComObjPtr<Guest>& pGuest);
|
---|
30 | ~GuestDnD();
|
---|
31 |
|
---|
32 | /* Host -> Guest */
|
---|
33 | HRESULT dragHGEnter(ULONG uScreenId, ULONG uX, ULONG uY, DragAndDropAction_T defaultAction, ComSafeArrayIn(DragAndDropAction_T, allowedActions), ComSafeArrayIn(IN_BSTR, formats), DragAndDropAction_T *pResultAction);
|
---|
34 | HRESULT dragHGMove(ULONG uScreenId, ULONG uX, ULONG uY, DragAndDropAction_T defaultAction, ComSafeArrayIn(DragAndDropAction_T, allowedActions), ComSafeArrayIn(IN_BSTR, formats), DragAndDropAction_T *pResultAction);
|
---|
35 | HRESULT dragHGLeave(ULONG uScreenId);
|
---|
36 | HRESULT dragHGDrop(ULONG uScreenId, ULONG uX, ULONG uY, DragAndDropAction_T defaultAction, ComSafeArrayIn(DragAndDropAction_T, allowedActions), ComSafeArrayIn(IN_BSTR, formats), BSTR *pstrFormat, DragAndDropAction_T *pResultAction);
|
---|
37 | HRESULT dragHGPutData(ULONG uScreenId, IN_BSTR wstrFormat, ComSafeArrayIn(BYTE, data), IProgress **ppProgress);
|
---|
38 |
|
---|
39 | /* Guest -> Host */
|
---|
40 | HRESULT dragGHPending(ULONG uScreenId, ComSafeArrayOut(BSTR, formats), ComSafeArrayOut(DragAndDropAction_T, allowedActions), DragAndDropAction_T *pDefaultAction);
|
---|
41 | HRESULT dragGHDropped(IN_BSTR bstrFormat, DragAndDropAction_T action, IProgress **ppProgress);
|
---|
42 | HRESULT dragGHGetData(ComSafeArrayOut(BYTE, data));
|
---|
43 |
|
---|
44 | /* Guest response */
|
---|
45 | static DECLCALLBACK(int) notifyGuestDragAndDropEvent(void *pvExtension, uint32_t u32Function, void *pvParms, uint32_t cbParms);
|
---|
46 |
|
---|
47 | protected:
|
---|
48 |
|
---|
49 | #ifdef VBOX_WITH_DRAG_AND_DROP_GH
|
---|
50 | int onGHSendData(DnDGuestResponse *pResp, const void *pvData, size_t cbData, size_t cbTotalSize);
|
---|
51 | int onGHSendDir(DnDGuestResponse *pResp, const char *pszPath, size_t cbPath, uint32_t fMode);
|
---|
52 | int onGHSendFile(DnDGuestResponse *pResp, const char *pszPath, size_t cbPath, void *pvData, size_t cbData, uint32_t fMode);
|
---|
53 | #endif /* VBOX_WITH_DRAG_AND_DROP_GH */
|
---|
54 |
|
---|
55 | private:
|
---|
56 |
|
---|
57 | /* d-pointer */
|
---|
58 | GuestDnDPrivate *d_ptr;
|
---|
59 |
|
---|
60 | friend class GuestDnDPrivate;
|
---|
61 | };
|
---|
62 |
|
---|
63 | #endif /* ____H_GUESTDND */
|
---|
64 |
|
---|