VirtualBox

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

最後變更 在這個檔案從85018是 85018,由 vboxsync 提交於 5 年 前

DnD/Main: Renaming internal send/receive data contexts to emphasize that these actually are classes and not POD types.

  • 屬性 svn:eol-style 設為 native
  • 屬性 svn:keywords 設為 Author Date Id Revision
檔案大小: 4.0 KB
 
1/* $Id: GuestDnDTargetImpl.h 85018 2020-07-01 10:42:45Z vboxsync $ */
2/** @file
3 * VBox Console COM Class implementation - Guest drag'n drop target.
4 */
5
6/*
7 * Copyright (C) 2014-2020 Oracle Corporation
8 *
9 * This file is part of VirtualBox Open Source Edition (OSE), as
10 * available from http://www.alldomusa.eu.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 MAIN_INCLUDED_GuestDnDTargetImpl_h
19#define MAIN_INCLUDED_GuestDnDTargetImpl_h
20#ifndef RT_WITHOUT_PRAGMA_ONCE
21# pragma once
22#endif
23
24#include "GuestDnDTargetWrap.h"
25#include "GuestDnDPrivate.h"
26
27#include <VBox/GuestHost/DragAndDrop.h>
28#include <VBox/HostServices/DragAndDropSvc.h>
29
30struct GuestDnDSendCtx;
31class SendDataTask;
32
33class ATL_NO_VTABLE GuestDnDTarget :
34 public GuestDnDTargetWrap,
35 public GuestDnDBase
36{
37public:
38 /** @name COM and internal init/term/mapping cruft.
39 * @{ */
40 DECLARE_EMPTY_CTOR_DTOR(GuestDnDTarget)
41
42 int init(const ComObjPtr<Guest>& pGuest);
43 void uninit(void);
44
45 HRESULT FinalConstruct(void);
46 void FinalRelease(void);
47 /** @} */
48
49private:
50
51 /** Private wrapped @name IDnDBase methods.
52 * @{ */
53 HRESULT isFormatSupported(const com::Utf8Str &aFormat, BOOL *aSupported);
54 HRESULT getFormats(GuestDnDMIMEList &aFormats);
55 HRESULT addFormats(const GuestDnDMIMEList &aFormats);
56 HRESULT removeFormats(const GuestDnDMIMEList &aFormats);
57
58 HRESULT getProtocolVersion(ULONG *aProtocolVersion);
59 /** @} */
60
61 /** Private wrapped @name IDnDTarget methods.
62 * @{ */
63 HRESULT enter(ULONG aScreenId, ULONG ax, ULONG aY, DnDAction_T aDefaultAction, const std::vector<DnDAction_T> &aAllowedActions, const GuestDnDMIMEList &aFormats, DnDAction_T *aResultAction);
64 HRESULT move(ULONG aScreenId, ULONG aX, ULONG aY, DnDAction_T aDefaultAction, const std::vector<DnDAction_T> &aAllowedActions, const GuestDnDMIMEList &aFormats, DnDAction_T *aResultAction);
65 HRESULT leave(ULONG aScreenId);
66 HRESULT drop(ULONG aScreenId, ULONG aX, ULONG aY, DnDAction_T aDefaultAction, const std::vector<DnDAction_T> &aAllowedActions, const GuestDnDMIMEList &aFormats, com::Utf8Str &aFormat, DnDAction_T *aResultAction);
67 HRESULT sendData(ULONG aScreenId, const com::Utf8Str &aFormat, const std::vector<BYTE> &aData, ComPtr<IProgress> &aProgress);
68 HRESULT cancel(BOOL *aVeto);
69 /** @} */
70
71protected:
72
73 static Utf8Str i_guestErrorToString(int guestRc);
74 static Utf8Str i_hostErrorToString(int hostRc);
75
76 /** @name Thread task workers.
77 * @{ */
78 static void i_sendDataThreadTask(SendDataTask *pTask);
79 /** @} */
80
81 /** @name Callbacks for dispatch handler.
82 * @{ */
83 static DECLCALLBACK(int) i_sendURIDataCallback(uint32_t uMsg, void *pvParms, size_t cbParms, void *pvUser);
84 /** @} */
85
86protected:
87
88 int i_sendData(GuestDnDSendCtx *pCtx, RTMSINTERVAL msTimeout);
89 int i_sendDataBody(GuestDnDSendCtx *pCtx, GuestDnDData *pData);
90 int i_sendDataHeader(GuestDnDSendCtx *pCtx, GuestDnDData *pData, GuestDnDURIData *pURIData /* = NULL */);
91 int i_sendDirectory(GuestDnDSendCtx *pCtx, GuestDnDURIObjCtx *pObjCtx, GuestDnDMsg *pMsg);
92 int i_sendFile(GuestDnDSendCtx *pCtx, GuestDnDURIObjCtx *pObjCtx, GuestDnDMsg *pMsg);
93 int i_sendFileData(GuestDnDSendCtx *pCtx, GuestDnDURIObjCtx *pObjCtx, GuestDnDMsg *pMsg);
94 int i_sendRawData(GuestDnDSendCtx *pCtx, RTMSINTERVAL msTimeout);
95 int i_sendURIData(GuestDnDSendCtx *pCtx, RTMSINTERVAL msTimeout);
96 int i_sendURIDataLoop(GuestDnDSendCtx *pCtx, GuestDnDMsg *pMsg);
97
98protected:
99
100 struct
101 {
102 bool mfTransferIsPending;
103 /** Maximum data block size (in bytes) the target can handle. */
104 uint32_t mcbBlockSize;
105 } mData;
106
107 friend class SendDataTask;
108};
109
110#endif /* !MAIN_INCLUDED_GuestDnDTargetImpl_h */
111
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

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