]>
Commit | Line | Data |
---|---|---|
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 | // 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 | #if wxUSE_CLIPBOARD | |
20 | ||
21 | #include "wx/list.h" | |
22 | #include "wx/module.h" | |
23 | #include "wx/dataobj.h" // for wxDataFormat | |
24 | ||
25 | // These functions superceded by wxClipboard, but retained in order to | |
26 | // implement wxClipboard, and for compatibility. | |
27 | ||
28 | // open/close the clipboard | |
29 | WXDLLEXPORT bool wxOpenClipboard(); | |
30 | WXDLLEXPORT bool wxIsClipboardOpened(); | |
31 | #define wxClipboardOpen wxIsClipboardOpened | |
32 | WXDLLEXPORT bool wxCloseClipboard(); | |
33 | ||
34 | // get/set data | |
35 | WXDLLEXPORT bool wxEmptyClipboard(); | |
36 | WXDLLEXPORT bool wxSetClipboardData(wxDataFormat dataFormat, | |
37 | const void *data, | |
38 | int width = 0, int height = 0); | |
39 | WXDLLEXPORT void* wxGetClipboardData(wxDataFormat dataFormat, | |
40 | long *len = NULL); | |
41 | ||
42 | // clipboard formats | |
43 | WXDLLEXPORT bool wxIsClipboardFormatAvailable(wxDataFormat dataFormat); | |
44 | WXDLLEXPORT wxDataFormat wxEnumClipboardFormats(wxDataFormat dataFormat); | |
45 | WXDLLEXPORT int wxRegisterClipboardFormat(wxChar *formatName); | |
46 | WXDLLEXPORT bool wxGetClipboardFormatName(wxDataFormat dataFormat, | |
47 | wxChar *formatName, | |
48 | int maxCount); | |
49 | ||
50 | //----------------------------------------------------------------------------- | |
51 | // wxClipboard | |
52 | //----------------------------------------------------------------------------- | |
53 | ||
54 | class WXDLLEXPORT wxDataObject; | |
55 | class WXDLLEXPORT wxClipboard : public wxObject | |
56 | { | |
57 | DECLARE_DYNAMIC_CLASS(wxClipboard) | |
58 | ||
59 | public: | |
60 | wxClipboard(); | |
61 | ~wxClipboard(); | |
62 | ||
63 | // open the clipboard before SetData() and GetData() | |
64 | virtual bool Open(); | |
65 | ||
66 | // close the clipboard after SetData() and GetData() | |
67 | virtual void Close(); | |
68 | ||
69 | // set the clipboard data. all other formats will be deleted. | |
70 | virtual bool SetData( wxDataObject *data ); | |
71 | ||
72 | // add to the clipboard data. | |
73 | virtual bool AddData( wxDataObject *data ); | |
74 | ||
75 | // ask if data in correct format is available | |
76 | virtual bool IsSupported( wxDataFormat format ); | |
77 | ||
78 | // fill data with data on the clipboard (if available) | |
79 | virtual bool GetData( wxDataObject *data ); | |
80 | ||
81 | // clears wxTheClipboard and the system's clipboard if possible | |
82 | virtual void Clear(); | |
83 | ||
84 | // flushes the clipboard: this means that the data which is currently on | |
85 | // clipboard will stay available even after the application exits (possibly | |
86 | // eating memory), otherwise the clipboard will be emptied on exit | |
87 | virtual bool Flush(); | |
88 | ||
89 | // X11 has two clipboards which get selected by this call. Empty on MSW. | |
90 | void UsePrimarySelection( bool WXUNUSED(primary) = FALSE ) { } | |
91 | ||
92 | private: | |
93 | bool m_clearOnExit; | |
94 | }; | |
95 | ||
96 | #endif // wxUSE_CLIPBOARD | |
97 | #endif | |
98 | // _WX_CLIPBRD_H_ |