]> git.saurik.com Git - wxWidgets.git/blame - include/wx/msw/clipbrd.h
Don't define __STRICT_ANSI__, we should build both with and without it.
[wxWidgets.git] / include / wx / msw / clipbrd.h
CommitLineData
2bda0e17 1/////////////////////////////////////////////////////////////////////////////
e1ee679c
VZ
2// Name: wx/msw/clipbrd.h
3// Purpose: wxClipboad class and clipboard functions for MSW
2bda0e17
KB
4// Author: Julian Smart
5// Modified by:
6// Created: 01/02/97
bbcdf8bc 7// Copyright: (c) Julian Smart
65571936 8// Licence: wxWindows licence
2bda0e17
KB
9/////////////////////////////////////////////////////////////////////////////
10
bbcdf8bc
JS
11#ifndef _WX_CLIPBRD_H_
12#define _WX_CLIPBRD_H_
2bda0e17 13
47d67540 14#if wxUSE_CLIPBOARD
2bda0e17 15
26f86486 16// These functions superceded by wxClipboard, but retained in order to
9d701f0e 17// implement wxClipboard, and for compatibility.
26f86486
VZ
18
19// open/close the clipboard
53a2db12
FM
20WXDLLIMPEXP_CORE bool wxOpenClipboard();
21WXDLLIMPEXP_CORE bool wxIsClipboardOpened();
26f86486 22#define wxClipboardOpen wxIsClipboardOpened
53a2db12 23WXDLLIMPEXP_CORE bool wxCloseClipboard();
26f86486
VZ
24
25// get/set data
53a2db12
FM
26WXDLLIMPEXP_CORE bool wxEmptyClipboard();
27WXDLLIMPEXP_CORE bool wxSetClipboardData(wxDataFormat dataFormat,
26f86486
VZ
28 const void *data,
29 int width = 0, int height = 0);
53a2db12 30WXDLLIMPEXP_CORE void* wxGetClipboardData(wxDataFormat dataFormat,
26f86486
VZ
31 long *len = NULL);
32
33// clipboard formats
53a2db12
FM
34WXDLLIMPEXP_CORE bool wxIsClipboardFormatAvailable(wxDataFormat dataFormat);
35WXDLLIMPEXP_CORE wxDataFormat wxEnumClipboardFormats(wxDataFormat dataFormat);
36WXDLLIMPEXP_CORE int wxRegisterClipboardFormat(wxChar *formatName);
37WXDLLIMPEXP_CORE bool wxGetClipboardFormatName(wxDataFormat dataFormat,
32c1cda2 38 wxChar *formatName,
26f86486 39 int maxCount);
2bda0e17 40
06e43511
JS
41//-----------------------------------------------------------------------------
42// wxClipboard
43//-----------------------------------------------------------------------------
2bda0e17 44
53a2db12 45class WXDLLIMPEXP_CORE wxClipboard : public wxClipboardBase
2bda0e17 46{
06e43511 47public:
26f86486 48 wxClipboard();
d3c7fc99 49 virtual ~wxClipboard();
26f86486
VZ
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
f536e0f2
VZ
57 // query whether the clipboard is opened
58 virtual bool IsOpened() const;
59
26f86486
VZ
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
2af18715 67 virtual bool IsSupported( const wxDataFormat& format );
26f86486
VZ
68
69 // fill data with data on the clipboard (if available)
1e8335b0 70 virtual bool GetData( wxDataObject& data );
26f86486
VZ
71
72 // clears wxTheClipboard and the system's clipboard if possible
73 virtual void Clear();
d59ceba5
VZ
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
d59ceba5 80private:
c039fef5 81 IDataObject *m_lastDataObject;
a36d790a 82 bool m_isOpened;
81f0d3ca
VZ
83
84 DECLARE_DYNAMIC_CLASS(wxClipboard)
2bda0e17
KB
85};
86
47d67540 87#endif // wxUSE_CLIPBOARD
9005f2ed
VZ
88
89#endif // _WX_CLIPBRD_H_