]>
Commit | Line | Data |
---|---|---|
9b6dbb09 JS |
1 | ///////////////////////////////////////////////////////////////////////////// |
2 | // Name: clipbrd.h | |
3 | // Purpose: Clipboard functionality. | |
9b6dbb09 JS |
4 | // Author: Julian Smart |
5 | // Modified by: | |
6 | // Created: 17/09/98 | |
7 | // RCS-ID: $Id$ | |
8 | // Copyright: (c) Julian Smart | |
dfe1eee3 | 9 | // Licence: wxWindows licence |
9b6dbb09 JS |
10 | ///////////////////////////////////////////////////////////////////////////// |
11 | ||
12 | #ifndef _WX_CLIPBRD_H_ | |
13 | #define _WX_CLIPBRD_H_ | |
14 | ||
3399051e | 15 | #if defined(__GNUG__) && !defined(__APPLE__) |
83df96d6 | 16 | #pragma interface "clipbrd.h" |
9b6dbb09 JS |
17 | #endif |
18 | ||
dfe1eee3 | 19 | #if wxUSE_CLIPBOARD |
9b6dbb09 | 20 | |
fd304d98 MB |
21 | class wxDataObject; |
22 | ||
12db77ca | 23 | #include "wx/list.h" |
fd304d98 | 24 | WX_DECLARE_LIST(wxDataObject, wxDataObjectList); |
9b6dbb09 JS |
25 | |
26 | bool WXDLLEXPORT wxOpenClipboard(); | |
27 | bool WXDLLEXPORT wxClipboardOpen(); | |
28 | bool WXDLLEXPORT wxCloseClipboard(); | |
29 | bool WXDLLEXPORT wxEmptyClipboard(); | |
2d120f83 JS |
30 | bool WXDLLEXPORT wxIsClipboardFormatAvailable(wxDataFormat dataFormat); |
31 | bool WXDLLEXPORT wxSetClipboardData(wxDataFormat dataFormat, wxObject *obj, int width = 0, int height = 0); | |
32 | wxObject* WXDLLEXPORT wxGetClipboardData(wxDataFormat dataFormat, long *len = NULL); | |
33 | wxDataFormat WXDLLEXPORT wxEnumClipboardFormats(wxDataFormat dataFormat); | |
34 | wxDataFormat WXDLLEXPORT wxRegisterClipboardFormat(char *formatName); | |
35 | bool WXDLLEXPORT wxGetClipboardFormatName(wxDataFormat dataFormat, char *formatName, int maxCount); | |
36 | ||
37 | //----------------------------------------------------------------------------- | |
38 | // wxClipboard | |
39 | //----------------------------------------------------------------------------- | |
40 | ||
e1ee679c | 41 | class wxClipboard : public wxClipboardBase |
2d120f83 | 42 | { |
2d120f83 | 43 | public: |
e1ee679c VZ |
44 | wxClipboard(); |
45 | ~wxClipboard(); | |
83df96d6 | 46 | |
e1ee679c VZ |
47 | // open the clipboard before SetData() and GetData() |
48 | virtual bool Open(); | |
83df96d6 | 49 | |
e1ee679c VZ |
50 | // close the clipboard after SetData() and GetData() |
51 | virtual void Close(); | |
83df96d6 | 52 | |
12db77ca VZ |
53 | // opened? |
54 | virtual bool IsOpened() const { return m_open; } | |
83df96d6 | 55 | |
12db77ca | 56 | // replaces the data on the clipboard with data |
e1ee679c | 57 | virtual bool SetData( wxDataObject *data ); |
83df96d6 | 58 | |
12db77ca VZ |
59 | // adds data to the clipboard |
60 | virtual bool AddData( wxDataObject *data ); | |
83df96d6 | 61 | |
e1ee679c | 62 | // format available on the clipboard ? |
12db77ca | 63 | virtual bool IsSupported( const wxDataFormat& format ); |
83df96d6 | 64 | |
e1ee679c | 65 | // fill data with data on the clipboard (if available) |
12db77ca | 66 | virtual bool GetData( wxDataObject& data ); |
83df96d6 | 67 | |
e1ee679c VZ |
68 | // clears wxTheClipboard and the system's clipboard if possible |
69 | virtual void Clear(); | |
83df96d6 | 70 | |
dd38c875 | 71 | virtual void UsePrimarySelection(bool primary = true) |
83df96d6 JS |
72 | { m_usePrimary = primary; } |
73 | ||
e1ee679c | 74 | // implementation from now on |
83df96d6 | 75 | |
e1ee679c | 76 | bool m_open; |
fd304d98 | 77 | wxDataObjectList m_data; |
e1ee679c | 78 | bool m_usePrimary; |
83df96d6 | 79 | |
e1ee679c VZ |
80 | private: |
81 | DECLARE_DYNAMIC_CLASS(wxClipboard) | |
2d120f83 JS |
82 | }; |
83 | ||
dfe1eee3 VZ |
84 | #endif // wxUSE_CLIPBOARD |
85 | ||
9b6dbb09 | 86 | #endif |
83df96d6 | 87 | // _WX_CLIPBRD_H_ |