]> git.saurik.com Git - wxWidgets.git/blame_incremental - include/wx/motif/clipbrd.h
wxMessageBox off the main thread lost result code.
[wxWidgets.git] / include / wx / motif / clipbrd.h
... / ...
CommitLineData
1/////////////////////////////////////////////////////////////////////////////
2// Name: wx/motif/clipbrd.h
3// Purpose: Clipboard functionality.
4// Author: Julian Smart
5// Modified by:
6// Created: 17/09/98
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
16class WXDLLIMPEXP_FWD_CORE wxDataObject;
17struct wxDataIdToDataObject;
18
19#include "wx/list.h"
20
21WX_DECLARE_LIST(wxDataObject, wxDataObjectList);
22WX_DECLARE_LIST(wxDataIdToDataObject, wxDataIdToDataObjectList);
23
24WXDLLIMPEXP_CORE bool wxOpenClipboard();
25WXDLLIMPEXP_CORE bool wxClipboardOpen();
26WXDLLIMPEXP_CORE bool wxCloseClipboard();
27WXDLLIMPEXP_CORE bool wxEmptyClipboard();
28WXDLLIMPEXP_CORE bool wxIsClipboardFormatAvailable(wxDataFormat dataFormat);
29WXDLLIMPEXP_CORE bool wxSetClipboardData(wxDataFormat dataFormat, wxObject *obj, int width = 0, int height = 0);
30WXDLLIMPEXP_CORE wxObject* wxGetClipboardData(wxDataFormat dataFormat, long *len = NULL);
31WXDLLIMPEXP_CORE wxDataFormat wxEnumClipboardFormats(wxDataFormat dataFormat);
32WXDLLIMPEXP_CORE wxDataFormat wxRegisterClipboardFormat(char *formatName);
33WXDLLIMPEXP_CORE bool wxGetClipboardFormatName(wxDataFormat dataFormat, char *formatName, int maxCount);
34
35//-----------------------------------------------------------------------------
36// wxClipboard
37//-----------------------------------------------------------------------------
38
39class WXDLLIMPEXP_CORE wxClipboard : public wxClipboardBase
40{
41public:
42 wxClipboard();
43 virtual ~wxClipboard();
44
45 // open the clipboard before SetData() and GetData()
46 virtual bool Open();
47
48 // close the clipboard after SetData() and GetData()
49 virtual void Close();
50
51 // opened?
52 virtual bool IsOpened() const { return m_open; }
53
54 // replaces the data on the clipboard with data
55 virtual bool SetData( wxDataObject *data );
56
57 // adds data to the clipboard
58 virtual bool AddData( wxDataObject *data );
59
60 // format available on the clipboard ?
61 virtual bool IsSupported( const wxDataFormat& format );
62
63 // fill data with data on the clipboard (if available)
64 virtual bool GetData( wxDataObject& data );
65
66 // clears wxTheClipboard and the system's clipboard if possible
67 virtual void Clear();
68
69 // implementation from now on
70 bool m_open;
71 wxDataObjectList m_data;
72 wxDataIdToDataObjectList m_idToObject;
73
74private:
75 DECLARE_DYNAMIC_CLASS(wxClipboard)
76};
77
78#endif // wxUSE_CLIPBOARD
79
80#endif // _WX_CLIPBRD_H_