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