1 /////////////////////////////////////////////////////////////////////////////
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_
15 #if defined(__GNUG__) && !defined(__APPLE__)
16 #pragma interface "clipbrd.h"
22 struct wxDataIdToDataObject
;
26 WX_DECLARE_LIST(wxDataObject
, wxDataObjectList
);
27 WX_DECLARE_LIST(wxDataIdToDataObject
, wxDataIdToDataObjectList
);
29 bool WXDLLEXPORT
wxOpenClipboard();
30 bool WXDLLEXPORT
wxClipboardOpen();
31 bool WXDLLEXPORT
wxCloseClipboard();
32 bool WXDLLEXPORT
wxEmptyClipboard();
33 bool WXDLLEXPORT
wxIsClipboardFormatAvailable(wxDataFormat dataFormat
);
34 bool WXDLLEXPORT
wxSetClipboardData(wxDataFormat dataFormat
, wxObject
*obj
, int width
= 0, int height
= 0);
35 wxObject
* WXDLLEXPORT
wxGetClipboardData(wxDataFormat dataFormat
, long *len
= NULL
);
36 wxDataFormat WXDLLEXPORT
wxEnumClipboardFormats(wxDataFormat dataFormat
);
37 wxDataFormat WXDLLEXPORT
wxRegisterClipboardFormat(char *formatName
);
38 bool WXDLLEXPORT
wxGetClipboardFormatName(wxDataFormat dataFormat
, char *formatName
, int maxCount
);
40 //-----------------------------------------------------------------------------
42 //-----------------------------------------------------------------------------
44 class wxClipboard
: public wxClipboardBase
50 // open the clipboard before SetData() and GetData()
53 // close the clipboard after SetData() and GetData()
57 virtual bool IsOpened() const { return m_open
; }
59 // replaces the data on the clipboard with data
60 virtual bool SetData( wxDataObject
*data
);
62 // adds data to the clipboard
63 virtual bool AddData( wxDataObject
*data
);
65 // format available on the clipboard ?
66 virtual bool IsSupported( const wxDataFormat
& format
);
68 // fill data with data on the clipboard (if available)
69 virtual bool GetData( wxDataObject
& data
);
71 // clears wxTheClipboard and the system's clipboard if possible
74 virtual void UsePrimarySelection(bool primary
= true)
75 { m_usePrimary
= primary
; }
77 // implementation from now on
79 wxDataObjectList m_data
;
81 wxDataIdToDataObjectList m_idToObject
;
84 DECLARE_DYNAMIC_CLASS(wxClipboard
)
87 #endif // wxUSE_CLIPBOARD