MyGUI 3.5.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_Delegate.h"
12#include "MyGUI_Singleton.h"
13#include "MyGUI_Types.h"
14#include "MyGUI_EventPair.h"
15#include "MyGUI_UString.h"
16
17namespace MyGUI
18{
19
20 class WindowsClipboardHandler;
21
22 class MYGUI_EXPORT ClipboardManager
23 {
24 MYGUI_SINGLETON_DECLARATION(ClipboardManager);
25
26 public:
27 ClipboardManager();
28
29 void initialise();
30 void shutdown();
31
36 void setClipboardData(std::string_view _type, std::string_view _data);
37
41 void clearClipboardData(std::string_view _type);
42
46 std::string getClipboardData(std::string_view _type) const;
47
48 /*events:*/
54 EventPairConvertStringView<
55 delegates::MultiDelegate<const std::string&, const std::string&>,
56 delegates::MultiDelegate<std::string_view, std::string_view>>
57 eventClipboardChanged;
58
65 EventPairConvertStringView<
66 delegates::MultiDelegate<const std::string&, std::string&>,
67 delegates::MultiDelegate<std::string_view, std::string&>>
68 eventClipboardRequested;
69
70 private:
71 MapString mClipboardData;
72
73#if MYGUI_PLATFORM == MYGUI_PLATFORM_WIN32
74 WindowsClipboardHandler* mWindowsClipboardHandler;
75#endif
76
77 bool mIsInitialise{false};
78 };
79
80} // namespace MyGUI
81
82#endif // MYGUI_CLIPBOARD_MANAGER_H_
#define MYGUI_EXPORT
#define MYGUI_SINGLETON_DECLARATION(ClassName)
std::map< std::string, std::string, std::less<> > MapString
Definition MyGUI_Types.h:39