1998-05-20 14:12:05 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: clipbrd.h
|
|
|
|
// Purpose: Clipboard functionality
|
|
|
|
// Author: Julian Smart
|
|
|
|
// Modified by:
|
|
|
|
// Created: 01/02/97
|
|
|
|
// RCS-ID: $Id$
|
1998-08-07 23:52:45 +00:00
|
|
|
// Copyright: (c) Julian Smart
|
|
|
|
// 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
|
|
|
|
|
|
|
#ifdef __GNUG__
|
|
|
|
#pragma interface "clipbrd.h"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include "wx/defs.h"
|
|
|
|
#include "wx/setup.h"
|
|
|
|
|
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"
|
1998-05-20 14:12:05 +00:00
|
|
|
|
1999-01-13 18:01:39 +00:00
|
|
|
// These functions superceded by wxClipboard, but retained in order to implement
|
|
|
|
// wxClipboard, and for compatibility.
|
1998-11-22 22:32:53 +00:00
|
|
|
WXDLLEXPORT bool wxOpenClipboard(void);
|
|
|
|
WXDLLEXPORT bool wxClipboardOpen(void);
|
|
|
|
WXDLLEXPORT bool wxCloseClipboard(void);
|
|
|
|
WXDLLEXPORT bool wxEmptyClipboard(void);
|
1999-01-13 18:01:39 +00:00
|
|
|
WXDLLEXPORT bool wxIsClipboardFormatAvailable(wxDataFormat dataFormat);
|
|
|
|
WXDLLEXPORT bool wxSetClipboardData(wxDataFormat dataFormat, wxObject *obj, int width = 0, int height = 0);
|
|
|
|
WXDLLEXPORT wxObject* wxGetClipboardData(wxDataFormat dataFormat, long *len = NULL);
|
|
|
|
WXDLLEXPORT wxDataFormat wxEnumClipboardFormats(wxDataFormat dataFormat);
|
1998-11-22 22:32:53 +00:00
|
|
|
WXDLLEXPORT int wxRegisterClipboardFormat(char *formatName);
|
1999-01-13 18:01:39 +00:00
|
|
|
WXDLLEXPORT bool wxGetClipboardFormatName(wxDataFormat dataFormat, char *formatName, 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;
|
|
|
|
class WXDLLEXPORT wxClipboard: public wxObject
|
1998-05-20 14:12:05 +00:00
|
|
|
{
|
|
|
|
DECLARE_DYNAMIC_CLASS(wxClipboard)
|
|
|
|
|
1999-01-13 18:01:39 +00:00
|
|
|
public:
|
|
|
|
|
1998-05-20 14:12:05 +00:00
|
|
|
wxClipboard();
|
|
|
|
~wxClipboard();
|
|
|
|
|
1999-01-13 18:01:39 +00:00
|
|
|
// open the clipboard before SetData() and GetData()
|
|
|
|
virtual bool Open();
|
|
|
|
|
|
|
|
// close the clipboard after SetData() and GetData()
|
|
|
|
virtual void Close();
|
|
|
|
|
|
|
|
// can be called several times
|
|
|
|
virtual bool SetData( wxDataObject *data );
|
|
|
|
|
|
|
|
// format available on the clipboard ?
|
|
|
|
// supply ID if private format, the same as wxPrivateDataObject::SetId()
|
|
|
|
virtual bool IsSupportedFormat( wxDataFormat format, const wxString &id = wxEmptyString );
|
|
|
|
|
|
|
|
// fill data with data on the clipboard (if available)
|
|
|
|
virtual bool GetData( wxDataObject *data );
|
|
|
|
|
|
|
|
// clears wxTheClipboard and the system's clipboard if possible
|
|
|
|
virtual void Clear();
|
|
|
|
|
|
|
|
// implementation
|
|
|
|
|
|
|
|
bool m_open;
|
1999-01-14 11:23:37 +00:00
|
|
|
wxList m_data;
|
1998-05-20 14:12:05 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/* The clipboard */
|
1999-01-14 11:23:37 +00:00
|
|
|
WXDLLEXPORT_DATA(extern wxClipboard*) wxTheClipboard;
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// wxClipboardModule
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
class wxClipboardModule: public wxModule
|
|
|
|
{
|
|
|
|
DECLARE_DYNAMIC_CLASS(wxClipboardModule)
|
|
|
|
|
|
|
|
public:
|
|
|
|
wxClipboardModule() {}
|
|
|
|
bool OnInit();
|
|
|
|
void OnExit();
|
|
|
|
};
|
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_
|