]> git.saurik.com Git - wxWidgets.git/blame_incremental - include/wx/motif/clipbrd.h
Derive wxBitmapButton from wxBitmapButtonBase + misc cleanup.
[wxWidgets.git] / include / wx / motif / clipbrd.h
... / ...
CommitLineData
1/////////////////////////////////////////////////////////////////////////////
2// Name: clipbrd.h
3// Purpose: Clipboard functionality.
4// Author: Julian Smart
5// Modified by:
6// Created: 17/09/98
7// RCS-ID: $Id$
8// Copyright: (c) Julian Smart
9// Licence: wxWindows licence
10/////////////////////////////////////////////////////////////////////////////
11
12#ifndef _WX_CLIPBRD_H_
13#define _WX_CLIPBRD_H_
14
15#ifdef __GNUG__
16#pragma interface "clipbrd.h"
17#endif
18
19#if wxUSE_CLIPBOARD
20
21class wxDataObject;
22
23#include "wx/list.h"
24WX_DECLARE_LIST(wxDataObject, wxDataObjectList);
25
26bool WXDLLEXPORT wxOpenClipboard();
27bool WXDLLEXPORT wxClipboardOpen();
28bool WXDLLEXPORT wxCloseClipboard();
29bool WXDLLEXPORT wxEmptyClipboard();
30bool WXDLLEXPORT wxIsClipboardFormatAvailable(wxDataFormat dataFormat);
31bool WXDLLEXPORT wxSetClipboardData(wxDataFormat dataFormat, wxObject *obj, int width = 0, int height = 0);
32wxObject* WXDLLEXPORT wxGetClipboardData(wxDataFormat dataFormat, long *len = NULL);
33wxDataFormat WXDLLEXPORT wxEnumClipboardFormats(wxDataFormat dataFormat);
34wxDataFormat WXDLLEXPORT wxRegisterClipboardFormat(char *formatName);
35bool WXDLLEXPORT wxGetClipboardFormatName(wxDataFormat dataFormat, char *formatName, int maxCount);
36
37//-----------------------------------------------------------------------------
38// wxClipboard
39//-----------------------------------------------------------------------------
40
41class wxClipboard : public wxClipboardBase
42{
43public:
44 wxClipboard();
45 ~wxClipboard();
46
47 // open the clipboard before SetData() and GetData()
48 virtual bool Open();
49
50 // close the clipboard after SetData() and GetData()
51 virtual void Close();
52
53 // opened?
54 virtual bool IsOpened() const { return m_open; }
55
56 // replaces the data on the clipboard with data
57 virtual bool SetData( wxDataObject *data );
58
59 // adds data to the clipboard
60 virtual bool AddData( wxDataObject *data );
61
62 // format available on the clipboard ?
63 virtual bool IsSupported( const wxDataFormat& format );
64
65 // fill data with data on the clipboard (if available)
66 virtual bool GetData( wxDataObject& data );
67
68 // clears wxTheClipboard and the system's clipboard if possible
69 virtual void Clear();
70
71 virtual void UsePrimarySelection(bool primary = TRUE)
72 { m_usePrimary = primary; }
73
74 // implementation from now on
75
76 bool m_open;
77 wxDataObjectList m_data;
78 bool m_usePrimary;
79
80private:
81 DECLARE_DYNAMIC_CLASS(wxClipboard)
82};
83
84#endif // wxUSE_CLIPBOARD
85
86#endif
87// _WX_CLIPBRD_H_