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

COSXClipboard.h

00001 /*
00002  * synergy -- mouse and keyboard sharing utility
00003  * Copyright (C) 2004 Chris Schoeneman
00004  * 
00005  * This package is free software; you can redistribute it and/or
00006  * modify it under the terms of the GNU General Public License
00007  * found in the file COPYING that should have accompanied this file.
00008  * 
00009  * This package is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012  * GNU General Public License for more details.
00013  */
00014 
00015 #ifndef COSXCLIPBOARD_H
00016 #define COSXCLIPBOARD_H
00017 
00018 #include <Carbon/Carbon.h>
00019 #include "IClipboard.h"
00020 #include <vector>
00021 
00022 class IOSXClipboardConverter;
00023 
00025 class COSXClipboard : public IClipboard {
00026 public:
00027     COSXClipboard();
00028     virtual ~COSXClipboard();
00029 
00031     static bool         isOwnedBySynergy();
00032 
00033     // IClipboard overrides
00034     virtual bool        empty();
00035     virtual void        add(EFormat, const CString& data);
00036     virtual bool        open(Time) const;
00037     virtual void        close() const;
00038     virtual Time        getTime() const;
00039     virtual bool        has(EFormat) const;
00040     virtual CString     get(EFormat) const;
00041 
00042     bool                synchronize();
00043 private:
00044     void                clearConverters();
00045 
00046 private:
00047     typedef std::vector<IOSXClipboardConverter*> ConverterList;
00048 
00049     mutable Time        m_time;
00050     ConverterList       m_converters;
00051     PasteboardRef       m_pboard;
00052 };
00053 
00055 
00058 class IOSXClipboardConverter : public IInterface {
00059 public:
00061 
00062 
00064 
00067     virtual IClipboard::EFormat
00068                         getFormat() const = 0;
00069 
00071     virtual CFStringRef
00072                         getOSXFormat() const = 0;
00073 
00075 
00081     virtual CString     fromIClipboard(const CString&) const = 0;
00082 
00084 
00088     virtual CString     toIClipboard(const CString&) const = 0;
00089 
00091 };
00092 
00093 #endif

Generated on Fri Nov 6 00:21:14 2009 for synergy-plus by  doxygen 1.3.9.1