VBoxDnD.h revision b35358a47f67398b71a08eb89e6617493a847f7d
/* $Id$ */
/** @file
* VBoxDnD.h - Windows-specific bits of the drag'n drop service.
*/
/*
* Copyright (C) 2013-2014 Oracle Corporation
*
* This file is part of VirtualBox Open Source Edition (OSE), as
* available from http://www.virtualbox.org. This file is free software;
* General Public License (GPL) as published by the Free Software
* Foundation, in version 2 as it comes in the "COPYING" file of the
* VirtualBox OSE distribution. VirtualBox OSE is distributed in the
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
#ifndef __VBOXTRAYDND__H
#define __VBOXTRAYDND__H
#include <iprt/critsect.h>
{
enum Status
{
Uninitialized = 0,
};
virtual ~VBoxDnDDataObject(void);
public: /* IUnknown methods. */
public: /* IDataObject methods. */
int Abort(void);
void *mpvData;
};
{
virtual ~VBoxDnDDropSource(void);
public: /* IUnknown methods. */
public: /* IDropSource methods. */
};
{
virtual ~VBoxDnDDropTarget(void);
public: /* IUnknown methods. */
public: /* IDropTarget methods. */
bool mfHasDropData;
};
{
virtual ~VBoxDnDEnumFormatEtc(void);
static HRESULT CreateEnumFormatEtc(UINT cFormats, FORMATETC *pFormatEtc, IEnumFORMATETC **ppEnumFormatEtc);
};
struct VBOXDNDCONTEXT;
/*
* A drag'n drop event from the host.
*/
typedef struct VBOXDNDEVENT
{
/** The actual event data. */
/**
* DnD context data.
*/
typedef struct VBOXDNDCONTEXT
{
/** Pointer to the service environment. */
const VBOXSERVICEENV *pEnv;
/** Shutdown indicator. */
bool fShutdown;
/** Thread handle for main event queue
* processing. */
/** The DnD main event queue. */
/** Semaphore for waiting on main event queue
* events. */
/** List of drag'n drop windows. At
* the moment only one source is supported. */
static VBOXDNDCONTEXT gCtx = {0};
/**
* Everything which is required to successfully start
* a drag'n drop operation via DoDragDrop().
*/
typedef struct VBOXDNDSTARTUPINFO
{
/** Our DnD data object, holding
* the raw DnD data. */
/** The drop source for sending the
* DnD request to a IDropTarget. */
/** The DnD effects which are wanted / allowed. */
/**
* Class for handling a DnD proxy window.
** @todo Unify this and VBoxClient's DragInstance!
*/
{
/**
* Current state of a DnD proxy
* window.
*/
enum State
{
Uninitialized = 0,
};
/**
* Current operation mode of
* a DnD proxy window.
*/
enum Mode
{
/** Unknown mode. */
Unknown = 0,
/** Host to guest. */
HG,
/** Guest to host. */
};
VBoxDnDWnd(void);
virtual ~VBoxDnDWnd(void);
/** The window's thread for the native message pump and
* OLE context. */
static BOOL CALLBACK MonitorEnumProc(HMONITOR hMonitor, HDC hdcMonitor, LPRECT lprcMonitor, LPARAM lParam);
/** The per-instance wndproc routine. */
#ifdef VBOX_WITH_DRAG_AND_DROP_GH
int RegisterAsDropTarget(void);
int UnregisterAsDropTarget(void);
#endif
int OnCreate(void);
void OnDestroy(void);
/* H->G */
int OnHgDrop(void);
int OnHgLeave(void);
int OnHgCancel(void);
#ifdef VBOX_WITH_DRAG_AND_DROP_GH
/* G->H */
#endif
int hide(void);
int dragRelease(void);
int makeFullscreen(void);
void reset(void);
public: /** @todo Make protected! */
/** Pointer to DnD context. */
#ifdef RT_OS_WINDOWS
/** The window's handle. */
/** List of allowed MIME types this
* client can handle. Make this a per-instance
* certain types later on runtime. */
/** List of formats for the current
* drag'n drop operation. */
/** Flags of all current drag'n drop
* actions allowed. */
/** The startup information required
* for the actual DoDragDrop() call. */
/** Is the left mouse button being pressed
* currently while being in this window? */
bool mfMouseButtonDown;
# ifdef VBOX_WITH_DRAG_AND_DROP_GH
# endif /* VBOX_WITH_DRAG_AND_DROP_GH */
#else
/** @todo Implement me. */
#endif
/** The window's own HGCM client ID. */
/** The current operation mode. */
/** The current state. */
};
#endif /* __VBOXTRAYDND__H */