2002-02-05 11:34:33 -05:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: clipbrd.h
|
|
|
|
// 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
|
2002-02-05 11:34:33 -05:00
|
|
|
// Licence: wxWindows licence
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2002-02-23 16:26:16 -05:00
|
|
|
#ifndef __X11CLIPBOARDH__
|
|
|
|
#define __X11CLIPBOARDH__
|
2002-02-05 11:34:33 -05:00
|
|
|
|
2003-05-11 14:08:58 -04:00
|
|
|
#if defined(__GNUG__) && !defined(__APPLE__)
|
2002-02-23 16:26:16 -05:00
|
|
|
#pragma interface
|
2002-02-05 11:34:33 -05:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#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
|
|
|
|
|
|
|
class wxClipboard : public wxClipboardBase
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
wxClipboard();
|
|
|
|
~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
|
|
|
|
|
|
|
// If primary == TRUE, use primary selection in all further ops,
|
|
|
|
// primary == FALSE resets it.
|
2002-02-05 11:34:33 -05:00
|
|
|
virtual void UsePrimarySelection(bool primary = TRUE)
|
2002-02-23 16:26:16 -05:00
|
|
|
{ m_usePrimary = primary; }
|
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;
|
2002-02-05 11:34:33 -05:00
|
|
|
bool m_usePrimary;
|
2002-02-23 16:26:16 -05:00
|
|
|
wxDataObject *m_receivedData;
|
|
|
|
|
2002-02-05 11:34:33 -05:00
|
|
|
private:
|
|
|
|
DECLARE_DYNAMIC_CLASS(wxClipboard)
|
|
|
|
};
|
|
|
|
|
2002-02-23 16:26:16 -05:00
|
|
|
#endif
|
|
|
|
// wxUSE_CLIPBOARD
|
2002-02-05 11:34:33 -05:00
|
|
|
|
|
|
|
#endif
|
2002-02-23 16:26:16 -05:00
|
|
|
// __X11CLIPBOARDH__
|