dndmanager.h revision d1a3b68e2ab222e4135826076ab26972869ee23d
/** @file
* Drag and Drop manager.
*/
/*
* Copyright (C) 2011-2012 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.
*/
typedef FNDNDPROGRESS *PFNDNDPROGRESS;
/**
* DnD message class. This class forms the base of all other more specialized
* message classes.
*/
{
: m_pNextMsg(NULL)
{
}
{
clearNextMsg();
}
{
return m_pNextMsg;
}
{
if (!m_pNextMsg)
return VERR_NO_DATA;
return VINF_SUCCESS;
}
{
if (!m_pNextMsg)
return VERR_NO_DATA;
clearNextMsg();
return rc;
}
virtual void clearNextMsg()
{
if (m_pNextMsg)
{
m_pNextMsg = NULL;
}
}
};
/**
* DnD message class for generic messages which didn't need any special
* handling.
*/
{
{
}
};
/**
* DnD message class for informing the guest about a new drop data event.
*/
{
DnDHGSendDataMessage(uint32_t uMsg, uint32_t cParms, VBOXHGCMSVCPARM paParms[], PFNDNDPROGRESS pfnProgressCallback, void *pvProgressUser);
bool isMessageWaiting() const { return !!m_pNextPathMsg; }
struct PathEntry
{
PathEntry(const RTCString &strHostPath, const RTCString &strGuestPath, uint32_t fMode, uint64_t cbSize)
};
/* Progress stuff */
void *m_pvProgressUser;
};
/**
* DnD message class for informing the guest to cancel any currently and
* pending activities.
*/
{
{
}
};
/**
* DnD manager. Manage creation and queuing of messages for the various DnD
* messages types.
*/
{
: m_pCurMsg(0)
, m_fOpInProcess(false)
{}
~DnDManager()
{
clear();
}
void clear();
bool hasActiveOperation() const { return m_fOpInProcess; }
bool m_fOpInProcess;
/* Progress stuff */
void *m_pvProgressUser;
};
#endif /* ___VBox_HostService_DnD_dndmanager_h */