FreeRDP
include/winpr/clipboard.h
1 
20 #ifndef WINPR_CLIPBOARD_H
21 #define WINPR_CLIPBOARD_H
22 
23 #include <winpr/winpr.h>
24 #include <winpr/wtypes.h>
25 
26 typedef struct s_wClipboard wClipboard;
27 
28 typedef void* (*CLIPBOARD_SYNTHESIZE_FN)(wClipboard* clipboard, UINT32 formatId, const void* data,
29  UINT32* pSize);
30 
31 typedef struct
32 {
33  UINT32 streamId;
34  UINT32 listIndex;
36 
37 typedef struct
38 {
39  UINT32 streamId;
40  UINT32 listIndex;
41  UINT32 nPositionLow;
42  UINT32 nPositionHigh;
43  UINT32 cbRequested;
45 
46 typedef struct s_wClipboardDelegate wClipboardDelegate;
47 
49 {
50  wClipboard* clipboard;
51  void* custom;
52  char* basePath;
53 
54  UINT (*ClientRequestFileSize)(wClipboardDelegate*, const wClipboardFileSizeRequest*);
55  UINT(*ClipboardFileSizeSuccess)
56  (wClipboardDelegate*, const wClipboardFileSizeRequest*, UINT64 fileSize);
57  UINT(*ClipboardFileSizeFailure)
58  (wClipboardDelegate*, const wClipboardFileSizeRequest*, UINT errorCode);
59 
60  UINT (*ClientRequestFileRange)(wClipboardDelegate*, const wClipboardFileRangeRequest*);
61  UINT(*ClipboardFileRangeSuccess)
62  (wClipboardDelegate*, const wClipboardFileRangeRequest*, const BYTE* data, UINT32 size);
63  UINT(*ClipboardFileRangeFailure)
64  (wClipboardDelegate*, const wClipboardFileRangeRequest*, UINT errorCode);
65 
66  BOOL (*IsFileNameComponentValid)(LPCWSTR lpFileName);
67 };
68 
69 #ifdef __cplusplus
70 extern "C"
71 {
72 #endif
73 
74  WINPR_API void ClipboardLock(wClipboard* clipboard);
75  WINPR_API void ClipboardUnlock(wClipboard* clipboard);
76 
77  WINPR_API BOOL ClipboardEmpty(wClipboard* clipboard);
78  WINPR_API UINT32 ClipboardCountFormats(wClipboard* clipboard);
79  WINPR_API UINT32 ClipboardGetFormatIds(wClipboard* clipboard, UINT32** ppFormatIds);
80 
81  WINPR_API UINT32 ClipboardCountRegisteredFormats(wClipboard* clipboard);
82  WINPR_API UINT32 ClipboardGetRegisteredFormatIds(wClipboard* clipboard, UINT32** ppFormatIds);
83  WINPR_API UINT32 ClipboardRegisterFormat(wClipboard* clipboard, const char* name);
84 
85  WINPR_API BOOL ClipboardRegisterSynthesizer(wClipboard* clipboard, UINT32 formatId,
86  UINT32 syntheticId,
87  CLIPBOARD_SYNTHESIZE_FN pfnSynthesize);
88 
89  WINPR_API UINT32 ClipboardGetFormatId(wClipboard* clipboard, const char* name);
90  WINPR_API const char* ClipboardGetFormatName(wClipboard* clipboard, UINT32 formatId);
91  WINPR_API void* ClipboardGetData(wClipboard* clipboard, UINT32 formatId, UINT32* pSize);
92  WINPR_API BOOL ClipboardSetData(wClipboard* clipboard, UINT32 formatId, const void* data,
93  UINT32 size);
94 
95  WINPR_API UINT64 ClipboardGetOwner(wClipboard* clipboard);
96  WINPR_API void ClipboardSetOwner(wClipboard* clipboard, UINT64 ownerId);
97 
98  WINPR_API wClipboardDelegate* ClipboardGetDelegate(wClipboard* clipboard);
99 
100  WINPR_API wClipboard* ClipboardCreate(void);
101  WINPR_API void ClipboardDestroy(wClipboard* clipboard);
102 
103  WINPR_API const char* ClipboardGetFormatIdString(UINT32 formatId);
104 
105 #ifdef __cplusplus
106 }
107 #endif
108 
109 #endif /* WINPR_CLIPBOARD_H */