]> git.saurik.com Git - wxWidgets.git/blame - include/wx/os2/clipbrd.h
wxMessageBox off the main thread lost result code.
[wxWidgets.git] / include / wx / os2 / clipbrd.h
CommitLineData
0e320a79 1/////////////////////////////////////////////////////////////////////////////
80fdcdb9 2// Name: wx/os2/clipbrd.h
0e320a79
DW
3// Purpose: Clipboard functionality.
4// Note: this functionality is under review, and
77ffb593
JS
5// is derived from wxWidgets 1.xx code. Please contact
6// the wxWidgets developers for further information.
37f214d5 7// Author: David Webster
0e320a79 8// Modified by:
37f214d5 9// Created: 10/13/99
37f214d5 10// Copyright: (c) David Webster
65571936 11// Licence: wxWindows licence
0e320a79
DW
12/////////////////////////////////////////////////////////////////////////////
13
14#ifndef _WX_CLIPBRD_H_
15#define _WX_CLIPBRD_H_
16
37f214d5 17#if wxUSE_CLIPBOARD
0e320a79 18
37f214d5
DW
19#include "wx/list.h"
20#include "wx/module.h"
21#include "wx/dataobj.h" // for wxDataFormat
22
23// These functions superceded by wxClipboard, but retained in order to
24// implement wxClipboard, and for compatibility.
25
26// open/close the clipboard
53a2db12
FM
27WXDLLIMPEXP_CORE bool wxOpenClipboard();
28WXDLLIMPEXP_CORE bool wxIsClipboardOpened();
37f214d5 29#define wxClipboardOpen wxIsClipboardOpened
53a2db12 30WXDLLIMPEXP_CORE bool wxCloseClipboard();
37f214d5
DW
31
32// get/set data
53a2db12
FM
33WXDLLIMPEXP_CORE bool wxEmptyClipboard();
34WXDLLIMPEXP_CORE bool wxSetClipboardData(wxDataFormat dataFormat,
37f214d5
DW
35 const void *data,
36 int width = 0, int height = 0);
53a2db12 37WXDLLIMPEXP_CORE void* wxGetClipboardData(wxDataFormat dataFormat,
37f214d5
DW
38 long *len = NULL);
39
40// clipboard formats
53a2db12
FM
41WXDLLIMPEXP_CORE bool wxIsClipboardFormatAvailable(wxDataFormat dataFormat);
42WXDLLIMPEXP_CORE wxDataFormat wxEnumClipboardFormats(wxDataFormat dataFormat);
43WXDLLIMPEXP_CORE int wxRegisterClipboardFormat(wxChar *formatName);
44WXDLLIMPEXP_CORE bool wxGetClipboardFormatName(wxDataFormat dataFormat,
37f214d5
DW
45 wxChar *formatName,
46 int maxCount);
47
48//-----------------------------------------------------------------------------
49// wxClipboard
50//-----------------------------------------------------------------------------
51
b5dbe15d 52class WXDLLIMPEXP_FWD_CORE wxDataObject;
53a2db12 53class WXDLLIMPEXP_CORE wxClipboard : public wxClipboardBase
0e320a79 54{
37f214d5 55 DECLARE_DYNAMIC_CLASS(wxClipboard)
0e320a79 56
37f214d5
DW
57public:
58 wxClipboard();
d3c7fc99 59 virtual ~wxClipboard();
0e320a79 60
37f214d5
DW
61 // open the clipboard before SetData() and GetData()
62 virtual bool Open();
0e320a79 63
37f214d5
DW
64 // close the clipboard after SetData() and GetData()
65 virtual void Close();
0e320a79 66
6dddc146
DW
67 // query whether the clipboard is opened
68 virtual bool IsOpened() const;
69
37f214d5
DW
70 // set the clipboard data. all other formats will be deleted.
71 virtual bool SetData( wxDataObject *data );
0e320a79 72
37f214d5
DW
73 // add to the clipboard data.
74 virtual bool AddData( wxDataObject *data );
0e320a79 75
37f214d5 76 // ask if data in correct format is available
2af18715 77 virtual bool IsSupported( const wxDataFormat& format );
0e320a79 78
37f214d5 79 // fill data with data on the clipboard (if available)
efe7d6ff 80 virtual bool GetData( wxDataObject& data );
37f214d5
DW
81
82 // clears wxTheClipboard and the system's clipboard if possible
83 virtual void Clear();
0e320a79 84
1be7f92a
DW
85 // flushes the clipboard: this means that the data which is currently on
86 // clipboard will stay available even after the application exits (possibly
87 // eating memory), otherwise the clipboard will be emptied on exit
88 virtual bool Flush();
37f214d5 89
1be7f92a
DW
90private:
91 bool m_clearOnExit;
37f214d5
DW
92};
93
94#endif // wxUSE_CLIPBOARD
9005f2ed 95#endif // _WX_CLIPBRD_H_