1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/msw/clipbrd.h
3 // Purpose: wxClipboad class and clipboard functions for MSW
4 // Author: Julian Smart
7 // Copyright: (c) Julian Smart
8 // Licence: wxWindows licence
9 /////////////////////////////////////////////////////////////////////////////
11 #ifndef _WX_CLIPBRD_H_
12 #define _WX_CLIPBRD_H_
16 // These functions superceded by wxClipboard, but retained in order to
17 // implement wxClipboard, and for compatibility.
19 // open/close the clipboard
20 WXDLLIMPEXP_CORE
bool wxOpenClipboard();
21 WXDLLIMPEXP_CORE
bool wxIsClipboardOpened();
22 #define wxClipboardOpen wxIsClipboardOpened
23 WXDLLIMPEXP_CORE
bool wxCloseClipboard();
26 WXDLLIMPEXP_CORE
bool wxEmptyClipboard();
27 WXDLLIMPEXP_CORE
bool wxSetClipboardData(wxDataFormat dataFormat
,
29 int width
= 0, int height
= 0);
30 WXDLLIMPEXP_CORE
void* wxGetClipboardData(wxDataFormat dataFormat
,
34 WXDLLIMPEXP_CORE
bool wxIsClipboardFormatAvailable(wxDataFormat dataFormat
);
35 WXDLLIMPEXP_CORE wxDataFormat
wxEnumClipboardFormats(wxDataFormat dataFormat
);
36 WXDLLIMPEXP_CORE
int wxRegisterClipboardFormat(wxChar
*formatName
);
37 WXDLLIMPEXP_CORE
bool wxGetClipboardFormatName(wxDataFormat dataFormat
,
41 //-----------------------------------------------------------------------------
43 //-----------------------------------------------------------------------------
45 class WXDLLIMPEXP_CORE wxClipboard
: public wxClipboardBase
49 virtual ~wxClipboard();
51 // open the clipboard before SetData() and GetData()
54 // close the clipboard after SetData() and GetData()
57 // query whether the clipboard is opened
58 virtual bool IsOpened() const;
60 // set the clipboard data. all other formats will be deleted.
61 virtual bool SetData( wxDataObject
*data
);
63 // add to the clipboard data.
64 virtual bool AddData( wxDataObject
*data
);
66 // ask if data in correct format is available
67 virtual bool IsSupported( const wxDataFormat
& format
);
69 // fill data with data on the clipboard (if available)
70 virtual bool GetData( wxDataObject
& data
);
72 // clears wxTheClipboard and the system's clipboard if possible
75 // flushes the clipboard: this means that the data which is currently on
76 // clipboard will stay available even after the application exits (possibly
77 // eating memory), otherwise the clipboard will be emptied on exit
81 IDataObject
*m_lastDataObject
;
84 DECLARE_DYNAMIC_CLASS(wxClipboard
)
87 #endif // wxUSE_CLIPBOARD
89 #endif // _WX_CLIPBRD_H_