cliprdr.h (7275B)
1/** 2 * FreeRDP: A Remote Desktop Protocol Implementation 3 * Clipboard Virtual Channel Extension 4 * 5 * Copyright 2011 Vic Lee 6 * Copyright 2015 Thincast Technologies GmbH 7 * Copyright 2015 DI (FH) Martin Haimberger <martin.haimberger@thincast.com> 8 * 9 * Licensed under the Apache License, Version 2.0 (the "License"); 10 * you may not use this file except in compliance with the License. 11 * You may obtain a copy of the License at 12 * 13 * http://www.apache.org/licenses/LICENSE-2.0 14 * 15 * Unless required by applicable law or agreed to in writing, software 16 * distributed under the License is distributed on an "AS IS" BASIS, 17 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 * See the License for the specific language governing permissions and 19 * limitations under the License. 20 */ 21 22#ifndef FREERDP_CHANNEL_CLIPRDR_CLIENT_CLIPRDR_H 23#define FREERDP_CHANNEL_CLIPRDR_CLIENT_CLIPRDR_H 24 25#include <freerdp/types.h> 26 27#include <freerdp/message.h> 28#include <freerdp/channels/cliprdr.h> 29#include <freerdp/freerdp.h> 30 31/** 32 * Client Interface 33 */ 34 35typedef struct _cliprdr_client_context CliprdrClientContext; 36 37typedef UINT (*pcCliprdrServerCapabilities)(CliprdrClientContext* context, 38 const CLIPRDR_CAPABILITIES* capabilities); 39typedef UINT (*pcCliprdrClientCapabilities)(CliprdrClientContext* context, 40 const CLIPRDR_CAPABILITIES* capabilities); 41typedef UINT (*pcCliprdrMonitorReady)(CliprdrClientContext* context, 42 const CLIPRDR_MONITOR_READY* monitorReady); 43typedef UINT (*pcCliprdrTempDirectory)(CliprdrClientContext* context, 44 const CLIPRDR_TEMP_DIRECTORY* tempDirectory); 45typedef UINT (*pcCliprdrClientFormatList)(CliprdrClientContext* context, 46 const CLIPRDR_FORMAT_LIST* formatList); 47typedef UINT (*pcCliprdrServerFormatList)(CliprdrClientContext* context, 48 const CLIPRDR_FORMAT_LIST* formatList); 49typedef UINT (*pcCliprdrClientFormatListResponse)( 50 CliprdrClientContext* context, const CLIPRDR_FORMAT_LIST_RESPONSE* formatListResponse); 51typedef UINT (*pcCliprdrServerFormatListResponse)( 52 CliprdrClientContext* context, const CLIPRDR_FORMAT_LIST_RESPONSE* formatListResponse); 53typedef UINT (*pcCliprdrClientLockClipboardData)( 54 CliprdrClientContext* context, const CLIPRDR_LOCK_CLIPBOARD_DATA* lockClipboardData); 55typedef UINT (*pcCliprdrServerLockClipboardData)( 56 CliprdrClientContext* context, const CLIPRDR_LOCK_CLIPBOARD_DATA* lockClipboardData); 57typedef UINT (*pcCliprdrClientUnlockClipboardData)( 58 CliprdrClientContext* context, const CLIPRDR_UNLOCK_CLIPBOARD_DATA* unlockClipboardData); 59typedef UINT (*pcCliprdrServerUnlockClipboardData)( 60 CliprdrClientContext* context, const CLIPRDR_UNLOCK_CLIPBOARD_DATA* unlockClipboardData); 61typedef UINT (*pcCliprdrClientFormatDataRequest)( 62 CliprdrClientContext* context, const CLIPRDR_FORMAT_DATA_REQUEST* formatDataRequest); 63typedef UINT (*pcCliprdrServerFormatDataRequest)( 64 CliprdrClientContext* context, const CLIPRDR_FORMAT_DATA_REQUEST* formatDataRequest); 65typedef UINT (*pcCliprdrClientFormatDataResponse)( 66 CliprdrClientContext* context, const CLIPRDR_FORMAT_DATA_RESPONSE* formatDataResponse); 67typedef UINT (*pcCliprdrServerFormatDataResponse)( 68 CliprdrClientContext* context, const CLIPRDR_FORMAT_DATA_RESPONSE* formatDataResponse); 69typedef UINT (*pcCliprdrClientFileContentsRequest)( 70 CliprdrClientContext* context, const CLIPRDR_FILE_CONTENTS_REQUEST* fileContentsRequest); 71typedef UINT (*pcCliprdrServerFileContentsRequest)( 72 CliprdrClientContext* context, const CLIPRDR_FILE_CONTENTS_REQUEST* fileContentsRequest); 73typedef UINT (*pcCliprdrClientFileContentsResponse)( 74 CliprdrClientContext* context, const CLIPRDR_FILE_CONTENTS_RESPONSE* fileContentsResponse); 75typedef UINT (*pcCliprdrServerFileContentsResponse)( 76 CliprdrClientContext* context, const CLIPRDR_FILE_CONTENTS_RESPONSE* fileContentsResponse); 77 78struct _cliprdr_client_context 79{ 80 void* handle; 81 void* custom; 82 83 pcCliprdrServerCapabilities ServerCapabilities; 84 pcCliprdrClientCapabilities ClientCapabilities; 85 pcCliprdrMonitorReady MonitorReady; 86 pcCliprdrTempDirectory TempDirectory; 87 pcCliprdrClientFormatList ClientFormatList; 88 pcCliprdrServerFormatList ServerFormatList; 89 pcCliprdrClientFormatListResponse ClientFormatListResponse; 90 pcCliprdrServerFormatListResponse ServerFormatListResponse; 91 pcCliprdrClientLockClipboardData ClientLockClipboardData; 92 pcCliprdrServerLockClipboardData ServerLockClipboardData; 93 pcCliprdrClientUnlockClipboardData ClientUnlockClipboardData; 94 pcCliprdrServerUnlockClipboardData ServerUnlockClipboardData; 95 pcCliprdrClientFormatDataRequest ClientFormatDataRequest; 96 pcCliprdrServerFormatDataRequest ServerFormatDataRequest; 97 pcCliprdrClientFormatDataResponse ClientFormatDataResponse; 98 pcCliprdrServerFormatDataResponse ServerFormatDataResponse; 99 pcCliprdrClientFileContentsRequest ClientFileContentsRequest; 100 pcCliprdrServerFileContentsRequest ServerFileContentsRequest; 101 pcCliprdrClientFileContentsResponse ClientFileContentsResponse; 102 pcCliprdrServerFileContentsResponse ServerFileContentsResponse; 103 104 UINT32 lastRequestedFormatId; 105 rdpContext* rdpcontext; 106}; 107 108struct _CLIPRDR_FORMAT_NAME 109{ 110 UINT32 id; 111 char* name; 112 int length; 113}; 114typedef struct _CLIPRDR_FORMAT_NAME CLIPRDR_FORMAT_NAME; 115 116/** 117 * Clipboard Events 118 */ 119 120struct _RDP_CB_CLIP_CAPS 121{ 122 wMessage event; 123 UINT32 capabilities; 124}; 125typedef struct _RDP_CB_CLIP_CAPS RDP_CB_CLIP_CAPS; 126 127struct _RDP_CB_MONITOR_READY_EVENT 128{ 129 wMessage event; 130 UINT32 capabilities; 131}; 132typedef struct _RDP_CB_MONITOR_READY_EVENT RDP_CB_MONITOR_READY_EVENT; 133 134struct _RDP_CB_FORMAT_LIST_EVENT 135{ 136 wMessage event; 137 UINT32* formats; 138 UINT16 num_formats; 139 BYTE* raw_format_data; 140 UINT32 raw_format_data_size; 141 BOOL raw_format_unicode; 142}; 143typedef struct _RDP_CB_FORMAT_LIST_EVENT RDP_CB_FORMAT_LIST_EVENT; 144 145struct _RDP_CB_DATA_REQUEST_EVENT 146{ 147 wMessage event; 148 UINT32 format; 149}; 150typedef struct _RDP_CB_DATA_REQUEST_EVENT RDP_CB_DATA_REQUEST_EVENT; 151 152struct _RDP_CB_DATA_RESPONSE_EVENT 153{ 154 wMessage event; 155 BYTE* data; 156 UINT32 size; 157}; 158typedef struct _RDP_CB_DATA_RESPONSE_EVENT RDP_CB_DATA_RESPONSE_EVENT; 159 160struct _RDP_CB_FILECONTENTS_REQUEST_EVENT 161{ 162 wMessage event; 163 UINT32 streamId; 164 UINT32 lindex; 165 UINT32 dwFlags; 166 UINT32 nPositionLow; 167 UINT32 nPositionHigh; 168 UINT32 cbRequested; 169 UINT32 clipDataId; 170}; 171typedef struct _RDP_CB_FILECONTENTS_REQUEST_EVENT RDP_CB_FILECONTENTS_REQUEST_EVENT; 172 173struct _RDP_CB_FILECONTENTS_RESPONSE_EVENT 174{ 175 wMessage event; 176 BYTE* data; 177 UINT32 size; 178 UINT32 streamId; 179}; 180typedef struct _RDP_CB_FILECONTENTS_RESPONSE_EVENT RDP_CB_FILECONTENTS_RESPONSE_EVENT; 181 182struct _RDP_CB_LOCK_CLIPDATA_EVENT 183{ 184 wMessage event; 185 UINT32 clipDataId; 186}; 187typedef struct _RDP_CB_LOCK_CLIPDATA_EVENT RDP_CB_LOCK_CLIPDATA_EVENT; 188 189struct _RDP_CB_UNLOCK_CLIPDATA_EVENT 190{ 191 wMessage event; 192 UINT32 clipDataId; 193}; 194typedef struct _RDP_CB_UNLOCK_CLIPDATA_EVENT RDP_CB_UNLOCK_CLIPDATA_EVENT; 195 196struct _RDP_CB_TEMPDIR_EVENT 197{ 198 wMessage event; 199 char dirname[520]; 200}; 201typedef struct _RDP_CB_TEMPDIR_EVENT RDP_CB_TEMPDIR_EVENT; 202 203#endif /* FREERDP_CHANNEL_CLIPRDR_CLIENT_CLIPRDR_H */