Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members

CMSWindowsClipboard Class Reference

Microsoft windows clipboard implementation. More...

#include <CMSWindowsClipboard.h>

Inherits IClipboard.

Inheritance diagram for CMSWindowsClipboard:

Inheritance graph
[legend]
Collaboration diagram for CMSWindowsClipboard:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 CMSWindowsClipboard (HWND window)
bool emptyUnowned ()
 Empty clipboard without ownership.
virtual bool empty ()
 Empty clipboard.
virtual void add (EFormat, const CString &data)
 Add data.
virtual bool open (Time) const
 Open clipboard.
virtual void close () const
 Close clipboard.
virtual Time getTime () const
 Get time.
virtual bool has (EFormat) const
 Check for data.
virtual CString get (EFormat) const
 Get data.

Static Public Member Functions

bool isOwnedBySynergy ()
 Test if clipboard is owned by synergy.

Detailed Description

Microsoft windows clipboard implementation.

Definition at line 26 of file CMSWindowsClipboard.h.


Member Function Documentation

void CMSWindowsClipboard::add EFormat  ,
const CString &  data
[virtual]
 

Add data.

Add data in the given format to the clipboard. May only be called after a successful empty().

Implements IClipboard.

Definition at line 78 of file CMSWindowsClipboard.cpp.

References IMSWindowsClipboardConverter::fromIClipboard(), IMSWindowsClipboardConverter::getFormat(), and IMSWindowsClipboardConverter::getWin32Format().

void CMSWindowsClipboard::close  )  const [virtual]
 

Close clipboard.

Close the clipboard. close() must match a preceding successful open(). This signals that the clipboard has been filled with all the necessary data or all data has been read. It does not mean the clipboard ownership should be released (if it was taken).

Implements IClipboard.

Definition at line 118 of file CMSWindowsClipboard.cpp.

Referenced by CMSWindowsScreen::setClipboard().

bool CMSWindowsClipboard::empty  )  [virtual]
 

Empty clipboard.

Take ownership of the clipboard and clear all data from it. This must be called between a successful open() and close(). Return false if the clipboard ownership could not be taken; the clipboard should not be emptied in this case.

Implements IClipboard.

Definition at line 64 of file CMSWindowsClipboard.cpp.

References emptyUnowned().

Referenced by CMSWindowsScreen::setClipboard().

bool CMSWindowsClipboard::emptyUnowned  ) 
 

Empty clipboard without ownership.

Take ownership of the clipboard and clear all data from it. This must be called between a successful open() and close(). Return false if the clipboard ownership could not be taken; the clipboard should not be emptied in this case. Unlike empty(), isOwnedBySynergy() will return false when emptied this way. This is useful when synergy wants to put data on clipboard but pretend (to itself) that some other app did it. When using empty(), synergy assumes the data came from the server and doesn't need to be sent back. emptyUnowned() makes synergy send the data to the server.

Definition at line 50 of file CMSWindowsClipboard.cpp.

Referenced by empty().

CString CMSWindowsClipboard::get EFormat   )  const [virtual]
 

Get data.

Return the data in the given format. Returns the empty string if there is no data in that format. Must be called between a successful open() and close().

Implements IClipboard.

Definition at line 146 of file CMSWindowsClipboard.cpp.

References IMSWindowsClipboardConverter::getFormat(), IMSWindowsClipboardConverter::getWin32Format(), and IMSWindowsClipboardConverter::toIClipboard().

IClipboard::Time CMSWindowsClipboard::getTime  )  const [virtual]
 

Get time.

Return the timestamp passed to the last successful open().

Implements IClipboard.

Definition at line 125 of file CMSWindowsClipboard.cpp.

bool CMSWindowsClipboard::has EFormat   )  const [virtual]
 

Check for data.

Return true iff the clipboard contains data in the given format. Must be called between a successful open() and close().

Implements IClipboard.

Definition at line 131 of file CMSWindowsClipboard.cpp.

References IMSWindowsClipboardConverter::getFormat(), and IMSWindowsClipboardConverter::getWin32Format().

bool CMSWindowsClipboard::open Time   )  const [virtual]
 

Open clipboard.

Open the clipboard. Return true iff the clipboard could be opened. If open() returns true then the client must call close() at some later time; if it returns false then close() must not be called. time should be the current time or a time in the past when the open should effectively have taken place.

Implements IClipboard.

Definition at line 103 of file CMSWindowsClipboard.cpp.

Referenced by CMSWindowsScreen::setClipboard().


The documentation for this class was generated from the following files:
Generated on Fri Nov 6 00:21:24 2009 for synergy-plus by  doxygen 1.3.9.1