VirtualBox

source: vbox/trunk/src/VBox/Main/include/GuestDnDTargetImpl.h@ 55582

Last change on this file since 55582 was 55571, checked in by vboxsync, 10 years ago

DnD: Simplified cancellation logic.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 3.5 KB
Line 
1/* $Id: GuestDnDTargetImpl.h 55571 2015-04-30 17:04:37Z vboxsync $ */
2/** @file
3 * VBox Console COM Class implementation - Guest drag'n drop target.
4 */
5
6/*
7 * Copyright (C) 2014-2015 Oracle Corporation
8 *
9 * This file is part of VirtualBox Open Source Edition (OSE), as
10 * available from http://www.virtualbox.org. This file is free software;
11 * you can redistribute it and/or modify it under the terms of the GNU
12 * General Public License (GPL) as published by the Free Software
13 * Foundation, in version 2 as it comes in the "COPYING" file of the
14 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
15 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
16 */
17
18#ifndef ____H_GUESTDNDTARGETIMPL
19#define ____H_GUESTDNDTARGETIMPL
20
21#include "GuestDnDTargetWrap.h"
22#include "GuestDnDPrivate.h"
23
24#include <VBox/GuestHost/DragAndDrop.h>
25#include <VBox/HostServices/DragAndDropSvc.h>
26
27struct SENDDATACTX;
28typedef struct SENDDATACTX *PSENDDATACTX;
29
30class ATL_NO_VTABLE GuestDnDTarget :
31 public GuestDnDTargetWrap,
32 public GuestDnDBase
33{
34public:
35 /** @name COM and internal init/term/mapping cruft.
36 * @{ */
37 DECLARE_EMPTY_CTOR_DTOR(GuestDnDTarget)
38
39 int init(const ComObjPtr<Guest>& pGuest);
40 void uninit(void);
41
42 HRESULT FinalConstruct(void);
43 void FinalRelease(void);
44 /** @} */
45
46private:
47
48 /** Private wrapped @name IDnDBase methods.
49 * @{ */
50 HRESULT isFormatSupported(const com::Utf8Str &aFormat, BOOL *aSupported);
51 HRESULT getFormats(std::vector<com::Utf8Str> &aFormats);
52 HRESULT addFormats(const std::vector<com::Utf8Str> &aFormats);
53 HRESULT removeFormats(const std::vector<com::Utf8Str> &aFormats);
54
55 HRESULT getProtocolVersion(ULONG *aProtocolVersion);
56 /** @} */
57
58 /** Private wrapped @name IDnDTarget methods.
59 * @{ */
60 HRESULT enter(ULONG aScreenId, ULONG ax, ULONG aY, DnDAction_T aDefaultAction, const std::vector<DnDAction_T> &aAllowedActions, const std::vector<com::Utf8Str> &aFormats, DnDAction_T *aResultAction);
61 HRESULT move(ULONG aScreenId, ULONG aX, ULONG aY, DnDAction_T aDefaultAction, const std::vector<DnDAction_T> &aAllowedActions, const std::vector<com::Utf8Str> &aFormats, DnDAction_T *aResultAction);
62 HRESULT leave(ULONG aScreenId);
63 HRESULT drop(ULONG aScreenId, ULONG aX, ULONG aY, DnDAction_T aDefaultAction, const std::vector<DnDAction_T> &aAllowedActions, const std::vector<com::Utf8Str> &aFormats, com::Utf8Str &aFormat, DnDAction_T *aResultAction);
64 HRESULT sendData(ULONG aScreenId, const com::Utf8Str &aFormat, const std::vector<BYTE> &aData, ComPtr<IProgress> &aProgress);
65 HRESULT cancel(BOOL *aVeto);
66 /** @} */
67
68protected:
69
70 static DECLCALLBACK(int) i_sendDataThread(RTTHREAD Thread, void *pvUser);
71 static DECLCALLBACK(int) i_sendURIDataCallback(uint32_t uMsg, void *pvParms, size_t cbParms, void *pvUser);
72
73protected:
74
75 int i_cancelOperation(void);
76 int i_sendData(PSENDDATACTX pCtx, RTMSINTERVAL msTimeout);
77 int i_sendDirectory(PSENDDATACTX pCtx, GuestDnDMsg *pMsg, DnDURIObject &aDirectory);
78 int i_sendFile(PSENDDATACTX pCtx, GuestDnDMsg *pMsg, DnDURIObject &aFile);
79 int i_sendFileData(PSENDDATACTX pCtx, GuestDnDMsg *pMsg, DnDURIObject &aFile);
80 int i_sendURIData(PSENDDATACTX pCtx, RTMSINTERVAL msTimeout);
81 int i_sendRawData(PSENDDATACTX pCtx, RTMSINTERVAL msTimeout);
82 int i_sendURIDataLoop(PSENDDATACTX pCtx, GuestDnDMsg *pMsg);
83
84protected:
85
86 struct
87 {
88 bool mfTransferIsPending;
89 /** Maximum data block size (in bytes) the target can handle. */
90 uint32_t mcbBlockSize;
91 } mData;
92};
93
94#endif /* !____H_GUESTDNDTARGETIMPL */
95
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette