don't export deprecated interface to clipboard from DLL
[wxWidgets.git] / include / wx / msw / clipbrd.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/msw/clipbrd.h
3 // Purpose: wxClipboad class and clipboard functions for MSW
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 #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
16 #pragma interface "clipbrd.h"
17 #endif
18
19 #if wxUSE_CLIPBOARD
20
21 #include "wx/list.h"
22 #include "wx/module.h"
23 #include "wx/dataobj.h" // for wxDataFormat
24
25 #if WXWIN_COMPATIBILITY_2_4
26
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).
30
31 // open/close the clipboard
32 WXDLLEXPORT bool wxOpenClipboard();
33 WXDLLEXPORT bool wxIsClipboardOpened();
34 #define wxClipboardOpen wxIsClipboardOpened
35 WXDLLEXPORT bool wxCloseClipboard();
36
37 // get/set data
38 WXDLLEXPORT bool wxEmptyClipboard();
39 WXDLLEXPORT bool wxSetClipboardData(wxDataFormat dataFormat,
40 const void *data,
41 int width = 0, int height = 0);
42 WXDLLEXPORT void* wxGetClipboardData(wxDataFormat dataFormat,
43 long *len = NULL);
44
45 // clipboard formats
46 WXDLLEXPORT bool wxIsClipboardFormatAvailable(wxDataFormat dataFormat);
47 WXDLLEXPORT wxDataFormat wxEnumClipboardFormats(wxDataFormat dataFormat);
48 WXDLLEXPORT int wxRegisterClipboardFormat(wxChar *formatName);
49 WXDLLEXPORT bool wxGetClipboardFormatName(wxDataFormat dataFormat,
50 wxChar *formatName,
51 int maxCount);
52
53 #endif // WXWIN_COMPATIBILITY_2_4
54
55 //-----------------------------------------------------------------------------
56 // wxClipboard
57 //-----------------------------------------------------------------------------
58
59 class WXDLLEXPORT wxDataObject;
60 class WXDLLEXPORT wxClipboard : public wxClipboardBase
61 {
62 DECLARE_DYNAMIC_CLASS(wxClipboard)
63
64 public:
65 wxClipboard();
66 ~wxClipboard();
67
68 // open the clipboard before SetData() and GetData()
69 virtual bool Open();
70
71 // close the clipboard after SetData() and GetData()
72 virtual void Close();
73
74 // query whether the clipboard is opened
75 virtual bool IsOpened() const;
76
77 // set the clipboard data. all other formats will be deleted.
78 virtual bool SetData( wxDataObject *data );
79
80 // add to the clipboard data.
81 virtual bool AddData( wxDataObject *data );
82
83 // ask if data in correct format is available
84 virtual bool IsSupported( const wxDataFormat& format );
85
86 // fill data with data on the clipboard (if available)
87 virtual bool GetData( wxDataObject& data );
88
89 // clears wxTheClipboard and the system's clipboard if possible
90 virtual void Clear();
91
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
95 virtual bool Flush();
96
97 // X11 has two clipboards which get selected by this call. Empty on MSW.
98 void UsePrimarySelection( bool WXUNUSED(primary) = FALSE ) { }
99
100 private:
101 bool m_clearOnExit;
102 bool m_isOpened;
103 };
104
105 #endif // wxUSE_CLIPBOARD
106 #endif
107 // _WX_CLIPBRD_H_