dndmanager.h revision 82391de567696f10b21a762fde6a06fe3c266d28
/** @file
* Drag and Drop manager.
*/
/*
* 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.
*/
typedef DECLCALLBACK(int) FNDNDPROGRESS(unsigned uPercentage, uint32_t uState, int rc, void *pvUser);
typedef FNDNDPROGRESS *PFNDNDPROGRESS;
/**
* DnD message class. This class forms the base of all other more specialized
* message classes.
*/
{
DnDMessage(void)
: m_pNextMsg(NULL)
{
}
virtual ~DnDMessage(void)
{
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(void)
{
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.
*/
{
virtual ~DnDHGSendDataMessage(void);
bool isMessageWaiting(void) const { return !!m_pNextPathMsg; }
/* Total message size (in bytes). */
/* Transferred message size (in bytes). */
void *m_pvProgressUser;
};
/**
* DnD message class for informing the guest to cancel any currently and
* pending activities.
*/
{
DnDHGCancelMessage(void)
{
0 /* cParms */, 0 /* aParms */);
}
};
/**
* DnD manager. Manage creation and queuing of messages for the various DnD
* messages types.
*/
{
: m_pCurMsg(0)
, m_fOpInProcess(false)
{}
virtual ~DnDManager(void)
{
clear();
}
void clear(void);
bool hasActiveOperation(void) const { return m_fOpInProcess; }
bool m_fOpInProcess;
/* Progress stuff */
void *m_pvProgressUser;
};
#endif /* ___VBox_HostService_DnD_dndmanager_h */