]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/os2/clipbrd.h
1 /////////////////////////////////////////////////////////////////////////////
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
11 // Copyright: (c) David Webster
12 // Licence: wxWindows licence
13 /////////////////////////////////////////////////////////////////////////////
15 #ifndef _WX_CLIPBRD_H_
16 #define _WX_CLIPBRD_H_
21 #include "wx/module.h"
22 #include "wx/dataobj.h" // for wxDataFormat
24 // These functions superceded by wxClipboard, but retained in order to
25 // implement wxClipboard, and for compatibility.
27 // open/close the clipboard
28 WXDLLEXPORT
bool wxOpenClipboard();
29 WXDLLEXPORT
bool wxIsClipboardOpened();
30 #define wxClipboardOpen wxIsClipboardOpened
31 WXDLLEXPORT
bool wxCloseClipboard();
34 WXDLLEXPORT
bool wxEmptyClipboard();
35 WXDLLEXPORT
bool wxSetClipboardData(wxDataFormat dataFormat
,
37 int width
= 0, int height
= 0);
38 WXDLLEXPORT
void* wxGetClipboardData(wxDataFormat dataFormat
,
42 WXDLLEXPORT
bool wxIsClipboardFormatAvailable(wxDataFormat dataFormat
);
43 WXDLLEXPORT wxDataFormat
wxEnumClipboardFormats(wxDataFormat dataFormat
);
44 WXDLLEXPORT
int wxRegisterClipboardFormat(wxChar
*formatName
);
45 WXDLLEXPORT
bool wxGetClipboardFormatName(wxDataFormat dataFormat
,
49 //-----------------------------------------------------------------------------
51 //-----------------------------------------------------------------------------
53 class WXDLLEXPORT wxDataObject
;
54 class WXDLLEXPORT wxClipboard
: public wxClipboardBase
56 DECLARE_DYNAMIC_CLASS(wxClipboard
)
60 virtual ~wxClipboard();
62 // open the clipboard before SetData() and GetData()
65 // close the clipboard after SetData() and GetData()
68 // query whether the clipboard is opened
69 virtual bool IsOpened() const;
71 // set the clipboard data. all other formats will be deleted.
72 virtual bool SetData( wxDataObject
*data
);
74 // add to the clipboard data.
75 virtual bool AddData( wxDataObject
*data
);
77 // ask if data in correct format is available
78 virtual bool IsSupported( const wxDataFormat
& format
);
80 // fill data with data on the clipboard (if available)
81 virtual bool GetData( wxDataObject
& data
);
83 // clears wxTheClipboard and the system's clipboard if possible
86 // flushes the clipboard: this means that the data which is currently on
87 // clipboard will stay available even after the application exits (possibly
88 // eating memory), otherwise the clipboard will be emptied on exit
91 // X11 has two clipboards which get selected by this call. Empty on MSW.
92 void UsePrimarySelection( bool WXUNUSED(primary
) = FALSE
) { }
98 #endif // wxUSE_CLIPBOARD