/* $Id$ */
/** @file
* Private guest drag and drop code, used by GuestDnDTarget +
* GuestDnDSource.
*/
/*
* Copyright (C) 2011-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 ____H_GUESTDNDPRIVATE
#define ____H_GUESTDNDPRIVATE
/* Forward prototype declarations. */
/**
* Class for handling drag'n drop responses from
* the guest side.
*/
{
virtual ~GuestDnDResponse(void);
int notifyAboutGuestResponse(void);
void reset(void);
/** The actual MIME data.*/
void *m_pvData;
/** Size (in bytes) of MIME data. */
/** Dropped files directory on the host. */
/** The handle of the currently opened file being written to
* or read from. */
};
/**
* Private singleton class for the guest's DnD
* implementation. Can't be instanciated directly, only via
* the factory pattern.
*/
{
{
return GuestDnD::s_pInstance;
}
static void destroyInstance(void)
{
if (GuestDnD::s_pInstance)
{
}
}
{
return GuestDnD::s_pInstance;
}
/** @name Public helper functions.
* @{ */
/** @} */
/** @name Static low-level HGCM callback handler.
* @{ */
static DECLCALLBACK(int) notifyDnDDispatcher(void *pvExtension, uint32_t u32Function, void *pvParms, uint32_t cbParms);
/** @} */
/** @name Static helper methods.
* @{ */
static com::Utf8Str toFormatString(const std::vector<com::Utf8Str> &lstSupportedFormats, const std::vector<com::Utf8Str> &lstFormats);
static void toFormatVector(const std::vector<com::Utf8Str> &lstSupportedFormats, const com::Utf8Str &strFormats, std::vector<com::Utf8Str> &vecformats);
static void toHGCMActions(DnDAction_T enmDefAction, uint32_t *puDefAction, const std::vector<DnDAction_T> vecAllowedActions, uint32_t *puAllowedActions);
/** @} */
/** @name Singleton properties.
* @{ */
/** List of supported default MIME/Content-type formats. */
/** Pointer to guest implementation. */
/** The current (last) response from the guest. At the
* moment we only support only response a time (ARQ-style). */
/** @} */
#ifdef VBOX_WITH_DRAG_AND_DROP_GH
/** @name Dispatch handlers for the HGCM callbacks.
* @{ */
int onGHSendFile(GuestDnDResponse *pResp, const char *pszPath, size_t cbPath, void *pvData, size_t cbData, uint32_t fMode);
/** @} */
#endif /* VBOX_WITH_DRAG_AND_DROP_GH */
/** Staic pointer to singleton instance. */
};
/** Access to the GuestDnD's singleton instance. */
/**
* IDnDBase class implementation for sharing code between
* IGuestDnDSource and IGuestDnDTarget implementation.
*/
{
GuestDnDBase(void);
/** Shared IDnDBase method implementations.
* @{ */
/** @} */
/** @name Attributes.
* @{ */
/** Pointer to guest implementation. */
/** List of supported MIME/Content-type formats. */
/** @} */
};
#endif /* ____H_GUESTDNDPRIVATE */