VirtualBox

Ignore:
Timestamp:
Aug 11, 2020 9:36:37 AM (4 years ago)
Author:
vboxsync
Message:

DnD: Lots of documentation.

Location:
trunk/src/VBox/Frontends/VirtualBox/src/runtime
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIDnDDataObject_win.cpp

    r85455 r85681  
    188188}
    189189
    190 /**
    191  * Retrieves the data stored in this object and store the result in
    192  * pMedium.
    193  *
    194  * @return  IPRT status code.
    195  * @return  HRESULT
    196  * @param   pFormatEtc
    197  * @param   pMedium
    198  */
    199190STDMETHODIMP UIDnDDataObject::GetData(LPFORMATETC pFormatEtc, LPSTGMEDIUM pMedium)
    200191{
     
    512503}
    513504
    514 /**
    515  * Only required for IStream / IStorage interfaces.
    516  *
    517  * @return  IPRT status code.
    518  * @return  HRESULT
    519  * @param   pFormatEtc
    520  * @param   pMedium
    521  */
    522505STDMETHODIMP UIDnDDataObject::GetDataHere(LPFORMATETC pFormatEtc, LPSTGMEDIUM pMedium)
    523506{
     
    527510}
    528511
    529 /**
    530  * Query if this objects supports a specific format.
    531  *
    532  * @return  IPRT status code.
    533  * @return  HRESULT
    534  * @param   pFormatEtc
    535  */
    536512STDMETHODIMP UIDnDDataObject::QueryGetData(LPFORMATETC pFormatEtc)
    537513{
     
    594570 */
    595571
     572/**
     573 * Aborts waiting for data being "dropped".
     574 *
     575 * @returns VBox status code.
     576 */
    596577int UIDnDDataObject::Abort(void)
    597578{
     
    601582}
    602583
     584/**
     585 * Static helper function to convert a CLIPFORMAT to a string and return it.
     586 *
     587 * @returns Pointer to converted stringified CLIPFORMAT, or "unknown" if not found / invalid.
     588 * @param   fmt                 CLIPFORMAT to return string for.
     589 */
    603590/* static */
    604591const char* UIDnDDataObject::ClipboardFormatToString(CLIPFORMAT fmt)
     
    682669}
    683670
     671/**
     672 * Checks whether a given FORMATETC is supported by this data object and returns its index.
     673 *
     674 * @returns \c true if format is supported, \c false if not.
     675 * @param   pFormatEtc          Pointer to FORMATETC to check for.
     676 * @param   puIndex             Where to store the index if format is supported.
     677 */
    684678bool UIDnDDataObject::LookupFormatEtc(LPFORMATETC pFormatEtc, ULONG *puIndex)
    685679{
     
    712706}
    713707
     708/**
     709 * Registers a new format with this data object.
     710 *
     711 * @param   pFormatEtc          Where to store the new format into.
     712 * @param   clipFormat          Clipboard format to register.
     713 * @param   tyMed               Format medium type to register.
     714 * @param   lIndex              Format index to register.
     715 * @param   dwAspect            Format aspect to register.
     716 * @param   pTargetDevice       Format target device to register.
     717 */
    714718void UIDnDDataObject::RegisterFormat(LPFORMATETC pFormatEtc, CLIPFORMAT clipFormat,
    715719                                     TYMED tyMed, LONG lIndex, DWORD dwAspect,
     
    728732}
    729733
     734/**
     735 * Sets the current status of this data object.
     736 *
     737 * @param   enmStatus           New status to set.
     738 */
    730739void UIDnDDataObject::SetStatus(DnDDataObjectStatus enmStatus)
    731740{
     
    734743}
    735744
     745/**
     746 * Signals that data has been "dropped".
     747 *
     748 ** @todo r=andy Remove?
     749 */
    736750void UIDnDDataObject::Signal(void)
    737751{
     
    739753}
    740754
     755/**
     756 * Signals that data has been "dropped".
     757 *
     758 * @returns VBox status code.
     759 * @param   strFormat           Format of data (MIME string).
     760 * @param   pvData              Pointer to data.
     761 * @param   cbData              Size (in bytes) of data.
     762 */
    741763int UIDnDDataObject::Signal(const QString &strFormat,
    742764                            const void *pvData, uint32_t cbData)
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIDnDDataObject_win.h

    r82968 r85681  
    9595    /** Internal reference count of this object. */
    9696    LONG                    m_cRefs;
    97     /** Number of native formats registered. This can be a different number than supplied with mlstFormats. */
     97    /** Number of native formats registered. This can be a different number than supplied with m_lstFormats. */
    9898    ULONG                   m_cFormats;
     99    /** Array of registered FORMATETC structs. Matches m_cFormats. */
    99100    FORMATETC              *m_pFormatEtc;
     101    /** Array of registered STGMEDIUM structs. Matches m_cFormats. */
    100102    STGMEDIUM              *m_pStgMedium;
     103    /** Event semaphore used for waiting on status changes. */
    101104    RTSEMEVENT              m_SemEvent;
     105    /** List of supported formats. */
    102106    QStringList             m_lstFormats;
     107    /** Format of currently retrieved data. */
    103108    QString                 m_strFormat;
    104109    /** The retrieved data as a QVariant. Needed for buffering in case a second format needs the same data,
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIDnDDropSource_win.h

    r82968 r85681  
    5656    /** Pointer to parent widget. */
    5757    QWidget         *m_pParent;
     58    /** Pointer to current data object. */
    5859    UIDnDDataObject *m_pDataObject;
    5960    /** The current reference count. */
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIDnDHandler.cpp

    r85475 r85681  
    601601                                     QVector<uint8_t> &vecData)
    602602{
     603    /** @todo r=andy Locking required? */
     604
    603605    if (!strMIMEType.compare("application/x-qt-mime-type-name", Qt::CaseInsensitive))
    604606        return VINF_SUCCESS;
     
    713715}
    714716
     717/**
     718 * Sets the current DnD operation mode.
     719 *
     720 * Note: Only one mode (guest->host *or* host->guest) can be active at the same time.
     721 *
     722 * @param   enmMode             Current operation mode to set.
     723 */
    715724void UIDnDHandler::setOpMode(DNDOPMODE enmMode)
    716725{
    717726    QMutexLocker AutoWriteLock(&m_WriteLock);
     727
     728    /** @todo r=andy Check for old (current) mode and refuse new mode? */
     729
    718730    m_enmOpMode = enmMode;
    719731    LogFunc(("Operation mode is now: %RU32\n", m_enmOpMode));
     
    734746 */
    735747
     748/**
     749 * Static helper function to convert a Qt drop action to an internal DnD drop action.
     750 *
     751 * @returns Converted internal drop action.
     752 * @param   action              Qt drop action to convert.
     753 */
    736754/* static */
    737755KDnDAction UIDnDHandler::toVBoxDnDAction(Qt::DropAction action)
     
    747765}
    748766
     767/**
     768 * Static helper function to convert Qt drop actions to internal DnD drop actions.
     769 *
     770 * @returns Vector of converted internal drop actions.
     771 * @param   actions             Qt drop actions to convert.
     772 */
    749773/* static */
    750774QVector<KDnDAction> UIDnDHandler::toVBoxDnDActions(Qt::DropActions actions)
     
    763787}
    764788
     789/**
     790 * Static helper function to convert an internal drop action to a Qt drop action.
     791 *
     792 * @returns Converted Qt drop action.
     793 * @param   actions             Internal drop action to convert.
     794 */
    765795/* static */
    766796Qt::DropAction UIDnDHandler::toQtDnDAction(KDnDAction action)
     
    778808}
    779809
     810/**
     811 * Static helper function to convert a vector of internal drop actions to Qt drop actions.
     812 *
     813 * @returns Converted Qt drop actions.
     814 * @param   vecActions          Internal drop actions to convert.
     815 */
    780816/* static */
    781817Qt::DropActions UIDnDHandler::toQtDnDActions(const QVector<KDnDAction> &vecActions)
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIDnDHandler.h

    r82968 r85681  
    3838class UISession;
    3939
     40/**
     41 * Main class for implementing Drag'n'Drop in the frontend.
     42 */
    4043class UIDnDHandler: public QObject
    4144{
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette