clipbrd.h 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. /////////////////////////////////////////////////////////////////////////////
  2. // Name: wx/x11/clipbrd.h
  3. // Purpose: Clipboard functionality.
  4. // Author: Robert Roebling
  5. // Created: 17/09/98
  6. // Copyright: (c) Robert Roebling
  7. // Licence: wxWindows licence
  8. /////////////////////////////////////////////////////////////////////////////
  9. #ifndef _WX_X11_CLIPBRD_H_
  10. #define _WX_X11_CLIPBRD_H_
  11. #if wxUSE_CLIPBOARD
  12. #include "wx/object.h"
  13. #include "wx/list.h"
  14. #include "wx/dataobj.h"
  15. #include "wx/control.h"
  16. #include "wx/module.h"
  17. // ----------------------------------------------------------------------------
  18. // wxClipboard
  19. // ----------------------------------------------------------------------------
  20. class WXDLLIMPEXP_CORE wxClipboard : public wxClipboardBase
  21. {
  22. public:
  23. wxClipboard();
  24. virtual ~wxClipboard();
  25. // open the clipboard before SetData() and GetData()
  26. virtual bool Open();
  27. // close the clipboard after SetData() and GetData()
  28. virtual void Close();
  29. // query whether the clipboard is opened
  30. virtual bool IsOpened() const;
  31. // set the clipboard data. all other formats will be deleted.
  32. virtual bool SetData( wxDataObject *data );
  33. // add to the clipboard data.
  34. virtual bool AddData( wxDataObject *data );
  35. // ask if data in correct format is available
  36. virtual bool IsSupported( const wxDataFormat& format );
  37. // fill data with data on the clipboard (if available)
  38. virtual bool GetData( wxDataObject& data );
  39. // clears wxTheClipboard and the system's clipboard if possible
  40. virtual void Clear();
  41. // implementation from now on
  42. bool m_open;
  43. bool m_ownsClipboard;
  44. bool m_ownsPrimarySelection;
  45. wxDataObject *m_data;
  46. WXWindow m_clipboardWidget; /* for getting and offering data */
  47. WXWindow m_targetsWidget; /* for getting list of supported formats */
  48. bool m_waiting; /* querying data or formats is asynchronous */
  49. bool m_formatSupported;
  50. Atom m_targetRequested;
  51. wxDataObject *m_receivedData;
  52. private:
  53. DECLARE_DYNAMIC_CLASS(wxClipboard)
  54. };
  55. #endif // wxUSE_CLIPBOARD
  56. #endif // _WX_X11_CLIPBRD_H_