VirtualBox

source: vbox/trunk/include/VBox/GuestHost/SharedClipboard.h@ 78474

Last change on this file since 78474 was 78474, checked in by vboxsync, 6 years ago

Shared Clipboard/URI: Update.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 4.3 KB
Line 
1/** @file
2 * Shared Clipboard - Common Guest and Host Code.
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_GuestHost_SharedClipboard_h
27#define VBOX_INCLUDED_GuestHost_SharedClipboard_h
28#ifndef RT_WITHOUT_PRAGMA_ONCE
29# pragma once
30#endif
31
32#include <iprt/cdefs.h>
33#include <iprt/types.h>
34
35/** A single Shared Clipboard format. */
36typedef uint32_t VBOXCLIPBOARDFORMAT;
37/** Pointer to a single Shared Clipboard format. */
38typedef VBOXCLIPBOARDFORMAT *PVBOXCLIPBOARDFORMAT;
39
40/** Bit map of Shared Clipboard format. */
41typedef uint32_t VBOXCLIPBOARDFORMATS;
42/** Pointer to a bit map of Shared Clipboard format. */
43typedef VBOXCLIPBOARDFORMATS *PVBOXCLIPBOARDFORMATS;
44
45/**
46 * Supported data formats for Shared Clipboard. Bit mask.
47 */
48/** No format set. */
49#define VBOX_SHARED_CLIPBOARD_FMT_NONE 0
50/** Shared Clipboard format is an Unicode text. */
51#define VBOX_SHARED_CLIPBOARD_FMT_UNICODETEXT UINT32_C(0x01)
52/** Shared Clipboard format is bitmap (BMP / DIB). */
53#define VBOX_SHARED_CLIPBOARD_FMT_BITMAP UINT32_C(0x02)
54/** Shared Clipboard format is HTML. */
55#define VBOX_SHARED_CLIPBOARD_FMT_HTML UINT32_C(0x04)
56#ifdef VBOX_WITH_SHARED_CLIPBOARD_URI_LIST
57/** Shared Clipboard format is an URI list. */
58#define VBOX_SHARED_CLIPBOARD_FMT_URI_LIST UINT32_C(0x08)
59#endif
60
61/**
62 * The host messages for the guest.
63 */
64#define VBOX_SHARED_CLIPBOARD_HOST_MSG_QUIT 1
65#define VBOX_SHARED_CLIPBOARD_HOST_MSG_READ_DATA 2
66#define VBOX_SHARED_CLIPBOARD_HOST_MSG_REPORT_FORMATS 3
67
68enum
69{
70 /** The number of milliseconds before the clipboard times out. */
71#ifndef TESTCASE
72 CLIPBOARD_TIMEOUT = 5000
73#else
74 CLIPBOARD_TIMEOUT = 1
75#endif
76};
77
78/** Opaque data structure for the X11/VBox frontend/glue code. */
79struct _VBOXCLIPBOARDCONTEXT;
80typedef struct _VBOXCLIPBOARDCONTEXT VBOXCLIPBOARDCONTEXT;
81typedef struct _VBOXCLIPBOARDCONTEXT *PVBOXCLIPBOARDCONTEXT;
82
83/** Opaque data structure for the X11/VBox backend code. */
84struct _CLIPBACKEND;
85typedef struct _CLIPBACKEND CLIPBACKEND;
86
87/** Opaque request structure for clipboard data.
88 * @todo All use of single and double underscore prefixes is banned! */
89struct _CLIPREADCBREQ;
90typedef struct _CLIPREADCBREQ CLIPREADCBREQ;
91
92/* APIs exported by the X11 backend */
93extern CLIPBACKEND *ClipConstructX11(VBOXCLIPBOARDCONTEXT *pFrontend, bool fHeadless);
94extern void ClipDestructX11(CLIPBACKEND *pBackend);
95#ifdef __cplusplus
96extern int ClipStartX11(CLIPBACKEND *pBackend, bool grab = false);
97#else
98extern int ClipStartX11(CLIPBACKEND *pBackend, bool grab);
99#endif
100extern int ClipStopX11(CLIPBACKEND *pBackend);
101extern void ClipAnnounceFormatToX11(CLIPBACKEND *pBackend,
102 uint32_t u32Formats);
103extern int ClipRequestDataFromX11(CLIPBACKEND *pBackend, uint32_t u32Format,
104 CLIPREADCBREQ *pReq);
105
106/* APIs exported by the X11/VBox frontend */
107extern int ClipRequestDataForX11(VBOXCLIPBOARDCONTEXT *pCtx,
108 uint32_t u32Format, void **ppv,
109 uint32_t *pcb);
110extern void ClipReportX11Formats(VBOXCLIPBOARDCONTEXT *pCtx,
111 uint32_t u32Formats);
112extern void ClipCompleteDataRequestFromX11(VBOXCLIPBOARDCONTEXT *pCtx, int rc,
113 CLIPREADCBREQ *pReq, void *pv,
114 uint32_t cb);
115#endif /* !VBOX_INCLUDED_GuestHost_SharedClipboard_h */
116
Note: See TracBrowser for help on using the repository browser.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette