clipbrd.h 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. /////////////////////////////////////////////////////////////////////////////
  2. // Name: wx/osx/clipbrd.h
  3. // Purpose: Clipboard functionality.
  4. // Author: Stefan Csomor
  5. // Modified by:
  6. // Created: 1998-01-01
  7. // Copyright: (c) Stefan Csomor
  8. // Licence: wxWindows licence
  9. /////////////////////////////////////////////////////////////////////////////
  10. #ifndef _WX_CLIPBRD_H_
  11. #define _WX_CLIPBRD_H_
  12. #if wxUSE_CLIPBOARD
  13. #include "wx/osx/core/cfref.h"
  14. //-----------------------------------------------------------------------------
  15. // wxClipboard
  16. //-----------------------------------------------------------------------------
  17. class WXDLLIMPEXP_CORE wxClipboard : public wxClipboardBase
  18. {
  19. public:
  20. wxClipboard();
  21. virtual ~wxClipboard();
  22. // open the clipboard before SetData() and GetData()
  23. virtual bool Open();
  24. // close the clipboard after SetData() and GetData()
  25. virtual void Close();
  26. // query whether the clipboard is opened
  27. virtual bool IsOpened() const;
  28. // set the clipboard data. all other formats will be deleted.
  29. virtual bool SetData( wxDataObject *data );
  30. // add to the clipboard data.
  31. virtual bool AddData( wxDataObject *data );
  32. // ask if data in correct format is available
  33. virtual bool IsSupported( const wxDataFormat& format );
  34. // fill data with data on the clipboard (if available)
  35. virtual bool GetData( wxDataObject& data );
  36. // clears wxTheClipboard and the system's clipboard if possible
  37. virtual void Clear();
  38. // flushes the clipboard: this means that the data which is currently on
  39. // clipboard will stay available even after the application exits (possibly
  40. // eating memory), otherwise the clipboard will be emptied on exit
  41. virtual bool Flush();
  42. private:
  43. wxDataObject *m_data;
  44. bool m_open;
  45. wxCFRef<PasteboardRef> m_pasteboard;
  46. DECLARE_DYNAMIC_CLASS(wxClipboard)
  47. };
  48. #endif // wxUSE_CLIPBOARD
  49. #endif // _WX_CLIPBRD_H_