2002-02-05 16:34:33 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: clipbrd.h
|
|
|
|
// Purpose: Clipboard functionality.
|
2002-02-23 21:26:16 +00:00
|
|
|
// Author: Robert Roebling
|
2002-02-05 16:34:33 +00:00
|
|
|
// Created: 17/09/98
|
|
|
|
// RCS-ID: $Id$
|
2002-02-23 21:26:16 +00:00
|
|
|
// Copyright: (c) Robert Roebling
|
2004-05-23 20:53:33 +00:00
|
|
|
// Licence: wxWindows licence
|
2002-02-05 16:34:33 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2002-02-23 21:26:16 +00:00
|
|
|
#ifndef __X11CLIPBOARDH__
|
|
|
|
#define __X11CLIPBOARDH__
|
2002-02-05 16:34:33 +00:00
|
|
|
|
2003-08-09 12:38:21 +00:00
|
|
|
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
|
2002-02-23 21:26:16 +00:00
|
|
|
#pragma interface
|
2002-02-05 16:34:33 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#if wxUSE_CLIPBOARD
|
|
|
|
|
2002-02-23 21:26:16 +00:00
|
|
|
#include "wx/object.h"
|
2002-02-05 16:34:33 +00:00
|
|
|
#include "wx/list.h"
|
2002-02-23 21:26:16 +00:00
|
|
|
#include "wx/dataobj.h"
|
|
|
|
#include "wx/control.h"
|
|
|
|
#include "wx/module.h"
|
2002-02-05 16:34:33 +00:00
|
|
|
|
2002-02-23 21:26:16 +00:00
|
|
|
// ----------------------------------------------------------------------------
|
2002-02-05 16:34:33 +00:00
|
|
|
// wxClipboard
|
2002-02-23 21:26:16 +00:00
|
|
|
// ----------------------------------------------------------------------------
|
2002-02-05 16:34:33 +00:00
|
|
|
|
|
|
|
class wxClipboard : public wxClipboardBase
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
wxClipboard();
|
|
|
|
~wxClipboard();
|
2002-02-23 21:26:16 +00:00
|
|
|
|
2002-02-05 16:34:33 +00:00
|
|
|
// open the clipboard before SetData() and GetData()
|
|
|
|
virtual bool Open();
|
2002-02-23 21:26:16 +00:00
|
|
|
|
2002-02-05 16:34:33 +00:00
|
|
|
// close the clipboard after SetData() and GetData()
|
|
|
|
virtual void Close();
|
2002-02-23 21:26:16 +00:00
|
|
|
|
|
|
|
// query whether the clipboard is opened
|
|
|
|
virtual bool IsOpened() const;
|
|
|
|
|
|
|
|
// set the clipboard data. all other formats will be deleted.
|
2002-02-05 16:34:33 +00:00
|
|
|
virtual bool SetData( wxDataObject *data );
|
2002-02-23 21:26:16 +00:00
|
|
|
|
|
|
|
// add to the clipboard data.
|
2002-02-05 16:34:33 +00:00
|
|
|
virtual bool AddData( wxDataObject *data );
|
2002-02-23 21:26:16 +00:00
|
|
|
|
|
|
|
// ask if data in correct format is available
|
2002-02-05 16:34:33 +00:00
|
|
|
virtual bool IsSupported( const wxDataFormat& format );
|
2002-02-23 21:26:16 +00:00
|
|
|
|
2002-02-05 16:34:33 +00:00
|
|
|
// fill data with data on the clipboard (if available)
|
|
|
|
virtual bool GetData( wxDataObject& data );
|
2002-02-23 21:26:16 +00:00
|
|
|
|
2002-02-05 16:34:33 +00:00
|
|
|
// clears wxTheClipboard and the system's clipboard if possible
|
|
|
|
virtual void Clear();
|
2002-02-23 21:26:16 +00:00
|
|
|
|
|
|
|
// If primary == TRUE, use primary selection in all further ops,
|
|
|
|
// primary == FALSE resets it.
|
2002-02-05 16:34:33 +00:00
|
|
|
virtual void UsePrimarySelection(bool primary = TRUE)
|
2002-02-23 21:26:16 +00:00
|
|
|
{ m_usePrimary = primary; }
|
2002-02-05 16:34:33 +00:00
|
|
|
|
|
|
|
// implementation from now on
|
|
|
|
bool m_open;
|
2002-02-23 21:26:16 +00: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;
|
2002-02-05 16:34:33 +00:00
|
|
|
bool m_usePrimary;
|
2002-02-23 21:26:16 +00:00
|
|
|
wxDataObject *m_receivedData;
|
|
|
|
|
2002-02-05 16:34:33 +00:00
|
|
|
private:
|
|
|
|
DECLARE_DYNAMIC_CLASS(wxClipboard)
|
|
|
|
};
|
|
|
|
|
2002-02-23 21:26:16 +00:00
|
|
|
#endif
|
|
|
|
// wxUSE_CLIPBOARD
|
2002-02-05 16:34:33 +00:00
|
|
|
|
|
|
|
#endif
|
2002-02-23 21:26:16 +00:00
|
|
|
// __X11CLIPBOARDH__
|