MyGUI_ClipboardManager.h
Go to the documentation of this file.
/*
* This source file is part of MyGUI. For the latest info, see http://mygui.info/
* Distributed under the MIT License
* (See accompanying file COPYING.MIT or copy at http://opensource.org/licenses/MIT)
*/
#ifndef MYGUI_CLIPBOARD_MANAGER_H_
#define MYGUI_CLIPBOARD_MANAGER_H_
#include "MyGUI_Prerequest.h"
#include "MyGUI_Singleton.h"
#include "MyGUI_Types.h"
#include "MyGUI_EventPair.h"
#include "MyGUI_UString.h"
namespace MyGUI
{
class WindowsClipboardHandler;
class MYGUI_EXPORT ClipboardManager
{
MYGUI_SINGLETON_DECLARATION(ClipboardManager);
public:
ClipboardManager();
void initialise();
void shutdown();
void setClipboardData(std::string_view _type, std::string_view _data);
void clearClipboardData(std::string_view _type);
std::string getClipboardData(std::string_view _type) const;
/*events:*/
EventPairConvertStringView<
delegates::MultiDelegate<const std::string&, const std::string&>,
delegates::MultiDelegate<std::string_view, std::string_view>>
eventClipboardChanged;
EventPairConvertStringView<
delegates::MultiDelegate<const std::string&, std::string&>,
delegates::MultiDelegate<std::string_view, std::string&>>
eventClipboardRequested;
private:
MapString mClipboardData;
#if MYGUI_PLATFORM == MYGUI_PLATFORM_WIN32
WindowsClipboardHandler* mWindowsClipboardHandler;
#endif
bool mIsInitialise{false};
};
} // namespace MyGUI
#endif // MYGUI_CLIPBOARD_MANAGER_H_
MyGUI_EventPair.h
MYGUI_EXPORT
#define MYGUI_EXPORT
Definition MyGUI_Platform.h:77
MyGUI_Prerequest.h
MyGUI_Singleton.h
MYGUI_SINGLETON_DECLARATION
#define MYGUI_SINGLETON_DECLARATION(ClassName)
Definition MyGUI_Singleton.h:112
MyGUI_Types.h
MyGUI_UString.h
MyGUI::ClipboardManager::getClipboardData
std::string getClipboardData(std::string_view _type) const
Definition MyGUI_ClipboardManager.cpp:72
MyGUI::ClipboardManager::setClipboardData
void setClipboardData(std::string_view _type, std::string_view _data)
Definition MyGUI_ClipboardManager.cpp:57
MyGUI::ClipboardManager::clearClipboardData
void clearClipboardData(std::string_view _type)
Definition MyGUI_ClipboardManager.cpp:64
MyGUI::ClipboardManager::eventClipboardChanged
EventPairConvertStringView< delegates::MultiDelegate< const std::string &, const std::string & >, delegates::MultiDelegate< std::string_view, std::string_view > > eventClipboardChanged
Definition MyGUI_ClipboardManager.h:56
MyGUI::ClipboardManager::ClipboardManager
ClipboardManager(const ClipboardManager &)=delete
MyGUI::ClipboardManager::shutdown
void shutdown()
Definition MyGUI_ClipboardManager.cpp:42
MyGUI::ClipboardManager::initialise
void initialise()
Definition MyGUI_ClipboardManager.cpp:28
MyGUI::ClipboardManager::eventClipboardRequested
EventPairConvertStringView< delegates::MultiDelegate< const std::string &, std::string & >, delegates::MultiDelegate< std::string_view, std::string & > > eventClipboardRequested
Definition MyGUI_ClipboardManager.h:67
MyGUI::EventPairConvertStringView
Definition MyGUI_EventPair.h:213
MyGUI::delegates::MultiDelegate
Definition MyGUI_Delegate.h:190
MyGUI
Definition MyGUI_ActionController.h:15
MyGUI::MapString
std::map< std::string, std::string, std::less<> > MapString
Definition MyGUI_Types.h:40