1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/motif/clipbrd.h
3 // Purpose: Clipboard functionality.
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 class WXDLLIMPEXP_FWD_CORE wxDataObject
;
17 struct wxDataIdToDataObject
;
21 WX_DECLARE_LIST(wxDataObject
, wxDataObjectList
);
22 WX_DECLARE_LIST(wxDataIdToDataObject
, wxDataIdToDataObjectList
);
24 WXDLLIMPEXP_CORE
bool wxOpenClipboard();
25 WXDLLIMPEXP_CORE
bool wxClipboardOpen();
26 WXDLLIMPEXP_CORE
bool wxCloseClipboard();
27 WXDLLIMPEXP_CORE
bool wxEmptyClipboard();
28 WXDLLIMPEXP_CORE
bool wxIsClipboardFormatAvailable(wxDataFormat dataFormat
);
29 WXDLLIMPEXP_CORE
bool wxSetClipboardData(wxDataFormat dataFormat
, wxObject
*obj
, int width
= 0, int height
= 0);
30 WXDLLIMPEXP_CORE wxObject
* wxGetClipboardData(wxDataFormat dataFormat
, long *len
= NULL
);
31 WXDLLIMPEXP_CORE wxDataFormat
wxEnumClipboardFormats(wxDataFormat dataFormat
);
32 WXDLLIMPEXP_CORE wxDataFormat
wxRegisterClipboardFormat(char *formatName
);
33 WXDLLIMPEXP_CORE
bool wxGetClipboardFormatName(wxDataFormat dataFormat
, char *formatName
, int maxCount
);
35 //-----------------------------------------------------------------------------
37 //-----------------------------------------------------------------------------
39 class WXDLLIMPEXP_CORE wxClipboard
: public wxClipboardBase
43 virtual ~wxClipboard();
45 // open the clipboard before SetData() and GetData()
48 // close the clipboard after SetData() and GetData()
52 virtual bool IsOpened() const { return m_open
; }
54 // replaces the data on the clipboard with data
55 virtual bool SetData( wxDataObject
*data
);
57 // adds data to the clipboard
58 virtual bool AddData( wxDataObject
*data
);
60 // format available on the clipboard ?
61 virtual bool IsSupported( const wxDataFormat
& format
);
63 // fill data with data on the clipboard (if available)
64 virtual bool GetData( wxDataObject
& data
);
66 // clears wxTheClipboard and the system's clipboard if possible
69 // implementation from now on
71 wxDataObjectList m_data
;
72 wxDataIdToDataObjectList m_idToObject
;
75 DECLARE_DYNAMIC_CLASS(wxClipboard
)
78 #endif // wxUSE_CLIPBOARD
80 #endif // _WX_CLIPBRD_H_