1998-05-20 10:12:05 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
1999-10-20 20:25:42 -04:00
|
|
|
// Name: wx/msw/clipbrd.h
|
|
|
|
// Purpose: wxClipboad class and clipboard functions for MSW
|
1998-05-20 10:12:05 -04:00
|
|
|
// Author: Julian Smart
|
|
|
|
// Modified by:
|
|
|
|
// Created: 01/02/97
|
1998-08-07 19:52:45 -04:00
|
|
|
// Copyright: (c) Julian Smart
|
2004-05-23 16:53:33 -04:00
|
|
|
// Licence: wxWindows licence
|
1998-05-20 10:12:05 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
1998-08-07 19:52:45 -04:00
|
|
|
#ifndef _WX_CLIPBRD_H_
|
|
|
|
#define _WX_CLIPBRD_H_
|
1998-05-20 10:12:05 -04:00
|
|
|
|
1998-09-25 09:28:52 -04:00
|
|
|
#if wxUSE_CLIPBOARD
|
1998-05-20 10:12:05 -04:00
|
|
|
|
1999-02-06 18:25:47 -05:00
|
|
|
// These functions superceded by wxClipboard, but retained in order to
|
2004-06-21 06:13:18 -04:00
|
|
|
// implement wxClipboard, and for compatibility.
|
1999-02-06 18:25:47 -05:00
|
|
|
|
|
|
|
// open/close the clipboard
|
2008-03-26 11:06:00 -04:00
|
|
|
WXDLLIMPEXP_CORE bool wxOpenClipboard();
|
|
|
|
WXDLLIMPEXP_CORE bool wxIsClipboardOpened();
|
1999-02-06 18:25:47 -05:00
|
|
|
#define wxClipboardOpen wxIsClipboardOpened
|
2008-03-26 11:06:00 -04:00
|
|
|
WXDLLIMPEXP_CORE bool wxCloseClipboard();
|
1999-02-06 18:25:47 -05:00
|
|
|
|
|
|
|
// get/set data
|
2008-03-26 11:06:00 -04:00
|
|
|
WXDLLIMPEXP_CORE bool wxEmptyClipboard();
|
2017-05-31 18:38:08 -04:00
|
|
|
#if !wxUSE_OLE
|
2008-03-26 11:06:00 -04:00
|
|
|
WXDLLIMPEXP_CORE bool wxSetClipboardData(wxDataFormat dataFormat,
|
1999-02-06 18:25:47 -05:00
|
|
|
const void *data,
|
|
|
|
int width = 0, int height = 0);
|
2017-05-31 18:38:08 -04:00
|
|
|
#endif // !wxUSE_OLE
|
1999-02-06 18:25:47 -05:00
|
|
|
|
|
|
|
// clipboard formats
|
2008-03-26 11:06:00 -04:00
|
|
|
WXDLLIMPEXP_CORE bool wxIsClipboardFormatAvailable(wxDataFormat dataFormat);
|
|
|
|
WXDLLIMPEXP_CORE wxDataFormat wxEnumClipboardFormats(wxDataFormat dataFormat);
|
|
|
|
WXDLLIMPEXP_CORE int wxRegisterClipboardFormat(wxChar *formatName);
|
|
|
|
WXDLLIMPEXP_CORE bool wxGetClipboardFormatName(wxDataFormat dataFormat,
|
1999-06-10 14:12:13 -04:00
|
|
|
wxChar *formatName,
|
1999-02-06 18:25:47 -05:00
|
|
|
int maxCount);
|
1998-05-20 10:12:05 -04:00
|
|
|
|
1999-01-13 13:01:39 -05:00
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// wxClipboard
|
|
|
|
//-----------------------------------------------------------------------------
|
1998-05-20 10:12:05 -04:00
|
|
|
|
2008-03-26 11:06:00 -04:00
|
|
|
class WXDLLIMPEXP_CORE wxClipboard : public wxClipboardBase
|
1998-05-20 10:12:05 -04:00
|
|
|
{
|
1999-01-13 13:01:39 -05:00
|
|
|
public:
|
1999-02-06 18:25:47 -05:00
|
|
|
wxClipboard();
|
2006-09-05 16:47:48 -04:00
|
|
|
virtual ~wxClipboard();
|
1999-02-06 18:25:47 -05:00
|
|
|
|
|
|
|
// open the clipboard before SetData() and GetData()
|
2016-09-23 10:59:11 -04:00
|
|
|
virtual bool Open() wxOVERRIDE;
|
1999-02-06 18:25:47 -05:00
|
|
|
|
|
|
|
// close the clipboard after SetData() and GetData()
|
2016-09-23 10:59:11 -04:00
|
|
|
virtual void Close() wxOVERRIDE;
|
1999-02-06 18:25:47 -05:00
|
|
|
|
1999-10-21 09:56:34 -04:00
|
|
|
// query whether the clipboard is opened
|
2016-09-23 10:59:11 -04:00
|
|
|
virtual bool IsOpened() const wxOVERRIDE;
|
1999-10-21 09:56:34 -04:00
|
|
|
|
1999-02-06 18:25:47 -05:00
|
|
|
// set the clipboard data. all other formats will be deleted.
|
2016-09-23 10:59:11 -04:00
|
|
|
virtual bool SetData( wxDataObject *data ) wxOVERRIDE;
|
1999-02-06 18:25:47 -05:00
|
|
|
|
|
|
|
// add to the clipboard data.
|
2016-09-23 10:59:11 -04:00
|
|
|
virtual bool AddData( wxDataObject *data ) wxOVERRIDE;
|
1999-02-06 18:25:47 -05:00
|
|
|
|
|
|
|
// ask if data in correct format is available
|
2016-09-23 10:59:11 -04:00
|
|
|
virtual bool IsSupported( const wxDataFormat& format ) wxOVERRIDE;
|
1999-02-06 18:25:47 -05:00
|
|
|
|
|
|
|
// fill data with data on the clipboard (if available)
|
2016-09-23 10:59:11 -04:00
|
|
|
virtual bool GetData( wxDataObject& data ) wxOVERRIDE;
|
1999-02-06 18:25:47 -05:00
|
|
|
|
|
|
|
// clears wxTheClipboard and the system's clipboard if possible
|
2016-09-23 10:59:11 -04:00
|
|
|
virtual void Clear() wxOVERRIDE;
|
1999-10-17 20:08:40 -04:00
|
|
|
|
|
|
|
// flushes the clipboard: this means that the data which is currently on
|
|
|
|
// clipboard will stay available even after the application exits (possibly
|
|
|
|
// eating memory), otherwise the clipboard will be emptied on exit
|
2016-09-23 10:59:11 -04:00
|
|
|
virtual bool Flush() wxOVERRIDE;
|
1999-10-17 20:08:40 -04:00
|
|
|
|
|
|
|
private:
|
2006-03-09 08:59:31 -05:00
|
|
|
IDataObject *m_lastDataObject;
|
2003-05-02 13:48:17 -04:00
|
|
|
bool m_isOpened;
|
2009-07-20 19:54:08 -04:00
|
|
|
|
2015-04-23 07:49:01 -04:00
|
|
|
wxDECLARE_DYNAMIC_CLASS(wxClipboard);
|
1998-05-20 10:12:05 -04:00
|
|
|
};
|
|
|
|
|
1998-09-25 09:28:52 -04:00
|
|
|
#endif // wxUSE_CLIPBOARD
|
2007-03-30 22:57:55 -04:00
|
|
|
|
|
|
|
#endif // _WX_CLIPBRD_H_
|