TachyonUI 0.1.0
High-performance UI for building tools.
Loading...
Searching...
No Matches
gui_clipboard.h
Go to the documentation of this file.
1#pragma once
2
3#include <string>
4#include <string_view>
5
6namespace tachyon
7{
10
14 {
15 public:
16 virtual ~IClipboard() = default;
17
19 virtual std::string Get() const = 0;
21 virtual void Set(std::string_view text) = 0;
22 };
23
25 class LocalClipboard final : public IClipboard
26 {
27 public:
28 std::string Get() const override { return m_text; }
29 void Set(std::string_view text) override { m_text = text; }
30
31 private:
32 std::string m_text;
33 };
34
35}
The clipboard text editors copy to and paste from; GUIApplication::SetClipboard sets one (default: SD...
Definition gui_clipboard.h:14
virtual void Set(std::string_view text)=0
Puts UTF-8 text on the clipboard.
virtual std::string Get() const =0
The clipboard's text, UTF-8; empty when it holds none.
virtual ~IClipboard()=default
A clipboard inside the process, not shared with other applications.
Definition gui_clipboard.h:26
void Set(std::string_view text) override
Puts UTF-8 text on the clipboard.
Definition gui_clipboard.h:29
std::string Get() const override
The clipboard's text, UTF-8; empty when it holds none.
Definition gui_clipboard.h:28
Definition gui_logging.h:24