Changeset 74575 in vbox for trunk/include/VBox
- Timestamp:
- Oct 2, 2018 9:40:00 AM (6 years ago)
- svn:sync-xref-src-repo-rev:
- 125445
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/GuestHost/DragAndDrop.h
r74526 r74575 104 104 #define DNDURIOBJECT_FLAGS_NONE 0 105 105 106 /** Mask of all valid DnD URI object flags. */ 107 #define DNDURIOBJECT_FLAGS_VALID_MASK UINT32_C(0x0) 108 109 /** 110 * Class for handling DnD URI objects. 111 * This class abstracts the access and handling objects when performing DnD actions. 112 */ 106 113 class DnDURIObject 107 114 { … … 125 132 /** 126 133 * Enumeration for specifying an URI object view 127 * representits data accordingly.134 * for representing its data accordingly. 128 135 */ 129 136 enum View … … 141 148 DnDURIObject(void); 142 149 DnDURIObject(Type type, 143 const RTCString &strSrcPath = "",144 const RTCString &strDstPath = "",150 const RTCString &strSrcPathAbs = "", 151 const RTCString &strDstPathAbs = "", 145 152 uint32_t fMode = 0, uint64_t cbSize = 0); 146 153 virtual ~DnDURIObject(void); … … 148 155 public: 149 156 150 const RTCString &GetSourcePath(void) const { return m_strSrcPath; } 151 const RTCString &GetDestPath(void) const { return m_strTgtPath; } 152 uint32_t GetMode(void) const { return m_fMode; } 153 uint64_t GetProcessed(void) const { return m_cbProcessed; } 154 uint64_t GetSize(void) const { return m_cbSize; } 157 /** 158 * Returns the given absolute source path of the object. 159 * 160 * @return Absolute source path of the object. 161 */ 162 const RTCString &GetSourcePathAbs(void) const { return m_strSrcPathAbs; } 163 164 /** 165 * Returns the given, absolute destination path of the object. 166 * 167 * @return Absolute destination path of the object. 168 */ 169 const RTCString &GetDestPathAbs(void) const { return m_strTgtPathAbs; } 170 171 /** 172 * Returns the file mode of the object. 173 * 174 * Note: Only applies if the object is of type DnDURIObject::Type_File. 175 * 176 * @return File mode. 177 */ 178 uint32_t GetMode(void) const { AssertReturn(m_Type == Type_File, 0); return u.File.fMode; } 179 180 /** 181 * Returns the bytes already processed (read / written). 182 * 183 * Note: Only applies if the object is of type DnDURIObject::Type_File. 184 * 185 * @return Bytes already processed (read / written). 186 */ 187 uint64_t GetProcessed(void) const { AssertReturn(m_Type == Type_File, 0); return u.File.cbProcessed; } 188 189 /** 190 * Returns the file's size (in bytes). 191 * 192 * Note: Only applies if the object is of type DnDURIObject::Type_File. 193 * 194 * @return The file's size (in bytes). 195 */ 196 uint64_t GetSize(void) const { AssertReturn(m_Type == Type_File, 0); return u.File.cbSize; } 197 198 /** 199 * Returns the object's type. 200 * 201 * @return The object's type. 202 */ 155 203 Type GetType(void) const { return m_Type; } 156 204 157 205 public: 158 206 159 int SetSize(uint64_t uSize) { m_cbSize = uSize; return VINF_SUCCESS; } 207 /** 208 * Sets the bytes to process by the object. 209 * 210 * Note: Only applies if the object is of type DnDURIObject::Type_File. 211 * 212 * @return IPRT return code. 213 * @param uSize Size (in bytes) to process. 214 */ 215 int SetSize(uint64_t cbSize) { AssertReturn(m_Type == Type_File, 0); u.File.cbSize = cbSize; return VINF_SUCCESS; } 160 216 161 217 public: … … 180 236 protected: 181 237 238 /** The object's type. */ 182 239 Type m_Type; 183 RTCString m_strSrcPath; 184 RTCString m_strTgtPath; 240 /** Absolute path (base) for the source. */ 241 RTCString m_strSrcPathAbs; 242 /** Absolute path (base) for the target. */ 243 RTCString m_strTgtPathAbs; 185 244 /** Whether the object is in "opened" state. */ 186 bool m_fOpen; 187 /** Object (file/directory) mode. */ 188 uint32_t m_fMode; 189 /** Size (in bytes) to read/write. */ 190 uint64_t m_cbSize; 191 /** Bytes processed reading/writing. */ 192 uint64_t m_cbProcessed; 193 245 bool m_fIsOpen; 246 247 /** Union containing data depending on the object's type. */ 194 248 union 195 249 { 196 RTFILE m_hFile; 250 /** Structure containing members for objects that 251 * are files. */ 252 struct 253 { 254 /** File handle. */ 255 RTFILE hFile; 256 /** Used file mode. */ 257 uint32_t fMode; 258 /** Size (in bytes) to read/write. */ 259 uint64_t cbSize; 260 /** Bytes processed reading/writing. */ 261 uint64_t cbProcessed; 262 } File; 197 263 } u; 198 264 };
Note:
See TracChangeset
for help on using the changeset viewer.