1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/motif/clipbrd.h
3 // Purpose: Clipboard functionality.
4 // Author: Julian Smart
8 // Copyright: (c) Julian Smart
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 #ifndef _WX_CLIPBRD_H_
13 #define _WX_CLIPBRD_H_
17 class WXDLLIMPEXP_FWD_CORE wxDataObject
;
18 struct wxDataIdToDataObject
;
22 WX_DECLARE_LIST(wxDataObject
, wxDataObjectList
);
23 WX_DECLARE_LIST(wxDataIdToDataObject
, wxDataIdToDataObjectList
);
25 WXDLLIMPEXP_CORE
bool wxOpenClipboard();
26 WXDLLIMPEXP_CORE
bool wxClipboardOpen();
27 WXDLLIMPEXP_CORE
bool wxCloseClipboard();
28 WXDLLIMPEXP_CORE
bool wxEmptyClipboard();
29 WXDLLIMPEXP_CORE
bool wxIsClipboardFormatAvailable(wxDataFormat dataFormat
);
30 WXDLLIMPEXP_CORE
bool wxSetClipboardData(wxDataFormat dataFormat
, wxObject
*obj
, int width
= 0, int height
= 0);
31 WXDLLIMPEXP_CORE wxObject
* wxGetClipboardData(wxDataFormat dataFormat
, long *len
= NULL
);
32 WXDLLIMPEXP_CORE wxDataFormat
wxEnumClipboardFormats(wxDataFormat dataFormat
);
33 WXDLLIMPEXP_CORE wxDataFormat
wxRegisterClipboardFormat(char *formatName
);
34 WXDLLIMPEXP_CORE
bool wxGetClipboardFormatName(wxDataFormat dataFormat
, char *formatName
, int maxCount
);
36 //-----------------------------------------------------------------------------
38 //-----------------------------------------------------------------------------
40 class WXDLLIMPEXP_CORE wxClipboard
: public wxClipboardBase
44 virtual ~wxClipboard();
46 // open the clipboard before SetData() and GetData()
49 // close the clipboard after SetData() and GetData()
53 virtual bool IsOpened() const { return m_open
; }
55 // replaces the data on the clipboard with data
56 virtual bool SetData( wxDataObject
*data
);
58 // adds data to the clipboard
59 virtual bool AddData( wxDataObject
*data
);
61 // format available on the clipboard ?
62 virtual bool IsSupported( const wxDataFormat
& format
);
64 // fill data with data on the clipboard (if available)
65 virtual bool GetData( wxDataObject
& data
);
67 // clears wxTheClipboard and the system's clipboard if possible
70 // implementation from now on
72 wxDataObjectList m_data
;
73 wxDataIdToDataObjectList m_idToObject
;
76 DECLARE_DYNAMIC_CLASS(wxClipboard
)
79 #endif // wxUSE_CLIPBOARD
81 #endif // _WX_CLIPBRD_H_