cliprdr.h (6548B)
1/** 2 * FreeRDP: A Remote Desktop Protocol Implementation 3 * Clipboard Virtual Channel Server Interface 4 * 5 * Copyright 2013 Marc-Andre Moreau <marcandre.moreau@gmail.com> 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_SERVER_CLIPRDR_H 23#define FREERDP_CHANNEL_CLIPRDR_SERVER_CLIPRDR_H 24 25#include <freerdp/api.h> 26#include <freerdp/types.h> 27#include <freerdp/channels/wtsvc.h> 28 29#include <freerdp/channels/cliprdr.h> 30#include <freerdp/client/cliprdr.h> 31 32/** 33 * Server Interface 34 */ 35 36typedef struct _cliprdr_server_context CliprdrServerContext; 37 38typedef UINT (*psCliprdrOpen)(CliprdrServerContext* context); 39typedef UINT (*psCliprdrClose)(CliprdrServerContext* context); 40typedef UINT (*psCliprdrStart)(CliprdrServerContext* context); 41typedef UINT (*psCliprdrStop)(CliprdrServerContext* context); 42typedef HANDLE (*psCliprdrGetEventHandle)(CliprdrServerContext* context); 43typedef UINT (*psCliprdrCheckEventHandle)(CliprdrServerContext* context); 44 45typedef UINT (*psCliprdrServerCapabilities)(CliprdrServerContext* context, 46 const CLIPRDR_CAPABILITIES* capabilities); 47typedef UINT (*psCliprdrClientCapabilities)(CliprdrServerContext* context, 48 const CLIPRDR_CAPABILITIES* capabilities); 49typedef UINT (*psCliprdrMonitorReady)(CliprdrServerContext* context, 50 const CLIPRDR_MONITOR_READY* monitorReady); 51typedef UINT (*psCliprdrTempDirectory)(CliprdrServerContext* context, 52 const CLIPRDR_TEMP_DIRECTORY* tempDirectory); 53typedef UINT (*psCliprdrClientFormatList)(CliprdrServerContext* context, 54 const CLIPRDR_FORMAT_LIST* formatList); 55typedef UINT (*psCliprdrServerFormatList)(CliprdrServerContext* context, 56 const CLIPRDR_FORMAT_LIST* formatList); 57typedef UINT (*psCliprdrClientFormatListResponse)( 58 CliprdrServerContext* context, const CLIPRDR_FORMAT_LIST_RESPONSE* formatListResponse); 59typedef UINT (*psCliprdrServerFormatListResponse)( 60 CliprdrServerContext* context, const CLIPRDR_FORMAT_LIST_RESPONSE* formatListResponse); 61typedef UINT (*psCliprdrClientLockClipboardData)( 62 CliprdrServerContext* context, const CLIPRDR_LOCK_CLIPBOARD_DATA* lockClipboardData); 63typedef UINT (*psCliprdrServerLockClipboardData)( 64 CliprdrServerContext* context, const CLIPRDR_LOCK_CLIPBOARD_DATA* lockClipboardData); 65typedef UINT (*psCliprdrClientUnlockClipboardData)( 66 CliprdrServerContext* context, const CLIPRDR_UNLOCK_CLIPBOARD_DATA* unlockClipboardData); 67typedef UINT (*psCliprdrServerUnlockClipboardData)( 68 CliprdrServerContext* context, const CLIPRDR_UNLOCK_CLIPBOARD_DATA* unlockClipboardData); 69typedef UINT (*psCliprdrClientFormatDataRequest)( 70 CliprdrServerContext* context, const CLIPRDR_FORMAT_DATA_REQUEST* formatDataRequest); 71typedef UINT (*psCliprdrServerFormatDataRequest)( 72 CliprdrServerContext* context, const CLIPRDR_FORMAT_DATA_REQUEST* formatDataRequest); 73typedef UINT (*psCliprdrClientFormatDataResponse)( 74 CliprdrServerContext* context, const CLIPRDR_FORMAT_DATA_RESPONSE* formatDataResponse); 75typedef UINT (*psCliprdrServerFormatDataResponse)( 76 CliprdrServerContext* context, const CLIPRDR_FORMAT_DATA_RESPONSE* formatDataResponse); 77typedef UINT (*psCliprdrClientFileContentsRequest)( 78 CliprdrServerContext* context, const CLIPRDR_FILE_CONTENTS_REQUEST* fileContentsRequest); 79typedef UINT (*psCliprdrServerFileContentsRequest)( 80 CliprdrServerContext* context, const CLIPRDR_FILE_CONTENTS_REQUEST* fileContentsRequest); 81typedef UINT (*psCliprdrClientFileContentsResponse)( 82 CliprdrServerContext* context, const CLIPRDR_FILE_CONTENTS_RESPONSE* fileContentsResponse); 83typedef UINT (*psCliprdrServerFileContentsResponse)( 84 CliprdrServerContext* context, const CLIPRDR_FILE_CONTENTS_RESPONSE* fileContentsResponse); 85 86struct _cliprdr_server_context 87{ 88 void* handle; 89 void* custom; 90 91 /* server clipboard capabilities - set by server - updated by the channel after client 92 * capability exchange */ 93 BOOL useLongFormatNames; 94 BOOL streamFileClipEnabled; 95 BOOL fileClipNoFilePaths; 96 BOOL canLockClipData; 97 98 psCliprdrOpen Open; 99 psCliprdrClose Close; 100 psCliprdrStart Start; 101 psCliprdrStop Stop; 102 psCliprdrGetEventHandle GetEventHandle; 103 psCliprdrCheckEventHandle CheckEventHandle; 104 105 psCliprdrServerCapabilities ServerCapabilities; 106 psCliprdrClientCapabilities ClientCapabilities; 107 psCliprdrMonitorReady MonitorReady; 108 psCliprdrTempDirectory TempDirectory; 109 psCliprdrClientFormatList ClientFormatList; 110 psCliprdrServerFormatList ServerFormatList; 111 psCliprdrClientFormatListResponse ClientFormatListResponse; 112 psCliprdrServerFormatListResponse ServerFormatListResponse; 113 psCliprdrClientLockClipboardData ClientLockClipboardData; 114 psCliprdrServerLockClipboardData ServerLockClipboardData; 115 psCliprdrClientUnlockClipboardData ClientUnlockClipboardData; 116 psCliprdrServerUnlockClipboardData ServerUnlockClipboardData; 117 psCliprdrClientFormatDataRequest ClientFormatDataRequest; 118 psCliprdrServerFormatDataRequest ServerFormatDataRequest; 119 psCliprdrClientFormatDataResponse ClientFormatDataResponse; 120 psCliprdrServerFormatDataResponse ServerFormatDataResponse; 121 psCliprdrClientFileContentsRequest ClientFileContentsRequest; 122 psCliprdrServerFileContentsRequest ServerFileContentsRequest; 123 psCliprdrClientFileContentsResponse ClientFileContentsResponse; 124 psCliprdrServerFileContentsResponse ServerFileContentsResponse; 125 126 rdpContext* rdpcontext; 127 BOOL autoInitializationSequence; 128 UINT32 lastRequestedFormatId; 129 BOOL hasHugeFileSupport; 130}; 131 132#ifdef __cplusplus 133extern "C" 134{ 135#endif 136 137 FREERDP_API CliprdrServerContext* cliprdr_server_context_new(HANDLE vcm); 138 FREERDP_API void cliprdr_server_context_free(CliprdrServerContext* context); 139 140#ifdef __cplusplus 141} 142#endif 143 144#endif /* FREERDP_CHANNEL_CLIPRDR_SERVER_CLIPRDR_H */