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

IClipboard.h

00001 /*
00002  * synergy -- mouse and keyboard sharing utility
00003  * Copyright (C) 2002 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 ICLIPBOARD_H
00016 #define ICLIPBOARD_H
00017 
00018 #include "IInterface.h"
00019 #include "CString.h"
00020 #include "BasicTypes.h"
00021 
00023 
00026 class IClipboard : public IInterface {
00027 public:
00029 
00034     typedef UInt32 Time;
00035 
00037 
00055     enum EFormat {
00056         kText,          
00057         kBitmap,        
00058         kHTML,          
00059         kNumFormats     
00060     };
00061 
00063 
00064 
00066 
00072     virtual bool        empty() = 0;
00073 
00075 
00079     virtual void        add(EFormat, const CString& data) = 0;
00080 
00082 
00083 
00084 
00086 
00094     virtual bool        open(Time time) const = 0;
00095 
00097 
00104     virtual void        close() const = 0;
00105 
00107 
00110     virtual Time        getTime() const = 0;
00111 
00113 
00117     virtual bool        has(EFormat) const = 0;
00118 
00120 
00125     virtual CString     get(EFormat) const = 0;
00126 
00128 
00132     static CString      marshall(const IClipboard* clipboard);
00133 
00135 
00139     static void         unmarshall(IClipboard* clipboard,
00140                             const CString& data, Time time);
00141 
00143 
00150     static bool         copy(IClipboard* dst, const IClipboard* src);
00151 
00153 
00159     static bool         copy(IClipboard* dst, const IClipboard* src, Time);
00160 
00162 
00163 private:
00164     static UInt32       readUInt32(const char*);
00165     static void         writeUInt32(CString*, UInt32);
00166 };
00167 
00168 #endif

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