neoGFX
Cross-platform C++ app/game engine
Loading...
Searching...
No Matches
clipboard.hpp
Go to the documentation of this file.
1// clipboard.hpp
2/*
3 neogfx C++ App/Game Engine
4 Copyright (c) 2015, 2020 Leigh Johnston. All Rights Reserved.
5
6 This program is free software: you can redistribute it and / or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation, either version 3 of the License, or
9 (at your option) any later version.
10
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with this program. If not, see <http://www.gnu.org/licenses/>.
18*/
19
20#pragma once
21
22#include <neogfx/neogfx.hpp>
23#include "i_clipboard.hpp"
24
25namespace neogfx
26{
27 class i_native_clipboard;
28
29 class clipboard : public i_clipboard
30 {
31 public:
32 define_declared_event(Updated, updated)
33 define_declared_event(SinkActivated, sink_activated)
34 define_declared_event(SinkDeactivated, sink_deactivated)
35 public:
36 clipboard(i_native_clipboard& aSystemClipboard);
37 public:
38 bool sink_active() const override;
40 void activate(i_clipboard_sink& aSink) override;
41 void deactivate(i_clipboard_sink& aSink) override;
42 public:
45 bool has_text() const override;
46 i_string const& text() const override;
47 void set_text(i_string const& aText) override;
48 bool has_image() const override;
49 neogfx::image image() const override;
50 void set_image(const neogfx::image& aImage) override;
51 public:
52 void cut() override;
53 void copy() override;
54 void paste() override;
55 void delete_selected() override;
56 void select_all() override;
57 private:
58 i_native_clipboard& iSystemClipboard;
59 i_clipboard_sink* iActiveSink;
60 };
61}
i_string const & text() const override
void select_all() override
void delete_selected() override
bool has_image() const override
neogfx::image image() const override
i_clipboard_sink & active_sink() override
bool sink_active() const override
void deactivate(i_clipboard_sink &aSink) override
define_declared_event(Updated, updated) define_declared_event(SinkActivated
void copy() override
bool has_text() const override
void set_image(const neogfx::image &aImage) override
void paste() override
void set_text(i_string const &aText) override
void activate(i_clipboard_sink &aSink) override
void cut() override
virtual void set_text(i_string const &aText)=0
virtual const i_string & text() const =0
#define define_declared_event(name, declName,...)
Definition event.hpp:195