1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/os2/clipbrd.h
3 // Purpose: Clipboard functionality.
4 // Note: this functionality is under review, and
5 // is derived from wxWidgets 1.xx code. Please contact
6 // the wxWidgets developers for further information.
7 // Author: David Webster
10 // Copyright: (c) David Webster
11 // Licence: wxWindows licence
12 /////////////////////////////////////////////////////////////////////////////
14 #ifndef _WX_CLIPBRD_H_
15 #define _WX_CLIPBRD_H_
20 #include "wx/module.h"
21 #include "wx/dataobj.h" // for wxDataFormat
23 // These functions superceded by wxClipboard, but retained in order to
24 // implement wxClipboard, and for compatibility.
26 // open/close the clipboard
27 WXDLLIMPEXP_CORE
bool wxOpenClipboard();
28 WXDLLIMPEXP_CORE
bool wxIsClipboardOpened();
29 #define wxClipboardOpen wxIsClipboardOpened
30 WXDLLIMPEXP_CORE
bool wxCloseClipboard();
33 WXDLLIMPEXP_CORE
bool wxEmptyClipboard();
34 WXDLLIMPEXP_CORE
bool wxSetClipboardData(wxDataFormat dataFormat
,
36 int width
= 0, int height
= 0);
37 WXDLLIMPEXP_CORE
void* wxGetClipboardData(wxDataFormat dataFormat
,
41 WXDLLIMPEXP_CORE
bool wxIsClipboardFormatAvailable(wxDataFormat dataFormat
);
42 WXDLLIMPEXP_CORE wxDataFormat
wxEnumClipboardFormats(wxDataFormat dataFormat
);
43 WXDLLIMPEXP_CORE
int wxRegisterClipboardFormat(wxChar
*formatName
);
44 WXDLLIMPEXP_CORE
bool wxGetClipboardFormatName(wxDataFormat dataFormat
,
48 //-----------------------------------------------------------------------------
50 //-----------------------------------------------------------------------------
52 class WXDLLIMPEXP_FWD_CORE wxDataObject
;
53 class WXDLLIMPEXP_CORE wxClipboard
: public wxClipboardBase
55 DECLARE_DYNAMIC_CLASS(wxClipboard
)
59 virtual ~wxClipboard();
61 // open the clipboard before SetData() and GetData()
64 // close the clipboard after SetData() and GetData()
67 // query whether the clipboard is opened
68 virtual bool IsOpened() const;
70 // set the clipboard data. all other formats will be deleted.
71 virtual bool SetData( wxDataObject
*data
);
73 // add to the clipboard data.
74 virtual bool AddData( wxDataObject
*data
);
76 // ask if data in correct format is available
77 virtual bool IsSupported( const wxDataFormat
& format
);
79 // fill data with data on the clipboard (if available)
80 virtual bool GetData( wxDataObject
& data
);
82 // clears wxTheClipboard and the system's clipboard if possible
85 // flushes the clipboard: this means that the data which is currently on
86 // clipboard will stay available even after the application exits (possibly
87 // eating memory), otherwise the clipboard will be emptied on exit
94 #endif // wxUSE_CLIPBOARD
95 #endif // _WX_CLIPBRD_H_