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
|
|
|
|
// RCS-ID: $Id$
|
1998-08-07 19:52:45 -04:00
|
|
|
// Copyright: (c) Julian Smart
|
1999-02-06 18:25:47 -05: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
|
|
|
|
|
|
|
#ifdef __GNUG__
|
|
|
|
#pragma interface "clipbrd.h"
|
|
|
|
#endif
|
|
|
|
|
1998-09-25 09:28:52 -04:00
|
|
|
#if wxUSE_CLIPBOARD
|
1998-05-20 10:12:05 -04:00
|
|
|
|
|
|
|
#include "wx/list.h"
|
1999-01-14 06:23:37 -05:00
|
|
|
#include "wx/module.h"
|
1999-05-26 18:39:42 -04:00
|
|
|
#include "wx/dataobj.h" // for wxDataFormat
|
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
|
|
|
|
// implement wxClipboard, and for compatibility.
|
|
|
|
|
|
|
|
// 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 13:01:39 -05:00
|
|
|
WXDLLEXPORT bool wxIsClipboardFormatAvailable(wxDataFormat dataFormat);
|
|
|
|
WXDLLEXPORT wxDataFormat wxEnumClipboardFormats(wxDataFormat dataFormat);
|
1999-06-10 14:12:13 -04:00
|
|
|
WXDLLEXPORT int wxRegisterClipboardFormat(wxChar *formatName);
|
1999-02-06 18:25:47 -05:00
|
|
|
WXDLLEXPORT 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
|
|
|
|
1999-01-13 13:01:39 -05:00
|
|
|
class WXDLLEXPORT wxDataObject;
|
1999-02-06 18:25:47 -05:00
|
|
|
class WXDLLEXPORT wxClipboard : public wxObject
|
1998-05-20 10:12:05 -04:00
|
|
|
{
|
1999-02-06 18:25:47 -05:00
|
|
|
DECLARE_DYNAMIC_CLASS(wxClipboard)
|
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();
|
|
|
|
~wxClipboard();
|
|
|
|
|
|
|
|
// open the clipboard before SetData() and GetData()
|
|
|
|
virtual bool Open();
|
|
|
|
|
|
|
|
// close the clipboard after SetData() and GetData()
|
|
|
|
virtual void Close();
|
|
|
|
|
1999-10-21 09:56:34 -04:00
|
|
|
// query whether the clipboard is opened
|
|
|
|
virtual bool IsOpened() const;
|
|
|
|
|
1999-02-06 18:25:47 -05: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
|
|
|
|
virtual bool IsSupported( wxDataFormat format );
|
|
|
|
|
|
|
|
// fill data with data on the clipboard (if available)
|
1999-10-22 09:26:45 -04:00
|
|
|
virtual bool GetData( wxDataObject& data );
|
1999-02-06 18:25:47 -05:00
|
|
|
|
|
|
|
// clears wxTheClipboard and the system's clipboard if possible
|
|
|
|
virtual void Clear();
|
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
|
|
|
|
virtual bool Flush();
|
|
|
|
|
|
|
|
// X11 has two clipboards which get selected by this call. Empty on MSW.
|
1999-07-14 18:55:57 -04:00
|
|
|
void UsePrimarySelection( bool WXUNUSED(primary) = FALSE ) { }
|
1999-10-17 20:08:40 -04:00
|
|
|
|
|
|
|
private:
|
|
|
|
bool m_clearOnExit;
|
1998-05-20 10:12:05 -04:00
|
|
|
};
|
|
|
|
|
1998-09-25 09:28:52 -04:00
|
|
|
#endif // wxUSE_CLIPBOARD
|
1998-05-20 10:12:05 -04:00
|
|
|
#endif
|
1998-08-07 19:52:45 -04:00
|
|
|
// _WX_CLIPBRD_H_
|