]> git.saurik.com Git - wxWidgets.git/blob - include/wx/msw/clipbrd.h
1. added wxTreeCtrl::GetLastChild (modified MSW, GTK, generic and docs)
[wxWidgets.git] / include / wx / msw / clipbrd.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: clipbrd.h
3 // Purpose: Clipboard functionality
4 // Author: Julian Smart
5 // Modified by:
6 // Created: 01/02/97
7 // RCS-ID: $Id$
8 // Copyright: (c) Julian Smart
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
11
12 #ifndef _WX_CLIPBRD_H_
13 #define _WX_CLIPBRD_H_
14
15 #ifdef __GNUG__
16 #pragma interface "clipbrd.h"
17 #endif
18
19 #include "wx/defs.h"
20 #include "wx/setup.h"
21
22 #if wxUSE_CLIPBOARD
23
24 #include "wx/list.h"
25 #include "wx/module.h"
26
27 // These functions superceded by wxClipboard, but retained in order to implement
28 // wxClipboard, and for compatibility.
29 WXDLLEXPORT bool wxOpenClipboard(void);
30 WXDLLEXPORT bool wxClipboardOpen(void);
31 WXDLLEXPORT bool wxCloseClipboard(void);
32 WXDLLEXPORT bool wxEmptyClipboard(void);
33 WXDLLEXPORT bool wxIsClipboardFormatAvailable(wxDataFormat dataFormat);
34 WXDLLEXPORT bool wxSetClipboardData(wxDataFormat dataFormat, wxObject *obj, int width = 0, int height = 0);
35 WXDLLEXPORT wxObject* wxGetClipboardData(wxDataFormat dataFormat, long *len = NULL);
36 WXDLLEXPORT wxDataFormat wxEnumClipboardFormats(wxDataFormat dataFormat);
37 WXDLLEXPORT int wxRegisterClipboardFormat(char *formatName);
38 WXDLLEXPORT bool wxGetClipboardFormatName(wxDataFormat dataFormat, char *formatName, int maxCount);
39
40 //-----------------------------------------------------------------------------
41 // wxClipboard
42 //-----------------------------------------------------------------------------
43
44 class WXDLLEXPORT wxDataObject;
45 class WXDLLEXPORT wxClipboard: public wxObject
46 {
47 DECLARE_DYNAMIC_CLASS(wxClipboard)
48
49 public:
50
51 wxClipboard();
52 ~wxClipboard();
53
54 // open the clipboard before SetData() and GetData()
55 virtual bool Open();
56
57 // close the clipboard after SetData() and GetData()
58 virtual void Close();
59
60 // can be called several times
61 virtual bool SetData( wxDataObject *data );
62
63 // format available on the clipboard ?
64 // supply ID if private format, the same as wxPrivateDataObject::SetId()
65 virtual bool IsSupportedFormat( wxDataFormat format, const wxString &id = wxEmptyString );
66
67 // fill data with data on the clipboard (if available)
68 virtual bool GetData( wxDataObject *data );
69
70 // clears wxTheClipboard and the system's clipboard if possible
71 virtual void Clear();
72
73 // implementation
74
75 bool m_open;
76 wxList m_data;
77 };
78
79 /* The clipboard */
80 WXDLLEXPORT_DATA(extern wxClipboard*) wxTheClipboard;
81
82 //-----------------------------------------------------------------------------
83 // wxClipboardModule
84 //-----------------------------------------------------------------------------
85
86 class wxClipboardModule: public wxModule
87 {
88 DECLARE_DYNAMIC_CLASS(wxClipboardModule)
89
90 public:
91 wxClipboardModule() {}
92 bool OnInit();
93 void OnExit();
94 };
95
96 #endif // wxUSE_CLIPBOARD
97 #endif
98 // _WX_CLIPBRD_H_