| 1 | // SPDX-License-Identifier: GPL-3.0-or-later |
| 2 | // Copyright 2019 Juan Palacios <[email protected]> |
| 3 | |
| 4 | #pragma once |
| 5 | |
| 6 | #include <memory> |
| 7 | #include <string> |
| 8 | |
| 9 | class IAppRegistry |
| 10 | { |
| 11 | public: |
| 12 | class Observer |
| 13 | { |
| 14 | public: |
| 15 | virtual void registeredApp(std::string const &app) = 0; |
| 16 | virtual void unregisteredApp(std::string const &app) = 0; |
| 17 | |
| 18 | virtual ~Observer() = default; |
| 19 | }; |
| 20 | |
| 21 | virtual void addObserver(std::shared_ptr<IAppRegistry::Observer> observer) = 0; |
| 22 | virtual void |
| 23 | removeObserver(std::shared_ptr<IAppRegistry::Observer> const &observer) = 0; |
| 24 | |
| 25 | virtual void add(std::string const &app) = 0; |
| 26 | virtual void remove(std::string const &app) = 0; |
| 27 | virtual bool registered(std::string const &app) = 0; |
| 28 | |
| 29 | virtual ~IAppRegistry() = default; |
| 30 | }; |