1998-09-18 06:19:10 -04: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 08:34:18 -04:00
|
|
|
// Licence: wxWindows licence
|
1998-09-18 06:19:10 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#ifndef _WX_CLIPBRD_H_
|
|
|
|
#define _WX_CLIPBRD_H_
|
|
|
|
|
|
|
|
#ifdef __GNUG__
|
2002-02-05 11:34:33 -05:00
|
|
|
#pragma interface "clipbrd.h"
|
1998-09-18 06:19:10 -04:00
|
|
|
#endif
|
|
|
|
|
1999-06-29 08:34:18 -04:00
|
|
|
#if wxUSE_CLIPBOARD
|
1998-09-18 06:19:10 -04:00
|
|
|
|
1999-10-21 16:16:53 -04:00
|
|
|
#include "wx/list.h"
|
1998-09-18 06:19:10 -04:00
|
|
|
|
|
|
|
bool WXDLLEXPORT wxOpenClipboard();
|
|
|
|
bool WXDLLEXPORT wxClipboardOpen();
|
|
|
|
bool WXDLLEXPORT wxCloseClipboard();
|
|
|
|
bool WXDLLEXPORT wxEmptyClipboard();
|
1999-01-14 10:15:39 -05: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-20 20:25:42 -04:00
|
|
|
class wxClipboard : public wxClipboardBase
|
1999-01-14 10:15:39 -05:00
|
|
|
{
|
|
|
|
public:
|
1999-10-20 20:25:42 -04:00
|
|
|
wxClipboard();
|
|
|
|
~wxClipboard();
|
2002-02-05 11:34:33 -05:00
|
|
|
|
1999-10-20 20:25:42 -04:00
|
|
|
// open the clipboard before SetData() and GetData()
|
|
|
|
virtual bool Open();
|
2002-02-05 11:34:33 -05:00
|
|
|
|
1999-10-20 20:25:42 -04:00
|
|
|
// close the clipboard after SetData() and GetData()
|
|
|
|
virtual void Close();
|
2002-02-05 11:34:33 -05:00
|
|
|
|
1999-10-21 16:16:53 -04:00
|
|
|
// opened?
|
|
|
|
virtual bool IsOpened() const { return m_open; }
|
2002-02-05 11:34:33 -05:00
|
|
|
|
1999-10-21 16:16:53 -04:00
|
|
|
// replaces the data on the clipboard with data
|
1999-10-20 20:25:42 -04:00
|
|
|
virtual bool SetData( wxDataObject *data );
|
2002-02-05 11:34:33 -05:00
|
|
|
|
1999-10-21 16:16:53 -04:00
|
|
|
// adds data to the clipboard
|
|
|
|
virtual bool AddData( wxDataObject *data );
|
2002-02-05 11:34:33 -05:00
|
|
|
|
1999-10-20 20:25:42 -04:00
|
|
|
// format available on the clipboard ?
|
1999-10-21 16:16:53 -04:00
|
|
|
virtual bool IsSupported( const wxDataFormat& format );
|
2002-02-05 11:34:33 -05:00
|
|
|
|
1999-10-20 20:25:42 -04:00
|
|
|
// fill data with data on the clipboard (if available)
|
1999-10-21 16:16:53 -04:00
|
|
|
virtual bool GetData( wxDataObject& data );
|
2002-02-05 11:34:33 -05:00
|
|
|
|
1999-10-20 20:25:42 -04:00
|
|
|
// clears wxTheClipboard and the system's clipboard if possible
|
|
|
|
virtual void Clear();
|
2002-02-05 11:34:33 -05:00
|
|
|
|
1999-10-21 16:16:53 -04:00
|
|
|
virtual void UsePrimarySelection(bool primary = TRUE)
|
2002-02-05 11:34:33 -05:00
|
|
|
{ m_usePrimary = primary; }
|
|
|
|
|
1999-10-20 20:25:42 -04:00
|
|
|
// implementation from now on
|
2002-02-05 11:34:33 -05:00
|
|
|
|
1999-10-20 20:25:42 -04:00
|
|
|
bool m_open;
|
|
|
|
wxList m_data;
|
|
|
|
bool m_usePrimary;
|
2002-02-05 11:34:33 -05:00
|
|
|
|
1999-10-20 20:25:42 -04:00
|
|
|
private:
|
|
|
|
DECLARE_DYNAMIC_CLASS(wxClipboard)
|
1999-01-14 10:15:39 -05:00
|
|
|
};
|
|
|
|
|
1999-06-29 08:34:18 -04:00
|
|
|
#endif // wxUSE_CLIPBOARD
|
|
|
|
|
1998-09-18 06:19:10 -04:00
|
|
|
#endif
|
2002-02-05 11:34:33 -05:00
|
|
|
// _WX_CLIPBRD_H_
|