]> git.saurik.com Git - wxWidgets.git/blob - include/wx/motif/clipbrd.h
Support different for Visualage Versions
[wxWidgets.git] / include / wx / motif / clipbrd.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: clipbrd.h
3 // Purpose: Clipboard functionality.
4 // Note: this functionality is under review, and
5 // is derived from wxWindows 1.xx code. Please contact
6 // the wxWindows developers for further information.
7 // Author: Julian Smart
8 // Modified by:
9 // Created: 17/09/98
10 // RCS-ID: $Id$
11 // Copyright: (c) Julian Smart
12 // Licence: wxWindows licence
13 /////////////////////////////////////////////////////////////////////////////
14
15 #ifndef _WX_CLIPBRD_H_
16 #define _WX_CLIPBRD_H_
17
18 #ifdef __GNUG__
19 #pragma interface "clipbrd.h"
20 #endif
21
22 #if wxUSE_CLIPBOARD
23
24 #include "wx/dataobj.h"
25
26 #include "wx/module.h"
27
28 bool WXDLLEXPORT wxOpenClipboard();
29 bool WXDLLEXPORT wxClipboardOpen();
30 bool WXDLLEXPORT wxCloseClipboard();
31 bool WXDLLEXPORT wxEmptyClipboard();
32 bool WXDLLEXPORT wxIsClipboardFormatAvailable(wxDataFormat dataFormat);
33 bool WXDLLEXPORT wxSetClipboardData(wxDataFormat dataFormat, wxObject *obj, int width = 0, int height = 0);
34 wxObject* WXDLLEXPORT wxGetClipboardData(wxDataFormat dataFormat, long *len = NULL);
35 wxDataFormat WXDLLEXPORT wxEnumClipboardFormats(wxDataFormat dataFormat);
36 wxDataFormat WXDLLEXPORT wxRegisterClipboardFormat(char *formatName);
37 bool WXDLLEXPORT wxGetClipboardFormatName(wxDataFormat dataFormat, char *formatName, int maxCount);
38
39 //-----------------------------------------------------------------------------
40 // wxClipboard
41 //-----------------------------------------------------------------------------
42
43 class wxClipboard : public wxClipboardBase
44 {
45 public:
46 wxClipboard();
47 ~wxClipboard();
48
49 // open the clipboard before SetData() and GetData()
50 virtual bool Open();
51
52 // close the clipboard after SetData() and GetData()
53 virtual void Close();
54
55 // can be called several times
56 virtual bool SetData( wxDataObject *data );
57
58 // format available on the clipboard ?
59 // supply ID if private format, the same as wxPrivateDataObject::SetId()
60 virtual bool IsSupported( wxDataFormat format );
61
62 // fill data with data on the clipboard (if available)
63 virtual bool GetData( wxDataObject *data );
64
65 // clears wxTheClipboard and the system's clipboard if possible
66 virtual void Clear();
67
68 // implementation from now on
69
70 bool m_open;
71 wxList m_data;
72 bool m_usePrimary;
73
74 private:
75 DECLARE_DYNAMIC_CLASS(wxClipboard)
76 };
77
78 /* The clipboard */
79 WXDLLEXPORT_DATA(extern wxClipboard*) wxTheClipboard;
80
81 #endif // wxUSE_CLIPBOARD
82
83 #endif
84 // _WX_CLIPBRD_H_