1 /*
2  * synergy -- mouse and keyboard sharing utility
3  * Copyright (C) 2012-2016 Symless Ltd.
4  * Copyright (C) 2004 Chris Schoeneman
5  *
6  * This package is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License
8  * found in the file LICENSE that should have accompanied this file.
9  *
10  * This package is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
17  */
18 
19 #pragma once
20 
21 #include "platform/XWindowsClipboard.h"
22 
23 //! Convert to/from some text encoding
24 class XWindowsClipboardAnyBitmapConverter :
25                 public IXWindowsClipboardConverter {
26 public:
27     XWindowsClipboardAnyBitmapConverter();
28     virtual ~XWindowsClipboardAnyBitmapConverter();
29 
30     // IXWindowsClipboardConverter overrides
31     virtual IClipboard::EFormat
32                         getFormat() const;
33     virtual Atom        getAtom() const = 0;
34     virtual int            getDataSize() const;
35     virtual String        fromIClipboard(const String&) const;
36     virtual String        toIClipboard(const String&) const;
37 
38 protected:
39     //! Convert from IClipboard format
40     /*!
41     Convert raw BGR pixel data to another image format.
42     */
43     virtual String        doBGRFromIClipboard(const UInt8* bgrData,
44                             UInt32 w, UInt32 h) const = 0;
45 
46     //! Convert from IClipboard format
47     /*!
48     Convert raw BGRA pixel data to another image format.
49     */
50     virtual String        doBGRAFromIClipboard(const UInt8* bgrData,
51                             UInt32 w, UInt32 h) const = 0;
52 
53     //! Convert to IClipboard format
54     /*!
55     Convert an image into raw BGR or BGRA image data and store the
56     width, height, and image depth (24 or 32).
57     */
58     virtual String        doToIClipboard(const String&,
59                             UInt32& w, UInt32& h, UInt32& depth) const = 0;
60 };
61