1 | /** @file
|
---|
2 | * Shared Clipboard - Common header for host service and guest clients.
|
---|
3 | */
|
---|
4 |
|
---|
5 | /*
|
---|
6 | * Copyright (C) 2006-2019 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_INCLUDED_HostServices_VBoxClipboardSvc_h
|
---|
27 | #define VBOX_INCLUDED_HostServices_VBoxClipboardSvc_h
|
---|
28 | #ifndef RT_WITHOUT_PRAGMA_ONCE
|
---|
29 | # pragma once
|
---|
30 | #endif
|
---|
31 |
|
---|
32 | #include <VBox/VMMDevCoreTypes.h>
|
---|
33 | #include <VBox/VBoxGuestCoreTypes.h>
|
---|
34 | #include <VBox/hgcmsvc.h>
|
---|
35 |
|
---|
36 | /*
|
---|
37 | * The mode of operations.
|
---|
38 | */
|
---|
39 | #define VBOX_SHARED_CLIPBOARD_MODE_OFF 0
|
---|
40 | #define VBOX_SHARED_CLIPBOARD_MODE_HOST_TO_GUEST 1
|
---|
41 | #define VBOX_SHARED_CLIPBOARD_MODE_GUEST_TO_HOST 2
|
---|
42 | #define VBOX_SHARED_CLIPBOARD_MODE_BIDIRECTIONAL 3
|
---|
43 |
|
---|
44 | /*
|
---|
45 | * The service functions which are callable by host.
|
---|
46 | */
|
---|
47 | #define VBOX_SHARED_CLIPBOARD_HOST_FN_SET_MODE 1
|
---|
48 | /** Run headless on the host, i.e. do not touch the host clipboard. */
|
---|
49 | #define VBOX_SHARED_CLIPBOARD_HOST_FN_SET_HEADLESS 2
|
---|
50 |
|
---|
51 | /*
|
---|
52 | * The service functions which are called by guest.
|
---|
53 | */
|
---|
54 | /* Call host and wait blocking for an host event VBOX_SHARED_CLIPBOARD_HOST_MSG_* */
|
---|
55 | #define VBOX_SHARED_CLIPBOARD_FN_GET_HOST_MSG 1
|
---|
56 | /* Send list of available formats to host. */
|
---|
57 | #define VBOX_SHARED_CLIPBOARD_FN_FORMATS 2
|
---|
58 | /* Obtain data in specified format from host. */
|
---|
59 | #define VBOX_SHARED_CLIPBOARD_FN_READ_DATA 3
|
---|
60 | /* Send data in requested format to host. */
|
---|
61 | #define VBOX_SHARED_CLIPBOARD_FN_WRITE_DATA 4
|
---|
62 |
|
---|
63 | /*
|
---|
64 | * HGCM parameter structures.
|
---|
65 | */
|
---|
66 | #pragma pack(1)
|
---|
67 | typedef struct _VBoxClipboardGetHostMsg
|
---|
68 | {
|
---|
69 | VBGLIOCHGCMCALL hdr;
|
---|
70 |
|
---|
71 | /* VBOX_SHARED_CLIPBOARD_HOST_MSG_* */
|
---|
72 | HGCMFunctionParameter msg; /* OUT uint32_t */
|
---|
73 |
|
---|
74 | /* VBOX_SHARED_CLIPBOARD_FMT_*, depends on the 'msg'. */
|
---|
75 | HGCMFunctionParameter formats; /* OUT uint32_t */
|
---|
76 | } VBoxClipboardGetHostMsg;
|
---|
77 |
|
---|
78 | #define VBOX_SHARED_CLIPBOARD_CPARMS_GET_HOST_MSG 2
|
---|
79 |
|
---|
80 | typedef struct _VBoxClipboardFormats
|
---|
81 | {
|
---|
82 | VBGLIOCHGCMCALL hdr;
|
---|
83 |
|
---|
84 | /* VBOX_SHARED_CLIPBOARD_FMT_* */
|
---|
85 | HGCMFunctionParameter formats; /* OUT uint32_t */
|
---|
86 | } VBoxClipboardFormats;
|
---|
87 |
|
---|
88 | #define VBOX_SHARED_CLIPBOARD_CPARMS_FORMATS 1
|
---|
89 |
|
---|
90 | typedef struct _VBoxClipboardReadData
|
---|
91 | {
|
---|
92 | VBGLIOCHGCMCALL hdr;
|
---|
93 |
|
---|
94 | /* Requested format. */
|
---|
95 | HGCMFunctionParameter format; /* IN uint32_t */
|
---|
96 |
|
---|
97 | /* The data buffer. */
|
---|
98 | HGCMFunctionParameter ptr; /* IN linear pointer. */
|
---|
99 |
|
---|
100 | /* Size of returned data, if > ptr->cb, then no data was
|
---|
101 | * actually transferred and the guest must repeat the call.
|
---|
102 | */
|
---|
103 | HGCMFunctionParameter size; /* OUT uint32_t */
|
---|
104 |
|
---|
105 | } VBoxClipboardReadData;
|
---|
106 |
|
---|
107 | #define VBOX_SHARED_CLIPBOARD_CPARMS_READ_DATA 3
|
---|
108 |
|
---|
109 | typedef struct _VBoxClipboardWriteData
|
---|
110 | {
|
---|
111 | VBGLIOCHGCMCALL hdr;
|
---|
112 |
|
---|
113 | /* Returned format as requested in the VBOX_SHARED_CLIPBOARD_HOST_MSG_READ_DATA message. */
|
---|
114 | HGCMFunctionParameter format; /* IN uint32_t */
|
---|
115 |
|
---|
116 | /* Data. */
|
---|
117 | HGCMFunctionParameter ptr; /* IN linear pointer. */
|
---|
118 | } VBoxClipboardWriteData;
|
---|
119 |
|
---|
120 | #define VBOX_SHARED_CLIPBOARD_CPARMS_WRITE_DATA 2
|
---|
121 |
|
---|
122 | #pragma pack()
|
---|
123 |
|
---|
124 | bool VBoxSvcClipboardGetHeadless(void);
|
---|
125 |
|
---|
126 | #endif /* !VBOX_INCLUDED_HostServices_VBoxClipboardSvc_h */
|
---|