]> git.saurik.com Git - wxWidgets.git/blame - include/wx/gtk1/clipbrd.h
Various small fixes
[wxWidgets.git] / include / wx / gtk1 / clipbrd.h
CommitLineData
dc86cb34
RR
1/////////////////////////////////////////////////////////////////////////////
2// Name: clipboard.h
3// Purpose:
4// Author: Robert Roebling
5// Id: $Id$
6// Copyright: (c) 1998 Robert Roebling
7// Licence: wxWindows licence
8/////////////////////////////////////////////////////////////////////////////
9
10
11#ifndef __GTKCLIPBOARDH__
12#define __GTKCLIPBOARDH__
13
14#ifdef __GNUG__
15#pragma interface
16#endif
17
18#include "wx/defs.h"
ac57418f 19
06cfab17 20#if wxUSE_CLIPBOARD
ac57418f 21
dc86cb34
RR
22#include "wx/object.h"
23#include "wx/list.h"
8b53e5a2 24#include "wx/dataobj.h"
dc86cb34 25#include "wx/control.h"
b527aac5 26#include "wx/module.h"
dc86cb34
RR
27
28//-----------------------------------------------------------------------------
29// classes
30//-----------------------------------------------------------------------------
31
32class wxClipboard;
b527aac5 33class wxClipboardModule;
dc86cb34
RR
34
35//-----------------------------------------------------------------------------
36// global data
37//-----------------------------------------------------------------------------
38
39extern wxClipboard* wxTheClipboard;
40
41//-----------------------------------------------------------------------------
42// wxClipboard
43//-----------------------------------------------------------------------------
44
b527aac5 45class wxClipboard: public wxObject
dc86cb34
RR
46{
47 DECLARE_DYNAMIC_CLASS(wxClipboard)
48
49public:
50
51 wxClipboard();
52 ~wxClipboard();
53
0d2a2b60 54 /* open the clipboard before SetData() and GetData() */
8b53e5a2 55 virtual bool Open();
b527aac5 56
0d2a2b60 57 /* close the clipboard after SetData() and GetData() */
8b53e5a2 58 virtual void Close();
b527aac5 59
75ce0581
RR
60 /* set the clipboard data. all other formats will be deleted. */
61 virtual bool SetData( wxDataObject *data );
8b53e5a2 62
75ce0581
RR
63 /* add to the clipboard data. */
64 virtual bool AddData( wxDataObject *data );
65
66 /* ask if data in correct format is available */
67 virtual bool IsSupported( wxDataObject &data );
68
0d2a2b60 69 /* fill data with data on the clipboard (if available) */
75ce0581 70 virtual bool GetData( wxDataObject &data );
b527aac5 71
0d2a2b60 72 /* clears wxTheClipboard and the system's clipboard if possible */
b527aac5 73 virtual void Clear();
dc86cb34 74
0d2a2b60 75 /* implementation */
8b53e5a2
RR
76
77 bool m_open;
dc86cb34 78
aeeb6a44
RR
79 bool m_ownsClipboard;
80 bool m_ownsPrimarySelection;
81
0d2a2b60 82 wxDataBroker *m_dataBroker;
b527aac5
RR
83 GtkWidget *m_clipboardWidget;
84
85 bool m_formatSupported;
86 GdkAtom m_targetRequested;
87
8b53e5a2 88 wxDataObject *m_receivedData;
b527aac5
RR
89};
90
91//-----------------------------------------------------------------------------
92// wxClipboardModule
93//-----------------------------------------------------------------------------
94
95class wxClipboardModule: public wxModule
96{
97 DECLARE_DYNAMIC_CLASS(wxClipboardModule)
98
99public:
100 wxClipboardModule() {}
101 bool OnInit();
102 void OnExit();
dc86cb34
RR
103};
104
ac57418f
RR
105#endif
106
107 // wxUSE_CLIPBOARD
b527aac5 108
dc86cb34
RR
109#endif
110 // __GTKCLIPBOARDH__