1 | /** @file
|
---|
2 | * Shared Clipboard - Common header for host service and guest clients.
|
---|
3 | */
|
---|
4 |
|
---|
5 | /*
|
---|
6 | * Copyright (C) 2006-2017 Oracle Corporation
|
---|
7 | *
|
---|
8 | * This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
9 | * available from http://www.virtualbox.org. This file is free software;
|
---|
10 | * you can redistribute it and/or modify it under the terms of the GNU
|
---|
11 | * General Public License (GPL) as published by the Free Software
|
---|
12 | * Foundation, in version 2 as it comes in the "COPYING" file of the
|
---|
13 | * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
|
---|
14 | * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
15 | *
|
---|
16 | * The contents of this file may alternatively be used under the terms
|
---|
17 | * of the Common Development and Distribution License Version 1.0
|
---|
18 | * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
|
---|
19 | * VirtualBox OSE distribution, in which case the provisions of the
|
---|
20 | * CDDL are applicable instead of those of the GPL.
|
---|
21 | *
|
---|
22 | * You may elect to license modified versions of this file under the
|
---|
23 | * terms and conditions of either the GPL or the CDDL or both.
|
---|
24 | */
|
---|
25 |
|
---|
26 | #ifndef ___VBox_HostService_VBoxClipboardSvc_h
|
---|
27 | #define ___VBox_HostService_VBoxClipboardSvc_h
|
---|
28 |
|
---|
29 | #include <VBox/VMMDevCoreTypes.h>
|
---|
30 | #include <VBox/VBoxGuestCoreTypes.h>
|
---|
31 | #include <VBox/hgcmsvc.h>
|
---|
32 |
|
---|
33 | /*
|
---|
34 | * The mode of operations.
|
---|
35 | */
|
---|
36 | #define VBOX_SHARED_CLIPBOARD_MODE_OFF 0
|
---|
37 | #define VBOX_SHARED_CLIPBOARD_MODE_HOST_TO_GUEST 1
|
---|
38 | #define VBOX_SHARED_CLIPBOARD_MODE_GUEST_TO_HOST 2
|
---|
39 | #define VBOX_SHARED_CLIPBOARD_MODE_BIDIRECTIONAL 3
|
---|
40 |
|
---|
41 | /*
|
---|
42 | * Supported data formats. Bit mask.
|
---|
43 | */
|
---|
44 | #define VBOX_SHARED_CLIPBOARD_FMT_UNICODETEXT UINT32_C(0x01)
|
---|
45 | #define VBOX_SHARED_CLIPBOARD_FMT_BITMAP UINT32_C(0x02)
|
---|
46 | #define VBOX_SHARED_CLIPBOARD_FMT_HTML UINT32_C(0x04)
|
---|
47 |
|
---|
48 | /*
|
---|
49 | * The service functions which are callable by host.
|
---|
50 | */
|
---|
51 | #define VBOX_SHARED_CLIPBOARD_HOST_FN_SET_MODE 1
|
---|
52 | /** Run headless on the host, i.e. do not touch the host clipboard. */
|
---|
53 | #define VBOX_SHARED_CLIPBOARD_HOST_FN_SET_HEADLESS 2
|
---|
54 |
|
---|
55 | /*
|
---|
56 | * The service functions which are called by guest.
|
---|
57 | */
|
---|
58 | /* Call host and wait blocking for an host event VBOX_SHARED_CLIPBOARD_HOST_MSG_* */
|
---|
59 | #define VBOX_SHARED_CLIPBOARD_FN_GET_HOST_MSG 1
|
---|
60 | /* Send list of available formats to host. */
|
---|
61 | #define VBOX_SHARED_CLIPBOARD_FN_FORMATS 2
|
---|
62 | /* Obtain data in specified format from host. */
|
---|
63 | #define VBOX_SHARED_CLIPBOARD_FN_READ_DATA 3
|
---|
64 | /* Send data in requested format to host. */
|
---|
65 | #define VBOX_SHARED_CLIPBOARD_FN_WRITE_DATA 4
|
---|
66 |
|
---|
67 | /*
|
---|
68 | * The host messages for the guest.
|
---|
69 | */
|
---|
70 | #define VBOX_SHARED_CLIPBOARD_HOST_MSG_QUIT 1
|
---|
71 | #define VBOX_SHARED_CLIPBOARD_HOST_MSG_READ_DATA 2
|
---|
72 | #define VBOX_SHARED_CLIPBOARD_HOST_MSG_FORMATS 3
|
---|
73 |
|
---|
74 | /*
|
---|
75 | * HGCM parameter structures.
|
---|
76 | */
|
---|
77 | #pragma pack(1)
|
---|
78 | typedef struct _VBoxClipboardGetHostMsg
|
---|
79 | {
|
---|
80 | VBGLIOCHGCMCALL hdr;
|
---|
81 |
|
---|
82 | /* VBOX_SHARED_CLIPBOARD_HOST_MSG_* */
|
---|
83 | HGCMFunctionParameter msg; /* OUT uint32_t */
|
---|
84 |
|
---|
85 | /* VBOX_SHARED_CLIPBOARD_FMT_*, depends on the 'msg'. */
|
---|
86 | HGCMFunctionParameter formats; /* OUT uint32_t */
|
---|
87 | } VBoxClipboardGetHostMsg;
|
---|
88 |
|
---|
89 | #define VBOX_SHARED_CLIPBOARD_CPARMS_GET_HOST_MSG 2
|
---|
90 |
|
---|
91 | typedef struct _VBoxClipboardFormats
|
---|
92 | {
|
---|
93 | VBGLIOCHGCMCALL hdr;
|
---|
94 |
|
---|
95 | /* VBOX_SHARED_CLIPBOARD_FMT_* */
|
---|
96 | HGCMFunctionParameter formats; /* OUT uint32_t */
|
---|
97 | } VBoxClipboardFormats;
|
---|
98 |
|
---|
99 | #define VBOX_SHARED_CLIPBOARD_CPARMS_FORMATS 1
|
---|
100 |
|
---|
101 | typedef struct _VBoxClipboardReadData
|
---|
102 | {
|
---|
103 | VBGLIOCHGCMCALL hdr;
|
---|
104 |
|
---|
105 | /* Requested format. */
|
---|
106 | HGCMFunctionParameter format; /* IN uint32_t */
|
---|
107 |
|
---|
108 | /* The data buffer. */
|
---|
109 | HGCMFunctionParameter ptr; /* IN linear pointer. */
|
---|
110 |
|
---|
111 | /* Size of returned data, if > ptr->cb, then no data was
|
---|
112 | * actually transferred and the guest must repeat the call.
|
---|
113 | */
|
---|
114 | HGCMFunctionParameter size; /* OUT uint32_t */
|
---|
115 |
|
---|
116 | } VBoxClipboardReadData;
|
---|
117 |
|
---|
118 | #define VBOX_SHARED_CLIPBOARD_CPARMS_READ_DATA 3
|
---|
119 |
|
---|
120 | typedef struct _VBoxClipboardWriteData
|
---|
121 | {
|
---|
122 | VBGLIOCHGCMCALL hdr;
|
---|
123 |
|
---|
124 | /* Returned format as requested in the VBOX_SHARED_CLIPBOARD_HOST_MSG_READ_DATA message. */
|
---|
125 | HGCMFunctionParameter format; /* IN uint32_t */
|
---|
126 |
|
---|
127 | /* Data. */
|
---|
128 | HGCMFunctionParameter ptr; /* IN linear pointer. */
|
---|
129 | } VBoxClipboardWriteData;
|
---|
130 |
|
---|
131 | #define VBOX_SHARED_CLIPBOARD_CPARMS_WRITE_DATA 2
|
---|
132 |
|
---|
133 | #pragma pack()
|
---|
134 |
|
---|
135 | #endif
|
---|