1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: Clipboard functionality.
4 // Note: this functionality is under review, and
5 // is derived from wxWindows 1.xx code. Please contact
6 // the wxWindows developers for further information.
11 // Copyright: (c) AUTHOR
12 // Licence: wxWindows licence
13 /////////////////////////////////////////////////////////////////////////////
15 #ifndef _WX_CLIPBRD_H_
16 #define _WX_CLIPBRD_H_
19 #pragma interface "clipbrd.h"
27 /* A clipboard client holds data belonging to the clipboard.
28 For plain text, a client is not necessary. */
29 class WXDLLEXPORT wxClipboardClient
: public wxObject
31 DECLARE_ABSTRACT_CLASS(wxClipboardClient
)
34 /* This list should be filled in with strings indicating the formats
35 this client can provide. Almost all clients will provide "TEXT".
36 Format names should be 4 characters long, so things will work
37 out on the Macintosh */
40 /* This method is called when the client is losing the selection. */
41 virtual void BeingReplaced() = 0;
43 /* This method is called when someone wants the data this client is
44 supplying to the clipboard. "format" is a string indicating the
45 format of the data - one of the strings from the "formats"
46 list. "*size" should be filled with the size of the resulting
47 data. In the case of text, "*size" does not count the
49 virtual char *GetData(char *format
, long *size
) = 0;
52 /* ONE instance of this class: */
53 class WXDLLEXPORT wxClipboard
: public wxObject
55 DECLARE_DYNAMIC_CLASS(wxClipboard
)
58 wxClipboardClient
*clipOwner
;
59 char *cbString
, *sentString
, *receivedString
;
60 void *receivedTargets
;
66 /* Set the clipboard data owner. "time" comes from the event record. */
67 void SetClipboardClient(wxClipboardClient
*, long time
);
69 /* Set the clipboard string; does not require a client. */
70 void SetClipboardString(char *, long time
);
72 /* Get data from the clipboard in the format "TEXT". */
73 char *GetClipboardString(long time
);
75 /* Get data from the clipboard */
76 char *GetClipboardData(char *format
, long *length
, long time
);
78 /* Get the clipboard client directly. Will be NULL if clipboard data
79 is a string, or if some other application owns the clipboard.
80 This can be useful for shortcutting data translation, if the
81 clipboard user can check for a specific client. (This is used
82 by the wxMediaEdit class.) */
83 wxClipboardClient
*GetClipboardClient();
86 /* Initialize wxTheClipboard. Can be called repeatedly */
87 void WXDLLEXPORT
wxInitClipboard();
90 WXDLLEXPORT_DATA(extern wxClipboard
*) wxTheClipboard
;