wxMSW wxClipboard implementation
[wxWidgets.git] / include / wx / msw / clipbrd.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: clipbrd.h
3 // Purpose: Clipboard functionality
4 // Author: Julian Smart
5 // Modified by:
6 // Created: 01/02/97
7 // RCS-ID: $Id$
8 // Copyright: (c) Julian Smart
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
11
12 #ifndef _WX_CLIPBRD_H_
13 #define _WX_CLIPBRD_H_
14
15 #ifdef __GNUG__
16 #pragma interface "clipbrd.h"
17 #endif
18
19 #include "wx/defs.h"
20 #include "wx/setup.h"
21
22 #if wxUSE_CLIPBOARD
23
24 #include "wx/list.h"
25
26 // These functions superceded by wxClipboard, but retained in order to implement
27 // wxClipboard, and for compatibility.
28 WXDLLEXPORT bool wxOpenClipboard(void);
29 WXDLLEXPORT bool wxClipboardOpen(void);
30 WXDLLEXPORT bool wxCloseClipboard(void);
31 WXDLLEXPORT bool wxEmptyClipboard(void);
32 WXDLLEXPORT bool wxIsClipboardFormatAvailable(wxDataFormat dataFormat);
33 WXDLLEXPORT bool wxSetClipboardData(wxDataFormat dataFormat, wxObject *obj, int width = 0, int height = 0);
34 WXDLLEXPORT wxObject* wxGetClipboardData(wxDataFormat dataFormat, long *len = NULL);
35 WXDLLEXPORT wxDataFormat wxEnumClipboardFormats(wxDataFormat dataFormat);
36 WXDLLEXPORT int wxRegisterClipboardFormat(char *formatName);
37 WXDLLEXPORT bool wxGetClipboardFormatName(wxDataFormat dataFormat, char *formatName, int maxCount);
38
39 //-----------------------------------------------------------------------------
40 // wxClipboard
41 //-----------------------------------------------------------------------------
42
43 class WXDLLEXPORT wxDataObject;
44 class WXDLLEXPORT wxClipboard: public wxObject
45 {
46 DECLARE_DYNAMIC_CLASS(wxClipboard)
47
48 public:
49
50 wxClipboard();
51 ~wxClipboard();
52
53 // open the clipboard before SetData() and GetData()
54 virtual bool Open();
55
56 // close the clipboard after SetData() and GetData()
57 virtual void Close();
58
59 // can be called several times
60 virtual bool SetData( wxDataObject *data );
61
62 // format available on the clipboard ?
63 // supply ID if private format, the same as wxPrivateDataObject::SetId()
64 virtual bool IsSupportedFormat( wxDataFormat format, const wxString &id = wxEmptyString );
65
66 // fill data with data on the clipboard (if available)
67 virtual bool GetData( wxDataObject *data );
68
69 // clears wxTheClipboard and the system's clipboard if possible
70 virtual void Clear();
71
72 // implementation
73
74 bool m_open;
75 };
76
77 /* The clipboard */
78 // WXDLLEXPORT_DATA(extern wxClipboard*) wxTheClipboard;
79
80 #endif // wxUSE_CLIPBOARD
81 #endif
82 // _WX_CLIPBRD_H_