MyGUI: MyGUI_ClipboardManager.h Source File

MyGUI 3.4.3

MyGUI_ClipboardManager.h
Go to the documentation of this file.
1/*
2 * This source file is part of MyGUI. For the latest info, see http://mygui.info/
3 * Distributed under the MIT License
4 * (See accompanying file COPYING.MIT or copy at http://opensource.org/licenses/MIT)
5 */
6
7#ifndef MYGUI_CLIPBOARD_MANAGER_H_
8#define MYGUI_CLIPBOARD_MANAGER_H_
9
10#include "MyGUI_Prerequest.h"
11#include "MyGUI_Singleton.h"
12#include "MyGUI_Types.h"
13#include "MyGUI_EventPair.h"
14#include "MyGUI_UString.h"
15
16namespace MyGUI
17{
18
19 class WindowsClipboardHandler;
20
21 class MYGUI_EXPORT ClipboardManager
22 {
23 MYGUI_SINGLETON_DECLARATION(ClipboardManager);
24
25 public:
26 ClipboardManager();
27
28 void initialise();
29 void shutdown();
30
35 void setClipboardData(std::string_view _type, std::string_view _data);
36
40 void clearClipboardData(std::string_view _type);
41
45 std::string getClipboardData(std::string_view _type) const;
46
47 /*events:*/
53 EventPairConvertStringView<
54 delegates::MultiDelegate<const std::string&, const std::string&>,
55 delegates::MultiDelegate<std::string_view, std::string_view>>
56 eventClipboardChanged;
57
64 EventPairConvertStringView<
65 delegates::MultiDelegate<const std::string&, std::string&>,
66 delegates::MultiDelegate<std::string_view, std::string&>>
67 eventClipboardRequested;
68
69 private:
70 MapString mClipboardData;
71
72#if MYGUI_PLATFORM == MYGUI_PLATFORM_WIN32
73 WindowsClipboardHandler* mWindowsClipboardHandler;
74#endif
75
76 bool mIsInitialise{false};
77 };
78
79} // namespace MyGUI
80
81#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