1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/msw/clipbrd.h
3 // Purpose: wxClipboad class and clipboard functions for MSW
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(NO_GCC_PRAGMA)
16 #pragma interface "clipbrd.h"
22 #include "wx/module.h"
23 #include "wx/dataobj.h" // for wxDataFormat
25 #if WXWIN_COMPATIBILITY_2_4
27 // These functions superceded by wxClipboard, but retained in order to
28 // implement wxClipboard (and exported from DLL to preserve compatibility -
29 // - otherwise they are only implementation details of src/msw/clipbrd.cpp).
31 // open/close the clipboard
32 WXDLLEXPORT
bool wxOpenClipboard();
33 WXDLLEXPORT
bool wxIsClipboardOpened();
34 #define wxClipboardOpen wxIsClipboardOpened
35 WXDLLEXPORT
bool wxCloseClipboard();
38 WXDLLEXPORT
bool wxEmptyClipboard();
39 WXDLLEXPORT
bool wxSetClipboardData(wxDataFormat dataFormat
,
41 int width
= 0, int height
= 0);
42 WXDLLEXPORT
void* wxGetClipboardData(wxDataFormat dataFormat
,
46 WXDLLEXPORT
bool wxIsClipboardFormatAvailable(wxDataFormat dataFormat
);
47 WXDLLEXPORT wxDataFormat
wxEnumClipboardFormats(wxDataFormat dataFormat
);
48 WXDLLEXPORT
int wxRegisterClipboardFormat(wxChar
*formatName
);
49 WXDLLEXPORT
bool wxGetClipboardFormatName(wxDataFormat dataFormat
,
53 #endif // WXWIN_COMPATIBILITY_2_4
55 //-----------------------------------------------------------------------------
57 //-----------------------------------------------------------------------------
59 class WXDLLEXPORT wxDataObject
;
60 class WXDLLEXPORT wxClipboard
: public wxClipboardBase
62 DECLARE_DYNAMIC_CLASS(wxClipboard
)
68 // open the clipboard before SetData() and GetData()
71 // close the clipboard after SetData() and GetData()
74 // query whether the clipboard is opened
75 virtual bool IsOpened() const;
77 // set the clipboard data. all other formats will be deleted.
78 virtual bool SetData( wxDataObject
*data
);
80 // add to the clipboard data.
81 virtual bool AddData( wxDataObject
*data
);
83 // ask if data in correct format is available
84 virtual bool IsSupported( const wxDataFormat
& format
);
86 // fill data with data on the clipboard (if available)
87 virtual bool GetData( wxDataObject
& data
);
89 // clears wxTheClipboard and the system's clipboard if possible
92 // flushes the clipboard: this means that the data which is currently on
93 // clipboard will stay available even after the application exits (possibly
94 // eating memory), otherwise the clipboard will be emptied on exit
97 // X11 has two clipboards which get selected by this call. Empty on MSW.
98 void UsePrimarySelection( bool WXUNUSED(primary
) = FALSE
) { }
105 #endif // wxUSE_CLIPBOARD