]> git.saurik.com Git - wxWidgets.git/blame - include/wx/gtk/clipbrd.h
Played a little with sockets.
[wxWidgets.git] / include / wx / gtk / 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
26f86486 7// Licence: wxWindows licence
dc86cb34
RR
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
26f86486 45class wxClipboard : public wxObject
dc86cb34 46{
26f86486 47 DECLARE_DYNAMIC_CLASS(wxClipboard)
dc86cb34
RR
48
49public:
26f86486
VZ
50 wxClipboard();
51 ~wxClipboard();
52
53 // open the clipboard before SetData() and GetData()
54 virtual bool Open();
55
56 // close the clipboard after SetData() and GetData()
57 virtual void Close();
58
59 // set the clipboard data. all other formats will be deleted.
60 virtual bool SetData( wxDataObject *data );
61
62 // add to the clipboard data.
63 virtual bool AddData( wxDataObject *data );
64
65 // ask if data in correct format is available
5f699c22 66 virtual bool IsSupported( wxDataFormat format );
26f86486
VZ
67
68 // fill data with data on the clipboard (if available)
5f699c22 69 virtual bool GetData( wxDataObject *data );
26f86486
VZ
70
71 // clears wxTheClipboard and the system's clipboard if possible
72 virtual void Clear();
73
74 // implementation
75
76 bool m_open;
77
78 bool m_ownsClipboard;
79 bool m_ownsPrimarySelection;
80
81 wxDataBroker *m_dataBroker;
034be888
RR
82 GtkWidget *m_clipboardWidget; /* for getting and offering data */
83 GtkWidget *m_targetsWidget; /* for getting list of supported formats */
84 bool m_waiting; /* querying data or formats is asynchronous */
26f86486
VZ
85
86 bool m_formatSupported;
87 GdkAtom m_targetRequested;
88
89 wxDataObject *m_receivedData;
b527aac5
RR
90};
91
92//-----------------------------------------------------------------------------
93// wxClipboardModule
94//-----------------------------------------------------------------------------
95
96class wxClipboardModule: public wxModule
97{
98 DECLARE_DYNAMIC_CLASS(wxClipboardModule)
26f86486 99
b527aac5
RR
100public:
101 wxClipboardModule() {}
102 bool OnInit();
103 void OnExit();
dc86cb34
RR
104};
105
ac57418f
RR
106#endif
107
108 // wxUSE_CLIPBOARD
b527aac5 109
dc86cb34
RR
110#endif
111 // __GTKCLIPBOARDH__