1 | /* $Id: DnDUtils.cpp 95821 2022-07-25 16:00:26Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * DnD - Common utility functions.
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2022 Oracle Corporation
|
---|
8 | *
|
---|
9 | * This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
10 | * available from http://www.virtualbox.org. This file is free software;
|
---|
11 | * you can redistribute it and/or modify it under the terms of the GNU
|
---|
12 | * General Public License (GPL) as published by the Free Software
|
---|
13 | * Foundation, in version 2 as it comes in the "COPYING" file of the
|
---|
14 | * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
|
---|
15 | * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
16 | */
|
---|
17 |
|
---|
18 |
|
---|
19 | /*********************************************************************************************************************************
|
---|
20 | * Header Files *
|
---|
21 | *********************************************************************************************************************************/
|
---|
22 | #define LOG_GROUP LOG_GROUP_GUEST_DND
|
---|
23 | #include <VBox/GuestHost/DragAndDrop.h>
|
---|
24 |
|
---|
25 | #include <iprt/assert.h>
|
---|
26 | #include <iprt/dir.h>
|
---|
27 | #include <iprt/err.h>
|
---|
28 | #include <iprt/file.h>
|
---|
29 | #include <iprt/mem.h>
|
---|
30 | #include <iprt/path.h>
|
---|
31 | #include <iprt/string.h>
|
---|
32 |
|
---|
33 | #include <VBox/log.h>
|
---|
34 |
|
---|
35 |
|
---|
36 | /**
|
---|
37 | * Converts a VBOXDNDACTION to a string.
|
---|
38 | *
|
---|
39 | * @returns Stringified version of VBOXDNDACTION
|
---|
40 | * @param uAction DnD action to convert.
|
---|
41 | */
|
---|
42 | const char *DnDActionToStr(VBOXDNDACTION uAction)
|
---|
43 | {
|
---|
44 | switch (uAction)
|
---|
45 | {
|
---|
46 | case VBOX_DND_ACTION_IGNORE: return "ignore";
|
---|
47 | case VBOX_DND_ACTION_COPY: return "copy";
|
---|
48 | case VBOX_DND_ACTION_MOVE: return "move";
|
---|
49 | case VBOX_DND_ACTION_LINK: return "link";
|
---|
50 | default:
|
---|
51 | break;
|
---|
52 | }
|
---|
53 | AssertMsgFailedReturn(("Unknown uAction=%d\n", uAction), "bad");
|
---|
54 | }
|
---|
55 |
|
---|