1998-05-20 14:12:05 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
1999-10-21 00:25:42 +00:00
|
|
|
// Name: wx/msw/clipbrd.h
|
|
|
|
// Purpose: wxClipboad class and clipboard functions for MSW
|
1998-05-20 14:12:05 +00:00
|
|
|
// Author: Julian Smart
|
|
|
|
// Modified by:
|
|
|
|
// Created: 01/02/97
|
|
|
|
// RCS-ID: $Id$
|
1998-08-07 23:52:45 +00:00
|
|
|
// Copyright: (c) Julian Smart
|
2004-05-23 20:53:33 +00:00
|
|
|
// Licence: wxWindows licence
|
1998-05-20 14:12:05 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
1998-08-07 23:52:45 +00:00
|
|
|
#ifndef _WX_CLIPBRD_H_
|
|
|
|
#define _WX_CLIPBRD_H_
|
1998-05-20 14:12:05 +00:00
|
|
|
|
1998-09-25 13:28:52 +00:00
|
|
|
#if wxUSE_CLIPBOARD
|
1998-05-20 14:12:05 +00:00
|
|
|
|
|
|
|
#include "wx/list.h"
|
1999-01-14 11:23:37 +00:00
|
|
|
#include "wx/module.h"
|
1999-05-26 22:39:42 +00:00
|
|
|
#include "wx/dataobj.h" // for wxDataFormat
|
1998-05-20 14:12:05 +00:00
|
|
|
|
1999-02-06 23:25:47 +00:00
|
|
|
// These functions superceded by wxClipboard, but retained in order to
|
2004-06-21 10:13:18 +00:00
|
|
|
// implement wxClipboard, and for compatibility.
|
1999-02-06 23:25:47 +00:00
|
|
|
|
|
|
|
// open/close the clipboard
|
|
|
|
WXDLLEXPORT bool wxOpenClipboard();
|
|
|
|
WXDLLEXPORT bool wxIsClipboardOpened();
|
|
|
|
#define wxClipboardOpen wxIsClipboardOpened
|
|
|
|
WXDLLEXPORT bool wxCloseClipboard();
|
|
|
|
|
|
|
|
// get/set data
|
|
|
|
WXDLLEXPORT bool wxEmptyClipboard();
|
|
|
|
WXDLLEXPORT bool wxSetClipboardData(wxDataFormat dataFormat,
|
|
|
|
const void *data,
|
|
|
|
int width = 0, int height = 0);
|
|
|
|
WXDLLEXPORT void* wxGetClipboardData(wxDataFormat dataFormat,
|
|
|
|
long *len = NULL);
|
|
|
|
|
|
|
|
// clipboard formats
|
1999-01-13 18:01:39 +00:00
|
|
|
WXDLLEXPORT bool wxIsClipboardFormatAvailable(wxDataFormat dataFormat);
|
|
|
|
WXDLLEXPORT wxDataFormat wxEnumClipboardFormats(wxDataFormat dataFormat);
|
1999-06-10 18:12:13 +00:00
|
|
|
WXDLLEXPORT int wxRegisterClipboardFormat(wxChar *formatName);
|
1999-02-06 23:25:47 +00:00
|
|
|
WXDLLEXPORT bool wxGetClipboardFormatName(wxDataFormat dataFormat,
|
1999-06-10 18:12:13 +00:00
|
|
|
wxChar *formatName,
|
1999-02-06 23:25:47 +00:00
|
|
|
int maxCount);
|
1998-05-20 14:12:05 +00:00
|
|
|
|
1999-01-13 18:01:39 +00:00
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// wxClipboard
|
|
|
|
//-----------------------------------------------------------------------------
|
1998-05-20 14:12:05 +00:00
|
|
|
|
1999-01-13 18:01:39 +00:00
|
|
|
class WXDLLEXPORT wxDataObject;
|
2004-06-21 08:54:35 +00:00
|
|
|
class WXDLLEXPORT wxClipboard : public wxClipboardBase
|
1998-05-20 14:12:05 +00:00
|
|
|
{
|
1999-02-06 23:25:47 +00:00
|
|
|
DECLARE_DYNAMIC_CLASS(wxClipboard)
|
1998-05-20 14:12:05 +00:00
|
|
|
|
1999-01-13 18:01:39 +00:00
|
|
|
public:
|
1999-02-06 23:25:47 +00:00
|
|
|
wxClipboard();
|
2006-09-05 20:47:48 +00:00
|
|
|
virtual ~wxClipboard();
|
1999-02-06 23:25:47 +00:00
|
|
|
|
|
|
|
// open the clipboard before SetData() and GetData()
|
|
|
|
virtual bool Open();
|
|
|
|
|
|
|
|
// close the clipboard after SetData() and GetData()
|
|
|
|
virtual void Close();
|
|
|
|
|
1999-10-21 13:56:34 +00:00
|
|
|
// query whether the clipboard is opened
|
|
|
|
virtual bool IsOpened() const;
|
|
|
|
|
1999-02-06 23:25:47 +00:00
|
|
|
// set the clipboard data. all other formats will be deleted.
|
|
|
|
virtual bool SetData( wxDataObject *data );
|
|
|
|
|
|
|
|
// add to the clipboard data.
|
|
|
|
virtual bool AddData( wxDataObject *data );
|
|
|
|
|
|
|
|
// ask if data in correct format is available
|
2004-06-21 08:54:35 +00:00
|
|
|
virtual bool IsSupported( const wxDataFormat& format );
|
1999-02-06 23:25:47 +00:00
|
|
|
|
|
|
|
// fill data with data on the clipboard (if available)
|
1999-10-22 13:26:45 +00:00
|
|
|
virtual bool GetData( wxDataObject& data );
|
1999-02-06 23:25:47 +00:00
|
|
|
|
|
|
|
// clears wxTheClipboard and the system's clipboard if possible
|
|
|
|
virtual void Clear();
|
1999-10-18 00:08:40 +00: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
|
|
|
|
virtual bool Flush();
|
|
|
|
|
|
|
|
// X11 has two clipboards which get selected by this call. Empty on MSW.
|
2004-08-20 12:03:08 +00:00
|
|
|
void UsePrimarySelection( bool WXUNUSED(primary) = false ) { }
|
1999-10-18 00:08:40 +00:00
|
|
|
|
|
|
|
private:
|
2006-03-09 13:59:31 +00:00
|
|
|
IDataObject *m_lastDataObject;
|
2003-05-02 17:48:17 +00:00
|
|
|
bool m_isOpened;
|
1998-05-20 14:12:05 +00:00
|
|
|
};
|
|
|
|
|
1998-09-25 13:28:52 +00:00
|
|
|
#endif // wxUSE_CLIPBOARD
|
1998-05-20 14:12:05 +00:00
|
|
|
#endif
|
1998-08-07 23:52:45 +00:00
|
|
|
// _WX_CLIPBRD_H_
|