1998-11-02 14:12:29 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: clipboard.h
|
|
|
|
// Purpose:
|
|
|
|
// Author: Robert Roebling
|
|
|
|
// Id: $Id$
|
|
|
|
// Copyright: (c) 1998 Robert Roebling
|
1999-02-06 23:25:47 +00:00
|
|
|
// Licence: wxWindows licence
|
1998-11-02 14:12:29 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef __GTKCLIPBOARDH__
|
|
|
|
#define __GTKCLIPBOARDH__
|
|
|
|
|
|
|
|
#ifdef __GNUG__
|
|
|
|
#pragma interface
|
|
|
|
#endif
|
|
|
|
|
1999-01-06 21:09:17 +00:00
|
|
|
#if wxUSE_CLIPBOARD
|
1999-01-04 13:52:06 +00:00
|
|
|
|
1998-11-02 14:12:29 +00:00
|
|
|
#include "wx/object.h"
|
|
|
|
#include "wx/list.h"
|
1998-12-14 16:13:49 +00:00
|
|
|
#include "wx/dataobj.h"
|
1998-11-02 14:12:29 +00:00
|
|
|
#include "wx/control.h"
|
1998-12-08 08:40:00 +00:00
|
|
|
#include "wx/module.h"
|
1998-11-02 14:12:29 +00:00
|
|
|
|
1999-10-21 00:25:42 +00:00
|
|
|
// ----------------------------------------------------------------------------
|
1998-11-02 14:12:29 +00:00
|
|
|
// wxClipboard
|
1999-10-21 00:25:42 +00:00
|
|
|
// ----------------------------------------------------------------------------
|
1998-11-02 14:12:29 +00:00
|
|
|
|
1999-10-21 00:25:42 +00:00
|
|
|
class wxClipboard : public wxClipboardBase
|
1998-11-02 14:12:29 +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();
|
|
|
|
|
1999-10-21 13:56:34 +00:00
|
|
|
// query whether the clipboard is opened
|
|
|
|
virtual bool IsOpened() const;
|
|
|
|
|
1999-02-06 23:25:47 +00: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-21 00:25:42 +00:00
|
|
|
virtual bool IsSupported( const wxDataFormat& format );
|
1999-02-06 23:25:47 +00:00
|
|
|
|
|
|
|
// fill data with data on the clipboard (if available)
|
1999-10-21 00:25:42 +00:00
|
|
|
virtual bool GetData( wxDataObject& data );
|
1999-02-06 23:25:47 +00:00
|
|
|
|
|
|
|
// clears wxTheClipboard and the system's clipboard if possible
|
|
|
|
virtual void Clear();
|
|
|
|
|
1999-10-21 00:25:42 +00:00
|
|
|
// If primary == TRUE, use primary selection in all further ops,
|
|
|
|
// primary == FALSE resets it.
|
|
|
|
virtual void UsePrimarySelection(bool primary = TRUE)
|
|
|
|
{ m_usePrimary = primary; }
|
1999-06-10 17:13:56 +00:00
|
|
|
|
1999-10-21 00:25:42 +00:00
|
|
|
// implementation from now on
|
1999-02-06 23:25:47 +00:00
|
|
|
bool m_open;
|
|
|
|
bool m_ownsClipboard;
|
|
|
|
bool m_ownsPrimarySelection;
|
1999-10-18 22:22:56 +00:00
|
|
|
wxDataObject *m_data;
|
1999-02-06 23:25:47 +00:00
|
|
|
|
1999-04-09 18:01:17 +00: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 23:25:47 +00:00
|
|
|
|
|
|
|
bool m_formatSupported;
|
|
|
|
GdkAtom m_targetRequested;
|
1999-06-10 17:13:56 +00:00
|
|
|
bool m_usePrimary;
|
1999-10-21 00:25:42 +00:00
|
|
|
wxDataObject *m_receivedData;
|
1998-12-08 08:40:00 +00:00
|
|
|
|
1999-10-11 10:05:36 +00:00
|
|
|
private:
|
1999-10-21 00:25:42 +00:00
|
|
|
DECLARE_DYNAMIC_CLASS(wxClipboard)
|
1998-11-02 14:12:29 +00:00
|
|
|
};
|
|
|
|
|
1999-01-04 13:52:06 +00:00
|
|
|
#endif
|
|
|
|
// wxUSE_CLIPBOARD
|
1998-12-08 08:40:00 +00:00
|
|
|
|
1998-11-02 14:12:29 +00:00
|
|
|
#endif
|
|
|
|
// __GTKCLIPBOARDH__
|