]> git.saurik.com Git - wxWidgets.git/blame - include/wx/mac/clipbrd.h
slider link fix 2.
[wxWidgets.git] / include / wx / mac / clipbrd.h
CommitLineData
0dbd6262
SC
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
e7549107 22#if wxUSE_CLIPBOARD
0dbd6262
SC
23
24#include "wx/list.h"
e7549107
SC
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;
0dbd6262
SC
58class WXDLLEXPORT wxClipboard : public wxObject
59{
e7549107 60 DECLARE_DYNAMIC_CLASS(wxClipboard)
0dbd6262 61
e7549107
SC
62public:
63 wxClipboard();
64 ~wxClipboard();
0dbd6262 65
e7549107
SC
66 // open the clipboard before SetData() and GetData()
67 virtual bool Open();
0dbd6262 68
e7549107
SC
69 // close the clipboard after SetData() and GetData()
70 virtual void Close();
0dbd6262 71
e7549107
SC
72 // query whether the clipboard is opened
73 virtual bool IsOpened() const;
0dbd6262 74
e7549107
SC
75 // set the clipboard data. all other formats will be deleted.
76 virtual bool SetData( wxDataObject *data );
0dbd6262 77
e7549107
SC
78 // add to the clipboard data.
79 virtual bool AddData( wxDataObject *data );
0dbd6262 80
e7549107
SC
81 // ask if data in correct format is available
82 virtual bool IsSupported( wxDataFormat format );
0dbd6262 83
e7549107
SC
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};
0dbd6262 101
e7549107 102#endif // wxUSE_CLIPBOARD
0dbd6262
SC
103
104#endif
105 // _WX_CLIPBRD_H_