You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Clipboard.h 1.8KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. /* Copyright (C) 2002-2005 RealVNC Ltd. All Rights Reserved.
  2. * Copyright 2016-2019 Pierre Ossman for Cendio AB
  3. *
  4. * This is free software; you can redistribute it and/or modify
  5. * it under the terms of the GNU General Public License as published by
  6. * the Free Software Foundation; either version 2 of the License, or
  7. * (at your option) any later version.
  8. *
  9. * This software is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU General Public License
  15. * along with this software; if not, write to the Free Software
  16. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
  17. * USA.
  18. */
  19. // -=- Clipboard.h
  20. //
  21. // The Clipboard is used to set the system clipboard, and to get callbacks
  22. // when the system clipboard has changed.
  23. #ifndef __RFB_WIN32_CLIPBOARD_H__
  24. #define __RFB_WIN32_CLIPBOARD_H__
  25. #include <rfb/SDesktop.h>
  26. #include <rfb_win32/MsgWindow.h>
  27. #include <rfb_win32/DeviceFrameBuffer.h>
  28. namespace rfb {
  29. namespace win32 {
  30. class Clipboard : MsgWindow {
  31. public:
  32. // -=- Abstract base class for callback recipients
  33. class Notifier {
  34. public:
  35. virtual void notifyClipboardChanged(const char* text) = 0;
  36. virtual ~Notifier() {};
  37. };
  38. Clipboard();
  39. ~Clipboard();
  40. // - Set the notifier to use
  41. void setNotifier(Notifier* cbn) {notifier = cbn;}
  42. // - Set the clipboard contents
  43. void setClipText(const char* text);
  44. protected:
  45. // - Internal MsgWindow callback
  46. virtual LRESULT processMessage(UINT msg, WPARAM wParam, LPARAM lParam);
  47. Notifier* notifier;
  48. HWND next_window;
  49. };
  50. };
  51. };
  52. #endif // __RFB_WIN32_CLIPBOARD_H__