clipbrd.h 2.2 KB

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