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
|
1999-02-06 23:25:47 +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
|
|
|
|
|
|
|
#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"
|
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
|
|
|
|
// 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 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;
|
1999-02-06 23:25:47 +00:00
|
|
|
class WXDLLEXPORT wxClipboard : public wxObject
|
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();
|
|
|
|
~wxClipboard();
|
|
|
|
|
|
|
|
// open the clipboard before SetData() and GetData()
|
|
|
|
virtual bool Open();
|
|
|
|
|
|
|
|
// close the clipboard after SetData() and GetData()
|
|
|
|
virtual void Close();
|
|
|
|
|
|
|
|
// 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)
|
|
|
|
virtual bool GetData( wxDataObject *data );
|
|
|
|
|
|
|
|
// 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.
|
1999-07-14 22:55:57 +00:00
|
|
|
void UsePrimarySelection( bool WXUNUSED(primary) = FALSE ) { }
|
1999-10-18 00:08:40 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
bool m_clearOnExit;
|
1998-05-20 14:12:05 +00:00
|
|
|
};
|
|
|
|
|
1999-02-06 23:25:47 +00:00
|
|
|
// The global clipboard object
|
1999-01-14 11:23:37 +00:00
|
|
|
WXDLLEXPORT_DATA(extern wxClipboard*) wxTheClipboard;
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
1999-02-06 23:25:47 +00:00
|
|
|
// wxClipboardModule: module responsible for initializing the global clipboard
|
|
|
|
// object
|
1999-01-14 11:23:37 +00:00
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
1999-02-06 23:25:47 +00:00
|
|
|
class wxClipboardModule : public wxModule
|
1999-01-14 11:23:37 +00:00
|
|
|
{
|
1999-02-06 23:25:47 +00:00
|
|
|
DECLARE_DYNAMIC_CLASS(wxClipboardModule)
|
|
|
|
|
1999-01-14 11:23:37 +00:00
|
|
|
public:
|
1999-02-06 23:25:47 +00:00
|
|
|
wxClipboardModule() { }
|
|
|
|
|
1999-01-14 11:23:37 +00:00
|
|
|
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_
|