2002-02-05 11:34:33 -05:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
2007-03-30 22:57:55 -04:00
|
|
|
// Name: wx/x11/clipbrd.h
|
2002-02-05 11:34:33 -05:00
|
|
|
// Purpose: Clipboard functionality.
|
2002-02-23 16:26:16 -05:00
|
|
|
// Author: Robert Roebling
|
2002-02-05 11:34:33 -05:00
|
|
|
// Created: 17/09/98
|
|
|
|
// RCS-ID: $Id$
|
2002-02-23 16:26:16 -05:00
|
|
|
// Copyright: (c) Robert Roebling
|
2004-05-23 16:53:33 -04:00
|
|
|
// Licence: wxWindows licence
|
2002-02-05 11:34:33 -05:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2007-03-30 22:57:55 -04:00
|
|
|
#ifndef _WX_X11_CLIPBRD_H_
|
|
|
|
#define _WX_X11_CLIPBRD_H_
|
2002-02-05 11:34:33 -05:00
|
|
|
|
|
|
|
#if wxUSE_CLIPBOARD
|
|
|
|
|
2002-02-23 16:26:16 -05:00
|
|
|
#include "wx/object.h"
|
2002-02-05 11:34:33 -05:00
|
|
|
#include "wx/list.h"
|
2002-02-23 16:26:16 -05:00
|
|
|
#include "wx/dataobj.h"
|
|
|
|
#include "wx/control.h"
|
|
|
|
#include "wx/module.h"
|
2002-02-05 11:34:33 -05:00
|
|
|
|
2002-02-23 16:26:16 -05:00
|
|
|
// ----------------------------------------------------------------------------
|
2002-02-05 11:34:33 -05:00
|
|
|
// wxClipboard
|
2002-02-23 16:26:16 -05:00
|
|
|
// ----------------------------------------------------------------------------
|
2002-02-05 11:34:33 -05:00
|
|
|
|
2005-08-02 14:16:51 -04:00
|
|
|
class WXDLLIMPEXP_CORE wxClipboard : public wxClipboardBase
|
2002-02-05 11:34:33 -05:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
wxClipboard();
|
2006-09-05 16:47:48 -04:00
|
|
|
virtual ~wxClipboard();
|
2002-02-23 16:26:16 -05:00
|
|
|
|
2002-02-05 11:34:33 -05:00
|
|
|
// open the clipboard before SetData() and GetData()
|
|
|
|
virtual bool Open();
|
2002-02-23 16:26:16 -05:00
|
|
|
|
2002-02-05 11:34:33 -05:00
|
|
|
// close the clipboard after SetData() and GetData()
|
|
|
|
virtual void Close();
|
2002-02-23 16:26:16 -05:00
|
|
|
|
|
|
|
// query whether the clipboard is opened
|
|
|
|
virtual bool IsOpened() const;
|
|
|
|
|
|
|
|
// set the clipboard data. all other formats will be deleted.
|
2002-02-05 11:34:33 -05:00
|
|
|
virtual bool SetData( wxDataObject *data );
|
2002-02-23 16:26:16 -05:00
|
|
|
|
|
|
|
// add to the clipboard data.
|
2002-02-05 11:34:33 -05:00
|
|
|
virtual bool AddData( wxDataObject *data );
|
2002-02-23 16:26:16 -05:00
|
|
|
|
|
|
|
// ask if data in correct format is available
|
2002-02-05 11:34:33 -05:00
|
|
|
virtual bool IsSupported( const wxDataFormat& format );
|
2002-02-23 16:26:16 -05:00
|
|
|
|
2002-02-05 11:34:33 -05:00
|
|
|
// fill data with data on the clipboard (if available)
|
|
|
|
virtual bool GetData( wxDataObject& data );
|
2002-02-23 16:26:16 -05:00
|
|
|
|
2002-02-05 11:34:33 -05:00
|
|
|
// clears wxTheClipboard and the system's clipboard if possible
|
|
|
|
virtual void Clear();
|
2002-02-23 16:26:16 -05:00
|
|
|
|
2002-02-05 11:34:33 -05:00
|
|
|
// implementation from now on
|
|
|
|
bool m_open;
|
2002-02-23 16:26:16 -05:00
|
|
|
bool m_ownsClipboard;
|
|
|
|
bool m_ownsPrimarySelection;
|
|
|
|
wxDataObject *m_data;
|
|
|
|
|
|
|
|
WXWindow m_clipboardWidget; /* for getting and offering data */
|
|
|
|
WXWindow m_targetsWidget; /* for getting list of supported formats */
|
|
|
|
bool m_waiting; /* querying data or formats is asynchronous */
|
|
|
|
|
|
|
|
bool m_formatSupported;
|
|
|
|
Atom m_targetRequested;
|
|
|
|
wxDataObject *m_receivedData;
|
|
|
|
|
2002-02-05 11:34:33 -05:00
|
|
|
private:
|
|
|
|
DECLARE_DYNAMIC_CLASS(wxClipboard)
|
|
|
|
};
|
|
|
|
|
2007-03-30 22:57:55 -04:00
|
|
|
#endif // wxUSE_CLIPBOARD
|
2002-02-05 11:34:33 -05:00
|
|
|
|
2007-03-30 22:57:55 -04:00
|
|
|
#endif // _WX_X11_CLIPBRD_H_
|