]> git.saurik.com Git - wxWidgets.git/blob - include/wx/msw/clipbrd.h
Fix wxPropertyGrid::GetPropertyRect when the last item is collapsed.
[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 // Copyright: (c) Julian Smart
8 // Licence: wxWindows licence
9 /////////////////////////////////////////////////////////////////////////////
10
11 #ifndef _WX_CLIPBRD_H_
12 #define _WX_CLIPBRD_H_
13
14 #if wxUSE_CLIPBOARD
15
16 // These functions superceded by wxClipboard, but retained in order to
17 // implement wxClipboard, and for compatibility.
18
19 // open/close the clipboard
20 WXDLLIMPEXP_CORE bool wxOpenClipboard();
21 WXDLLIMPEXP_CORE bool wxIsClipboardOpened();
22 #define wxClipboardOpen wxIsClipboardOpened
23 WXDLLIMPEXP_CORE bool wxCloseClipboard();
24
25 // get/set data
26 WXDLLIMPEXP_CORE bool wxEmptyClipboard();
27 WXDLLIMPEXP_CORE bool wxSetClipboardData(wxDataFormat dataFormat,
28 const void *data,
29 int width = 0, int height = 0);
30 WXDLLIMPEXP_CORE void* wxGetClipboardData(wxDataFormat dataFormat,
31 long *len = NULL);
32
33 // clipboard formats
34 WXDLLIMPEXP_CORE bool wxIsClipboardFormatAvailable(wxDataFormat dataFormat);
35 WXDLLIMPEXP_CORE wxDataFormat wxEnumClipboardFormats(wxDataFormat dataFormat);
36 WXDLLIMPEXP_CORE int wxRegisterClipboardFormat(wxChar *formatName);
37 WXDLLIMPEXP_CORE bool wxGetClipboardFormatName(wxDataFormat dataFormat,
38 wxChar *formatName,
39 int maxCount);
40
41 //-----------------------------------------------------------------------------
42 // wxClipboard
43 //-----------------------------------------------------------------------------
44
45 class WXDLLIMPEXP_CORE wxClipboard : public wxClipboardBase
46 {
47 public:
48 wxClipboard();
49 virtual ~wxClipboard();
50
51 // open the clipboard before SetData() and GetData()
52 virtual bool Open();
53
54 // close the clipboard after SetData() and GetData()
55 virtual void Close();
56
57 // query whether the clipboard is opened
58 virtual bool IsOpened() const;
59
60 // set the clipboard data. all other formats will be deleted.
61 virtual bool SetData( wxDataObject *data );
62
63 // add to the clipboard data.
64 virtual bool AddData( wxDataObject *data );
65
66 // ask if data in correct format is available
67 virtual bool IsSupported( const wxDataFormat& format );
68
69 // fill data with data on the clipboard (if available)
70 virtual bool GetData( wxDataObject& data );
71
72 // clears wxTheClipboard and the system's clipboard if possible
73 virtual void Clear();
74
75 // flushes the clipboard: this means that the data which is currently on
76 // clipboard will stay available even after the application exits (possibly
77 // eating memory), otherwise the clipboard will be emptied on exit
78 virtual bool Flush();
79
80 private:
81 IDataObject *m_lastDataObject;
82 bool m_isOpened;
83
84 DECLARE_DYNAMIC_CLASS(wxClipboard)
85 };
86
87 #endif // wxUSE_CLIPBOARD
88
89 #endif // _WX_CLIPBRD_H_