]>
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 wxWindows 1.xx code. Please contact
6 // the wxWindows 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_
24 #include "wx/module.h"
25 #include "wx/dataobj.h" // for wxDataFormat
27 // These functions superceded by wxClipboard, but retained in order to
28 // implement wxClipboard, and for compatibility.
30 // open/close the clipboard
31 WXDLLEXPORT
bool wxOpenClipboard();
32 WXDLLEXPORT
bool wxIsClipboardOpened();
33 #define wxClipboardOpen wxIsClipboardOpened
34 WXDLLEXPORT
bool wxCloseClipboard();
37 WXDLLEXPORT
bool wxEmptyClipboard();
38 WXDLLEXPORT
bool wxSetClipboardData(wxDataFormat dataFormat
,
40 int width
= 0, int height
= 0);
41 WXDLLEXPORT
void* wxGetClipboardData(wxDataFormat dataFormat
,
45 WXDLLEXPORT
bool wxIsClipboardFormatAvailable(wxDataFormat dataFormat
);
46 WXDLLEXPORT wxDataFormat
wxEnumClipboardFormats(wxDataFormat dataFormat
);
47 WXDLLEXPORT
int wxRegisterClipboardFormat(wxChar
*formatName
);
48 WXDLLEXPORT
bool wxGetClipboardFormatName(wxDataFormat dataFormat
,
52 //-----------------------------------------------------------------------------
54 //-----------------------------------------------------------------------------
56 class WXDLLEXPORT wxDataObject
;
57 class WXDLLEXPORT wxClipboard
: public wxObject
59 DECLARE_DYNAMIC_CLASS(wxClipboard
)
65 // open the clipboard before SetData() and GetData()
68 // close the clipboard after SetData() and GetData()
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( 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 /// X11 has two clipboards which get selected by this call. Empty on MSW.
87 void UsePrimarySelection( bool WXUNUSED(primary
) = FALSE
) { }
91 // The global clipboard object
92 WXDLLEXPORT_DATA(extern wxClipboard
*) wxTheClipboard
;
94 //-----------------------------------------------------------------------------
95 // wxClipboardModule: module responsible for initializing the global clipboard
97 //-----------------------------------------------------------------------------
99 class wxClipboardModule
: public wxModule
101 DECLARE_DYNAMIC_CLASS(wxClipboardModule
)
104 wxClipboardModule() { }
110 #endif // wxUSE_CLIPBOARD