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