1998-11-02 09:12:29 -05:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
2006-01-22 21:28:01 -05:00
|
|
|
// Name: wx/gtk1/clipboard.h
|
1998-11-02 09:12:29 -05:00
|
|
|
// Purpose:
|
|
|
|
// Author: Robert Roebling
|
|
|
|
// Id: $Id$
|
|
|
|
// Copyright: (c) 1998 Robert Roebling
|
2004-05-23 16:53:33 -04:00
|
|
|
// Licence: wxWindows licence
|
1998-11-02 09:12:29 -05:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef __GTKCLIPBOARDH__
|
|
|
|
#define __GTKCLIPBOARDH__
|
|
|
|
|
1999-01-06 16:09:17 -05:00
|
|
|
#if wxUSE_CLIPBOARD
|
1999-01-04 08:52:06 -05:00
|
|
|
|
1998-11-02 09:12:29 -05:00
|
|
|
#include "wx/object.h"
|
|
|
|
#include "wx/list.h"
|
1998-12-14 11:13:49 -05:00
|
|
|
#include "wx/dataobj.h"
|
1998-11-02 09:12:29 -05:00
|
|
|
#include "wx/control.h"
|
1998-12-08 03:40:00 -05:00
|
|
|
#include "wx/module.h"
|
1998-11-02 09:12:29 -05:00
|
|
|
|
1999-10-20 20:25:42 -04:00
|
|
|
// ----------------------------------------------------------------------------
|
1998-11-02 09:12:29 -05:00
|
|
|
// wxClipboard
|
1999-10-20 20:25:42 -04:00
|
|
|
// ----------------------------------------------------------------------------
|
1998-11-02 09:12:29 -05:00
|
|
|
|
2005-08-02 18:58:06 -04:00
|
|
|
class WXDLLIMPEXP_CORE wxClipboard : public wxClipboardBase
|
1998-11-02 09:12:29 -05:00
|
|
|
{
|
|
|
|
public:
|
1999-02-06 18:25:47 -05:00
|
|
|
wxClipboard();
|
2006-09-05 16:47:48 -04:00
|
|
|
virtual ~wxClipboard();
|
1999-02-06 18:25:47 -05:00
|
|
|
|
|
|
|
// open the clipboard before SetData() and GetData()
|
|
|
|
virtual bool Open();
|
|
|
|
|
|
|
|
// close the clipboard after SetData() and GetData()
|
|
|
|
virtual void Close();
|
|
|
|
|
1999-10-21 09:56:34 -04:00
|
|
|
// query whether the clipboard is opened
|
|
|
|
virtual bool IsOpened() const;
|
|
|
|
|
1999-02-06 18:25:47 -05:00
|
|
|
// 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
|
1999-10-20 20:25:42 -04:00
|
|
|
virtual bool IsSupported( const wxDataFormat& format );
|
1999-02-06 18:25:47 -05:00
|
|
|
|
|
|
|
// fill data with data on the clipboard (if available)
|
1999-10-20 20:25:42 -04:00
|
|
|
virtual bool GetData( wxDataObject& data );
|
1999-02-06 18:25:47 -05:00
|
|
|
|
|
|
|
// clears wxTheClipboard and the system's clipboard if possible
|
|
|
|
virtual void Clear();
|
|
|
|
|
1999-10-20 20:25:42 -04:00
|
|
|
// If primary == TRUE, use primary selection in all further ops,
|
|
|
|
// primary == FALSE resets it.
|
|
|
|
virtual void UsePrimarySelection(bool primary = TRUE)
|
|
|
|
{ m_usePrimary = primary; }
|
2006-01-22 21:28:01 -05:00
|
|
|
|
1999-10-20 20:25:42 -04:00
|
|
|
// implementation from now on
|
1999-02-06 18:25:47 -05:00
|
|
|
bool m_open;
|
|
|
|
bool m_ownsClipboard;
|
|
|
|
bool m_ownsPrimarySelection;
|
1999-10-18 18:22:56 -04:00
|
|
|
wxDataObject *m_data;
|
1999-02-06 18:25:47 -05:00
|
|
|
|
1999-04-09 14:01:17 -04:00
|
|
|
GtkWidget *m_clipboardWidget; /* for getting and offering data */
|
|
|
|
GtkWidget *m_targetsWidget; /* for getting list of supported formats */
|
|
|
|
bool m_waiting; /* querying data or formats is asynchronous */
|
1999-02-06 18:25:47 -05:00
|
|
|
|
|
|
|
bool m_formatSupported;
|
|
|
|
GdkAtom m_targetRequested;
|
1999-06-10 13:13:56 -04:00
|
|
|
bool m_usePrimary;
|
1999-10-20 20:25:42 -04:00
|
|
|
wxDataObject *m_receivedData;
|
1998-12-08 03:40:00 -05:00
|
|
|
|
1999-10-11 06:05:36 -04:00
|
|
|
private:
|
1999-10-20 20:25:42 -04:00
|
|
|
DECLARE_DYNAMIC_CLASS(wxClipboard)
|
1998-11-02 09:12:29 -05:00
|
|
|
};
|
|
|
|
|
1999-01-04 08:52:06 -05:00
|
|
|
#endif
|
|
|
|
// wxUSE_CLIPBOARD
|
1998-12-08 03:40:00 -05:00
|
|
|
|
1998-11-02 09:12:29 -05:00
|
|
|
#endif
|
|
|
|
// __GTKCLIPBOARDH__
|