GuestDnDSourceImpl.cpp revision 069b9101fbd3b049610c5511b1cc9534d01ea472
/* $Id$ */
/** @file
* VBox Console COM Class implementation - Guest drag'n drop source.
*/
/*
* Copyright (C) 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.
*/
/*******************************************************************************
* Header Files *
*******************************************************************************/
#include "GuestImpl.h"
#include "GuestDnDSourceImpl.h"
#include "GuestDnDPrivate.h"
#include "Global.h"
#include "AutoCaller.h"
#ifdef LOG_GROUP
#endif
#define LOG_GROUP LOG_GROUP_GUEST_DND
// constructor / destructor
/////////////////////////////////////////////////////////////////////////////
{
LogFlowThisFunc(("\n"));
return BaseFinalConstruct();
}
void GuestDnDSource::FinalRelease(void)
{
uninit();
}
// public initializer/uninitializer for internal purposes only
/////////////////////////////////////////////////////////////////////////////
{
/* Enclose the state transition NotReady->InInit->Ready. */
AutoInitSpan autoInitSpan(this);
/* Confirm a successful initialization when it's the case. */
return VINF_SUCCESS;
}
/**
* Uninitializes the instance.
* Called from FinalRelease().
*/
void GuestDnDSource::uninit(void)
{
LogFlowThisFunc(("\n"));
/* Enclose the state transition Ready->InUninit->NotReady. */
AutoUninitSpan autoUninitSpan(this);
if (autoUninitSpan.uninitDone())
return;
}
/////////////////////////////////////////////////////////////////////////////
{
#if !defined(VBOX_WITH_DRAG_AND_DROP) || !defined(VBOX_WITH_DRAG_AND_DROP_GH)
#else /* VBOX_WITH_DRAG_AND_DROP */
AutoCaller autoCaller(this);
/* Default is ignoring the action. */
int i = 0;
i, paParms);
if (RT_SUCCESS(rc))
{
bool fFetchResult = true;
if (pResp)
{
fFetchResult = false;
fFetchResult = false;
/* Fetch the default action to use. */
if (fFetchResult)
{
}
}
if (aDefaultAction)
}
if (RT_FAILURE(rc))
return hr;
#endif /* VBOX_WITH_DRAG_AND_DROP */
}
{
#if !defined(VBOX_WITH_DRAG_AND_DROP) || !defined(VBOX_WITH_DRAG_AND_DROP_GH)
#else /* VBOX_WITH_DRAG_AND_DROP */
/* Input validation. */
AutoCaller autoCaller(this);
/* If there is no usable action, ignore this request. */
if (isDnDIgnoreAction(uAction))
return S_OK;
LogFlowFunc(("strFormat=%s, uAction=0x%x, fNeedsDropDir=%RTbool\n",
if (pResp)
{
/* Reset any old data. */
/* Set the format we are going to retrieve to have it around
* when retrieving the data later. */
if (fNeedsDropDir)
{
char szDropDir[RTPATH_MAX];
if (RT_FAILURE(rc))
return setError(VBOX_E_IPRT_ERROR,
tr("Unable to create the temporary drag'n drop directory \"%s\" (%Rrc)\n"),
}
int i = 0;
i, paParms);
if (RT_SUCCESS(rc))
{
/* Query the progress object to the caller. */
}
else
}
return hr;
#endif /* VBOX_WITH_DRAG_AND_DROP */
}
{
#if !defined(VBOX_WITH_DRAG_AND_DROP) || !defined(VBOX_WITH_DRAG_AND_DROP_GH)
#else /* VBOX_WITH_DRAG_AND_DROP */
/* Input validation. */
AutoCaller autoCaller(this);
if (pResp)
{
if (cbData)
{
LogFlowFunc(("strFormat=%s, cbData=%zu, pvData=0x%p\n",
try
{
{
if (RT_SUCCESS(rc2))
{
LogFlowFunc(("Found %zu root URIs (%zu bytes)\n",
}
else
}
else
{
/* Copy the data into a safe array of bytes. */
}
}
{
hr = E_OUTOFMEMORY;
}
}
/* Delete the data. */
}
else
return hr;
#endif /* VBOX_WITH_DRAG_AND_DROP */
}