| 1 | // SPDX-License-Identifier: GPL-3.0-or-later |
| 2 | // Copyright 2019 Juan Palacios <[email protected]> |
| 3 | |
| 4 | #pragma once |
| 5 | |
| 6 | #include "exportable.h" |
| 7 | #include "importable.h" |
| 8 | #include "item.h" |
| 9 | #include <memory> |
| 10 | |
| 11 | class IProfilePartProvider; |
| 12 | |
| 13 | class IProfilePart |
| 14 | : public Item |
| 15 | , public Importable |
| 16 | , public Exportable |
| 17 | { |
| 18 | public: |
| 19 | class Importer : public Importable::Importer |
| 20 | { |
| 21 | public: |
| 22 | virtual bool provideActive() const = 0; |
| 23 | }; |
| 24 | |
| 25 | class Exporter : public Exportable::Exporter |
| 26 | { |
| 27 | public: |
| 28 | virtual void takeActive(bool active) = 0; |
| 29 | }; |
| 30 | |
| 31 | virtual std::unique_ptr<Exportable::Exporter> |
| 32 | factory(IProfilePartProvider const &profilePartProvider) = 0; |
| 33 | |
| 34 | virtual std::unique_ptr<Exportable::Exporter> initializer() = 0; |
| 35 | |
| 36 | virtual bool active() const = 0; |
| 37 | virtual void activate(bool active) = 0; |
| 38 | |
| 39 | virtual std::unique_ptr<IProfilePart> clone() const = 0; |
| 40 | |
| 41 | virtual ~IProfilePart() = default; |
| 42 | }; |