VirtualBox

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

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

Shared Clipboard/URI: Renaming (VBOX_SHARED_CLIPBOARD_HOST_MSG_FORMATS -> VBOX_SHARED_CLIPBOARD_HOST_MSG_REPORT_FORMATS).

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 3.9 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/**
36 * Supported data formats for Shared Clipboard. Bit mask.
37 */
38/** Shared Clipboard format is an Unicode text. */
39#define VBOX_SHARED_CLIPBOARD_FMT_UNICODETEXT UINT32_C(0x01)
40/** Shared Clipboard format is bitmap (BMP / DIB). */
41#define VBOX_SHARED_CLIPBOARD_FMT_BITMAP UINT32_C(0x02)
42/** Shared Clipboard format is HTML. */
43#define VBOX_SHARED_CLIPBOARD_FMT_HTML UINT32_C(0x04)
44#ifdef VBOX_WITH_SHARED_CLIPBOARD_URI_LIST
45/** Shared Clipboard format is an URI list. */
46#define VBOX_SHARED_CLIPBOARD_FMT_URI_LIST UINT32_C(0x08)
47#endif
48
49/**
50 * The host messages for the guest.
51 */
52#define VBOX_SHARED_CLIPBOARD_HOST_MSG_QUIT 1
53#define VBOX_SHARED_CLIPBOARD_HOST_MSG_READ_DATA 2
54#define VBOX_SHARED_CLIPBOARD_HOST_MSG_REPORT_FORMATS 3
55
56enum
57{
58 /** The number of milliseconds before the clipboard times out. */
59#ifndef TESTCASE
60 CLIPBOARD_TIMEOUT = 5000
61#else
62 CLIPBOARD_TIMEOUT = 1
63#endif
64};
65
66/** Opaque data structure for the X11/VBox frontend/glue code. */
67struct _VBOXCLIPBOARDCONTEXT;
68typedef struct _VBOXCLIPBOARDCONTEXT VBOXCLIPBOARDCONTEXT;
69typedef struct _VBOXCLIPBOARDCONTEXT *PVBOXCLIPBOARDCONTEXT;
70
71/** Opaque data structure for the X11/VBox backend code. */
72struct _CLIPBACKEND;
73typedef struct _CLIPBACKEND CLIPBACKEND;
74
75/** Opaque request structure for clipboard data.
76 * @todo All use of single and double underscore prefixes is banned! */
77struct _CLIPREADCBREQ;
78typedef struct _CLIPREADCBREQ CLIPREADCBREQ;
79
80/* APIs exported by the X11 backend */
81extern CLIPBACKEND *ClipConstructX11(VBOXCLIPBOARDCONTEXT *pFrontend, bool fHeadless);
82extern void ClipDestructX11(CLIPBACKEND *pBackend);
83#ifdef __cplusplus
84extern int ClipStartX11(CLIPBACKEND *pBackend, bool grab = false);
85#else
86extern int ClipStartX11(CLIPBACKEND *pBackend, bool grab);
87#endif
88extern int ClipStopX11(CLIPBACKEND *pBackend);
89extern void ClipAnnounceFormatToX11(CLIPBACKEND *pBackend,
90 uint32_t u32Formats);
91extern int ClipRequestDataFromX11(CLIPBACKEND *pBackend, uint32_t u32Format,
92 CLIPREADCBREQ *pReq);
93
94/* APIs exported by the X11/VBox frontend */
95extern int ClipRequestDataForX11(VBOXCLIPBOARDCONTEXT *pCtx,
96 uint32_t u32Format, void **ppv,
97 uint32_t *pcb);
98extern void ClipReportX11Formats(VBOXCLIPBOARDCONTEXT *pCtx,
99 uint32_t u32Formats);
100extern void ClipCompleteDataRequestFromX11(VBOXCLIPBOARDCONTEXT *pCtx, int rc,
101 CLIPREADCBREQ *pReq, void *pv,
102 uint32_t cb);
103#endif /* !VBOX_INCLUDED_GuestHost_SharedClipboard_h */
104
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