2012-06-10 16:50:54 +00:00
|
|
|
/*
|
2024-09-17 19:00:25 +00:00
|
|
|
* Deskflow -- mouse and keyboard sharing utility
|
2025-01-24 00:11:17 +00:00
|
|
|
* SPDX-FileCopyrightText: (C) 2012 - 2016 Symless Ltd.
|
|
|
|
|
* SPDX-FileCopyrightText: (C) 2002 Chris Schoeneman
|
|
|
|
|
* SPDX-License-Identifier: GPL-2.0-only WITH LicenseRef-OpenSSL-Exception
|
2012-06-10 16:50:54 +00:00
|
|
|
*/
|
|
|
|
|
|
2014-02-28 12:36:45 +00:00
|
|
|
#pragma once
|
2012-06-10 16:50:54 +00:00
|
|
|
|
2014-02-28 12:36:45 +00:00
|
|
|
#include "platform/MSWindowsClipboard.h"
|
2012-06-10 16:50:54 +00:00
|
|
|
|
|
|
|
|
//! Convert to/from some text encoding
|
2024-10-17 18:04:35 +00:00
|
|
|
class MSWindowsClipboardAnyTextConverter : public IMSWindowsClipboardConverter
|
|
|
|
|
{
|
2012-06-10 16:50:54 +00:00
|
|
|
public:
|
2024-07-02 19:07:06 +00:00
|
|
|
MSWindowsClipboardAnyTextConverter();
|
|
|
|
|
virtual ~MSWindowsClipboardAnyTextConverter();
|
2012-06-10 16:50:54 +00:00
|
|
|
|
2024-07-02 19:07:06 +00:00
|
|
|
// IMSWindowsClipboardConverter overrides
|
|
|
|
|
virtual IClipboard::EFormat getFormat() const;
|
|
|
|
|
virtual UINT getWin32Format() const = 0;
|
2025-01-06 00:55:07 +00:00
|
|
|
virtual HANDLE fromIClipboard(const std::string &) const;
|
|
|
|
|
virtual std::string toIClipboard(HANDLE) const;
|
2012-06-10 16:50:54 +00:00
|
|
|
|
|
|
|
|
protected:
|
2024-07-02 19:07:06 +00:00
|
|
|
//! Convert from IClipboard format
|
|
|
|
|
/*!
|
|
|
|
|
Do UTF-8 conversion only. Memory handle allocation and
|
|
|
|
|
linefeed conversion is done by this class. doFromIClipboard()
|
|
|
|
|
must include the nul terminator in the returned string (not
|
2025-01-06 00:55:07 +00:00
|
|
|
including the std::string's nul terminator).
|
2024-07-02 19:07:06 +00:00
|
|
|
*/
|
2025-01-06 00:55:07 +00:00
|
|
|
virtual std::string doFromIClipboard(const std::string &) const = 0;
|
2012-06-10 16:50:54 +00:00
|
|
|
|
2024-07-02 19:07:06 +00:00
|
|
|
//! Convert to IClipboard format
|
|
|
|
|
/*!
|
|
|
|
|
Do UTF-8 conversion only. Memory handle allocation and
|
|
|
|
|
linefeed conversion is done by this class.
|
|
|
|
|
*/
|
2025-01-06 00:55:07 +00:00
|
|
|
virtual std::string doToIClipboard(const std::string &) const = 0;
|
2012-06-10 16:50:54 +00:00
|
|
|
|
|
|
|
|
private:
|
2025-01-06 00:55:07 +00:00
|
|
|
std::string convertLinefeedToWin32(const std::string &) const;
|
|
|
|
|
std::string convertLinefeedToUnix(const std::string &) const;
|
2012-06-10 16:50:54 +00:00
|
|
|
};
|