1998-09-18 10:19:10 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: clipbrd.h
|
|
|
|
// Purpose: Clipboard functionality.
|
|
|
|
// Author: Julian Smart
|
|
|
|
// Modified by:
|
|
|
|
// Created: 17/09/98
|
|
|
|
// RCS-ID: $Id$
|
|
|
|
// Copyright: (c) Julian Smart
|
1999-06-29 12:34:18 +00:00
|
|
|
// Licence: wxWindows licence
|
1998-09-18 10:19:10 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#ifndef _WX_CLIPBRD_H_
|
|
|
|
#define _WX_CLIPBRD_H_
|
|
|
|
|
|
|
|
#ifdef __GNUG__
|
2002-02-05 16:34:33 +00:00
|
|
|
#pragma interface "clipbrd.h"
|
1998-09-18 10:19:10 +00:00
|
|
|
#endif
|
|
|
|
|
1999-06-29 12:34:18 +00:00
|
|
|
#if wxUSE_CLIPBOARD
|
1998-09-18 10:19:10 +00:00
|
|
|
|
2003-01-18 13:01:17 +00:00
|
|
|
class wxDataObject;
|
|
|
|
|
1999-10-21 20:16:53 +00:00
|
|
|
#include "wx/list.h"
|
2003-01-18 13:01:17 +00:00
|
|
|
WX_DECLARE_LIST(wxDataObject, wxDataObjectList);
|
1998-09-18 10:19:10 +00:00
|
|
|
|
|
|
|
bool WXDLLEXPORT wxOpenClipboard();
|
|
|
|
bool WXDLLEXPORT wxClipboardOpen();
|
|
|
|
bool WXDLLEXPORT wxCloseClipboard();
|
|
|
|
bool WXDLLEXPORT wxEmptyClipboard();
|
1999-01-14 15:15:39 +00:00
|
|
|
bool WXDLLEXPORT wxIsClipboardFormatAvailable(wxDataFormat dataFormat);
|
|
|
|
bool WXDLLEXPORT wxSetClipboardData(wxDataFormat dataFormat, wxObject *obj, int width = 0, int height = 0);
|
|
|
|
wxObject* WXDLLEXPORT wxGetClipboardData(wxDataFormat dataFormat, long *len = NULL);
|
|
|
|
wxDataFormat WXDLLEXPORT wxEnumClipboardFormats(wxDataFormat dataFormat);
|
|
|
|
wxDataFormat WXDLLEXPORT wxRegisterClipboardFormat(char *formatName);
|
|
|
|
bool WXDLLEXPORT wxGetClipboardFormatName(wxDataFormat dataFormat, char *formatName, int maxCount);
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// wxClipboard
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
1999-10-21 00:25:42 +00:00
|
|
|
class wxClipboard : public wxClipboardBase
|
1999-01-14 15:15:39 +00:00
|
|
|
{
|
|
|
|
public:
|
1999-10-21 00:25:42 +00:00
|
|
|
wxClipboard();
|
|
|
|
~wxClipboard();
|
2002-02-05 16:34:33 +00:00
|
|
|
|
1999-10-21 00:25:42 +00:00
|
|
|
// open the clipboard before SetData() and GetData()
|
|
|
|
virtual bool Open();
|
2002-02-05 16:34:33 +00:00
|
|
|
|
1999-10-21 00:25:42 +00:00
|
|
|
// close the clipboard after SetData() and GetData()
|
|
|
|
virtual void Close();
|
2002-02-05 16:34:33 +00:00
|
|
|
|
1999-10-21 20:16:53 +00:00
|
|
|
// opened?
|
|
|
|
virtual bool IsOpened() const { return m_open; }
|
2002-02-05 16:34:33 +00:00
|
|
|
|
1999-10-21 20:16:53 +00:00
|
|
|
// replaces the data on the clipboard with data
|
1999-10-21 00:25:42 +00:00
|
|
|
virtual bool SetData( wxDataObject *data );
|
2002-02-05 16:34:33 +00:00
|
|
|
|
1999-10-21 20:16:53 +00:00
|
|
|
// adds data to the clipboard
|
|
|
|
virtual bool AddData( wxDataObject *data );
|
2002-02-05 16:34:33 +00:00
|
|
|
|
1999-10-21 00:25:42 +00:00
|
|
|
// format available on the clipboard ?
|
1999-10-21 20:16:53 +00:00
|
|
|
virtual bool IsSupported( const wxDataFormat& format );
|
2002-02-05 16:34:33 +00:00
|
|
|
|
1999-10-21 00:25:42 +00:00
|
|
|
// fill data with data on the clipboard (if available)
|
1999-10-21 20:16:53 +00:00
|
|
|
virtual bool GetData( wxDataObject& data );
|
2002-02-05 16:34:33 +00:00
|
|
|
|
1999-10-21 00:25:42 +00:00
|
|
|
// clears wxTheClipboard and the system's clipboard if possible
|
|
|
|
virtual void Clear();
|
2002-02-05 16:34:33 +00:00
|
|
|
|
1999-10-21 20:16:53 +00:00
|
|
|
virtual void UsePrimarySelection(bool primary = TRUE)
|
2002-02-05 16:34:33 +00:00
|
|
|
{ m_usePrimary = primary; }
|
|
|
|
|
1999-10-21 00:25:42 +00:00
|
|
|
// implementation from now on
|
2002-02-05 16:34:33 +00:00
|
|
|
|
1999-10-21 00:25:42 +00:00
|
|
|
bool m_open;
|
2003-01-18 13:01:17 +00:00
|
|
|
wxDataObjectList m_data;
|
1999-10-21 00:25:42 +00:00
|
|
|
bool m_usePrimary;
|
2002-02-05 16:34:33 +00:00
|
|
|
|
1999-10-21 00:25:42 +00:00
|
|
|
private:
|
|
|
|
DECLARE_DYNAMIC_CLASS(wxClipboard)
|
1999-01-14 15:15:39 +00:00
|
|
|
};
|
|
|
|
|
1999-06-29 12:34:18 +00:00
|
|
|
#endif // wxUSE_CLIPBOARD
|
|
|
|
|
1998-09-18 10:19:10 +00:00
|
|
|
#endif
|
2002-02-05 16:34:33 +00:00
|
|
|
// _WX_CLIPBRD_H_
|