]> git.saurik.com Git - wxWidgets.git/blame - include/wx/x11/clipbrd.h
fix bug in Eof() which returned true even if we were only on the last line, not beyond it
[wxWidgets.git] / include / wx / x11 / clipbrd.h
CommitLineData
83df96d6
JS
1/////////////////////////////////////////////////////////////////////////////
2// Name: clipbrd.h
3// Purpose: Clipboard functionality.
9691c806 4// Author: Robert Roebling
83df96d6
JS
5// Created: 17/09/98
6// RCS-ID: $Id$
9691c806 7// Copyright: (c) Robert Roebling
65571936 8// Licence: wxWindows licence
83df96d6
JS
9/////////////////////////////////////////////////////////////////////////////
10
9691c806
RR
11#ifndef __X11CLIPBOARDH__
12#define __X11CLIPBOARDH__
83df96d6 13
83df96d6
JS
14#if wxUSE_CLIPBOARD
15
9691c806 16#include "wx/object.h"
83df96d6 17#include "wx/list.h"
9691c806
RR
18#include "wx/dataobj.h"
19#include "wx/control.h"
20#include "wx/module.h"
83df96d6 21
9691c806 22// ----------------------------------------------------------------------------
83df96d6 23// wxClipboard
9691c806 24// ----------------------------------------------------------------------------
83df96d6 25
968eb2ef 26class WXDLLIMPEXP_CORE wxClipboard : public wxClipboardBase
83df96d6
JS
27{
28public:
29 wxClipboard();
30 ~wxClipboard();
9691c806 31
83df96d6
JS
32 // open the clipboard before SetData() and GetData()
33 virtual bool Open();
9691c806 34
83df96d6
JS
35 // close the clipboard after SetData() and GetData()
36 virtual void Close();
9691c806
RR
37
38 // query whether the clipboard is opened
39 virtual bool IsOpened() const;
40
41 // set the clipboard data. all other formats will be deleted.
83df96d6 42 virtual bool SetData( wxDataObject *data );
9691c806
RR
43
44 // add to the clipboard data.
83df96d6 45 virtual bool AddData( wxDataObject *data );
9691c806
RR
46
47 // ask if data in correct format is available
83df96d6 48 virtual bool IsSupported( const wxDataFormat& format );
9691c806 49
83df96d6
JS
50 // fill data with data on the clipboard (if available)
51 virtual bool GetData( wxDataObject& data );
9691c806 52
83df96d6
JS
53 // clears wxTheClipboard and the system's clipboard if possible
54 virtual void Clear();
9691c806
RR
55
56 // If primary == TRUE, use primary selection in all further ops,
57 // primary == FALSE resets it.
83df96d6 58 virtual void UsePrimarySelection(bool primary = TRUE)
9691c806 59 { m_usePrimary = primary; }
83df96d6
JS
60
61 // implementation from now on
83df96d6 62 bool m_open;
9691c806
RR
63 bool m_ownsClipboard;
64 bool m_ownsPrimarySelection;
65 wxDataObject *m_data;
66
67 WXWindow m_clipboardWidget; /* for getting and offering data */
68 WXWindow m_targetsWidget; /* for getting list of supported formats */
69 bool m_waiting; /* querying data or formats is asynchronous */
70
71 bool m_formatSupported;
72 Atom m_targetRequested;
83df96d6 73 bool m_usePrimary;
9691c806
RR
74 wxDataObject *m_receivedData;
75
83df96d6
JS
76private:
77 DECLARE_DYNAMIC_CLASS(wxClipboard)
78};
79
9691c806
RR
80#endif
81 // wxUSE_CLIPBOARD
83df96d6
JS
82
83#endif
9691c806 84 // __X11CLIPBOARDH__