Index: trunk/include/VBox/GuestHost/DragAndDrop.h
===================================================================
--- trunk/include/VBox/GuestHost/DragAndDrop.h	(revision 74523)
+++ trunk/include/VBox/GuestHost/DragAndDrop.h	(revision 74526)
@@ -5,5 +5,5 @@
 
 /*
- * Copyright (C) 2014-2017 Oracle Corporation
+ * Copyright (C) 2014-2018 Oracle Corporation
  *
  * This file is part of VirtualBox Open Source Edition (OSE), as
@@ -38,4 +38,10 @@
 #include <iprt/cpp/ministring.h>
 
+/** DnDURIDroppedFiles flags. */
+typedef uint32_t DNDURIDROPPEDFILEFLAGS;
+
+/** No flags specified. */
+#define DNDURIDROPPEDFILE_FLAGS_NONE                   0
+
 /**
  * Class for maintaining a "dropped files" directory
@@ -52,5 +58,5 @@
 
     DnDDroppedFiles(void);
-    DnDDroppedFiles(const char *pszPath, uint32_t fFlags);
+    DnDDroppedFiles(const char *pszPath, DNDURIDROPPEDFILEFLAGS fFlags = DNDURIDROPPEDFILE_FLAGS_NONE);
     virtual ~DnDDroppedFiles(void);
 
@@ -61,6 +67,6 @@
     int Close(void);
     bool IsOpen(void) const;
-    int OpenEx(const char *pszPath, uint32_t fFlags);
-    int OpenTemp(uint32_t fFlags);
+    int OpenEx(const char *pszPath, DNDURIDROPPEDFILEFLAGS fFlags = DNDURIDROPPEDFILE_FLAGS_NONE);
+    int OpenTemp(DNDURIDROPPEDFILEFLAGS fFlags = DNDURIDROPPEDFILE_FLAGS_NONE);
     const char *GetDirAbs(void) const;
     int Reopen(void);
@@ -91,4 +97,107 @@
 int DnDPathSanitizeFilename(char *pszPath, size_t cbPath);
 int DnDPathSanitize(char *pszPath, size_t cbPath);
+
+/** DnDURIObject flags. */
+typedef uint32_t DNDURIOBJECTFLAGS;
+
+/** No flags specified. */
+#define DNDURIOBJECT_FLAGS_NONE                   0
+
+class DnDURIObject
+{
+public:
+
+    /**
+     * Enumeration for specifying an URI object type.
+     */
+    enum Type
+    {
+        /** Unknown type, do not use. */
+        Type_Unknown = 0,
+        /** Object is a file. */
+        Type_File,
+        /** Object is a directory. */
+        Type_Directory,
+        /** The usual 32-bit hack. */
+        Type_32Bit_Hack = 0x7fffffff
+    };
+
+    /**
+     * Enumeration for specifying an URI object view
+     * represent its data accordingly.
+     */
+    enum View
+    {
+        /** Unknown view, do not use. */
+        View_Unknown = 0,
+        /** Handle data from the source point of view. */
+        View_Source,
+        /** Handle data from the destination point of view. */
+        View_Target,
+        /** The usual 32-bit hack. */
+        View_Dest_32Bit_Hack = 0x7fffffff
+    };
+
+    DnDURIObject(void);
+    DnDURIObject(Type type,
+                 const RTCString &strSrcPath = "",
+                 const RTCString &strDstPath = "",
+                 uint32_t fMode = 0, uint64_t cbSize = 0);
+    virtual ~DnDURIObject(void);
+
+public:
+
+    const RTCString &GetSourcePath(void) const { return m_strSrcPath; }
+    const RTCString &GetDestPath(void) const { return m_strTgtPath; }
+    uint32_t GetMode(void) const { return m_fMode; }
+    uint64_t GetProcessed(void) const { return m_cbProcessed; }
+    uint64_t GetSize(void) const { return m_cbSize; }
+    Type GetType(void) const { return m_Type; }
+
+public:
+
+    int SetSize(uint64_t uSize) { m_cbSize = uSize; return VINF_SUCCESS; }
+
+public:
+
+    void Close(void);
+    bool IsComplete(void) const;
+    bool IsOpen(void) const;
+    int Open(View enmView, uint64_t fOpen, uint32_t fMode = 0);
+    int OpenEx(const RTCString &strPath, Type enmType, View enmView, uint64_t fOpen = 0, uint32_t fMode = 0, DNDURIOBJECTFLAGS = DNDURIOBJECT_FLAGS_NONE);
+    int Read(void *pvBuf, size_t cbBuf, uint32_t *pcbRead);
+    void Reset(void);
+    int Write(const void *pvBuf, size_t cbBuf, uint32_t *pcbWritten);
+
+public:
+
+    static int RebaseURIPath(RTCString &strPath, const RTCString &strBaseOld = "", const RTCString &strBaseNew = "");
+
+protected:
+
+    void closeInternal(void);
+
+protected:
+
+    Type      m_Type;
+    RTCString m_strSrcPath;
+    RTCString m_strTgtPath;
+    /** Whether the object is in "opened" state. */
+    bool      m_fOpen;
+    /** Object (file/directory) mode. */
+    uint32_t  m_fMode;
+    /** Size (in bytes) to read/write. */
+    uint64_t  m_cbSize;
+    /** Bytes processed reading/writing. */
+    uint64_t  m_cbProcessed;
+
+    union
+    {
+        RTFILE m_hFile;
+    } u;
+};
+
+/** DnDURIList flags. */
+typedef uint32_t DNDURILISTFLAGS;
 
 /** No flags specified. */
@@ -105,82 +214,4 @@
 #define DNDURILIST_FLAGS_LAZY                   RT_BIT(3)
 
-class DnDURIObject
-{
-public:
-
-    enum Type
-    {
-        Unknown = 0,
-        File,
-        Directory,
-        Type_32Bit_Hack = 0x7fffffff
-    };
-
-    enum Dest
-    {
-        Source = 0,
-        Target,
-        Dest_32Bit_Hack = 0x7fffffff
-    };
-
-    DnDURIObject(void);
-    DnDURIObject(Type type,
-                 const RTCString &strSrcPath = "",
-                 const RTCString &strDstPath = "",
-                 uint32_t fMode = 0, uint64_t cbSize = 0);
-    virtual ~DnDURIObject(void);
-
-public:
-
-    const RTCString &GetSourcePath(void) const { return m_strSrcPath; }
-    const RTCString &GetDestPath(void) const { return m_strTgtPath; }
-    uint32_t GetMode(void) const { return m_fMode; }
-    uint64_t GetProcessed(void) const { return m_cbProcessed; }
-    uint64_t GetSize(void) const { return m_cbSize; }
-    Type GetType(void) const { return m_Type; }
-
-public:
-
-    int SetSize(uint64_t uSize) { m_cbSize = uSize; return VINF_SUCCESS; }
-
-public:
-
-    void Close(void);
-    bool IsComplete(void) const;
-    bool IsOpen(void) const;
-    int Open(Dest enmDest, uint64_t fOpen, uint32_t fMode = 0);
-    int OpenEx(const RTCString &strPath, Type enmType, Dest enmDest, uint64_t fOpen = 0, uint32_t fMode = 0, uint32_t fFlags = 0);
-    int Read(void *pvBuf, size_t cbBuf, uint32_t *pcbRead);
-    void Reset(void);
-    int Write(const void *pvBuf, size_t cbBuf, uint32_t *pcbWritten);
-
-public:
-
-    static int RebaseURIPath(RTCString &strPath, const RTCString &strBaseOld = "", const RTCString &strBaseNew = "");
-
-protected:
-
-    void closeInternal(void);
-
-protected:
-
-    Type      m_Type;
-    RTCString m_strSrcPath;
-    RTCString m_strTgtPath;
-    /** Whether the object is in "opened" state. */
-    bool      m_fOpen;
-    /** Object (file/directory) mode. */
-    uint32_t  m_fMode;
-    /** Size (in bytes) to read/write. */
-    uint64_t  m_cbSize;
-    /** Bytes processed reading/writing. */
-    uint64_t  m_cbProcessed;
-
-    union
-    {
-        RTFILE m_hFile;
-    } u;
-};
-
 class DnDURIList
 {
@@ -192,10 +223,10 @@
 public:
 
-    int AppendNativePath(const char *pszPath, uint32_t fFlags);
-    int AppendNativePathsFromList(const char *pszNativePaths, size_t cbNativePaths, uint32_t fFlags);
-    int AppendNativePathsFromList(const RTCList<RTCString> &lstNativePaths, uint32_t fFlags);
-    int AppendURIPath(const char *pszURI, uint32_t fFlags);
-    int AppendURIPathsFromList(const char *pszURIPaths, size_t cbURIPaths, uint32_t fFlags);
-    int AppendURIPathsFromList(const RTCList<RTCString> &lstURI, uint32_t fFlags);
+    int AppendNativePath(const char *pszPath, DNDURILISTFLAGS fFlags);
+    int AppendNativePathsFromList(const char *pszNativePaths, size_t cbNativePaths, DNDURILISTFLAGS fFlags);
+    int AppendNativePathsFromList(const RTCList<RTCString> &lstNativePaths, DNDURILISTFLAGS fFlags);
+    int AppendURIPath(const char *pszURI, DNDURILISTFLAGS fFlags);
+    int AppendURIPathsFromList(const char *pszURIPaths, size_t cbURIPaths, DNDURILISTFLAGS fFlags);
+    int AppendURIPathsFromList(const RTCList<RTCString> &lstURI, DNDURILISTFLAGS fFlags);
 
     void Clear(void);
@@ -203,14 +234,15 @@
     bool IsEmpty(void) const { return m_lstTree.isEmpty(); }
     void RemoveFirst(void);
-    int RootFromURIData(const void *pvData, size_t cbData, uint32_t fFlags);
-    RTCString RootToString(const RTCString &strPathBase = "", const RTCString &strSeparator = "\r\n") const;
-    uint64_t RootCount(void) const { return m_lstRoot.size(); }
-    uint64_t TotalCount(void) const { return m_cTotal; }
-    uint64_t TotalBytes(void) const { return m_cbTotal; }
-
-protected:
-
-    int addEntry(const char *pcszSource, const char *pcszTarget, uint32_t fFlags);
-    int appendPathRecursive(const char *pcszSrcPath, const char *pcszDstPath, const char *pcszDstBase, size_t cchDstBase, uint32_t fFlags);
+    int SetFromURIData(const void *pvData, size_t cbData, DNDURILISTFLAGS fFlags);
+
+    RTCString GetRootEntries(const RTCString &strPathBase = "", const RTCString &strSeparator = "\r\n") const;
+    uint64_t GetRootCount(void) const { return m_lstRoot.size(); }
+    uint64_t GetTotalCount(void) const { return m_cTotal; }
+    uint64_t GetTotalBytes(void) const { return m_cbTotal; }
+
+protected:
+
+    int addEntry(const char *pcszSource, const char *pcszTarget, DNDURILISTFLAGS fFlags);
+    int appendPathRecursive(const char *pcszSrcPath, const char *pcszDstPath, const char *pcszDstBase, size_t cchDstBase, DNDURILISTFLAGS fFlags);
 
 protected:
