]> git.saurik.com Git - wxWidgets.git/blame_incremental - 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
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
20WXDLLIMPEXP_CORE bool wxOpenClipboard();
21WXDLLIMPEXP_CORE bool wxIsClipboardOpened();
22#define wxClipboardOpen wxIsClipboardOpened
23WXDLLIMPEXP_CORE bool wxCloseClipboard();
24
25// get/set data
26WXDLLIMPEXP_CORE bool wxEmptyClipboard();
27WXDLLIMPEXP_CORE bool wxSetClipboardData(wxDataFormat dataFormat,
28 const void *data,
29 int width = 0, int height = 0);
30WXDLLIMPEXP_CORE void* wxGetClipboardData(wxDataFormat dataFormat,
31 long *len = NULL);
32
33// clipboard formats
34WXDLLIMPEXP_CORE bool wxIsClipboardFormatAvailable(wxDataFormat dataFormat);
35WXDLLIMPEXP_CORE wxDataFormat wxEnumClipboardFormats(wxDataFormat dataFormat);
36WXDLLIMPEXP_CORE int wxRegisterClipboardFormat(wxChar *formatName);
37WXDLLIMPEXP_CORE bool wxGetClipboardFormatName(wxDataFormat dataFormat,
38 wxChar *formatName,
39 int maxCount);
40
41//-----------------------------------------------------------------------------
42// wxClipboard
43//-----------------------------------------------------------------------------
44
45class WXDLLIMPEXP_CORE wxClipboard : public wxClipboardBase
46{
47public:
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
80private:
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_