VirtualBox

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

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