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

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