| 1 | /* |
| 2 | * LegacyClonk |
| 3 | * |
| 4 | * Copyright (c) 2020-2021, The LegacyClonk Team and contributors |
| 5 | * |
| 6 | * Distributed under the terms of the ISC license; see accompanying file |
| 7 | * "COPYING" for details. |
| 8 | * |
| 9 | * "Clonk" is a registered trademark of Matthes Bender, used with permission. |
| 10 | * See accompanying file "TRADEMARK" for details. |
| 11 | * |
| 12 | * To redistribute this file separately, substitute the full license texts |
| 13 | * for the above references. |
| 14 | */ |
| 15 | |
| 16 | #pragma once |
| 17 | |
| 18 | #include "C4ToastEventHandler.h" |
| 19 | |
| 20 | #include <cstdint> |
| 21 | #include <memory> |
| 22 | #include <string_view> |
| 23 | |
| 24 | class C4Toast; |
| 25 | |
| 26 | class C4ToastSystem |
| 27 | { |
| 28 | public: |
| 29 | virtual ~C4ToastSystem() = default; |
| 30 | |
| 31 | public: |
| 32 | virtual std::unique_ptr<C4Toast> CreateToast() = 0; |
| 33 | |
| 34 | public: |
| 35 | static std::unique_ptr<C4ToastSystem> NewInstance(); |
| 36 | }; |
| 37 | |
| 38 | class C4Toast |
| 39 | { |
| 40 | public: |
| 41 | virtual ~C4Toast() = default; |
| 42 | |
| 43 | public: |
| 44 | virtual void AddAction(std::string_view action) = 0; |
| 45 | virtual void SetEventHandler(C4ToastEventHandler *eventHandler); |
| 46 | virtual void SetExpiration(std::uint32_t expiration) = 0; |
| 47 | virtual void SetText(std::string_view text) = 0; |
| 48 | virtual void SetTitle(std::string_view title) = 0; |
| 49 | |
| 50 | virtual void Show() = 0; |
| 51 | virtual void Hide() = 0; |
| 52 | |
| 53 | protected: |
| 54 | C4ToastEventHandler *eventHandler; |
| 55 | }; |
| 56 | |