| 1 | // SPDX-License-Identifier: GPL-3.0-or-later |
| 2 | // Copyright 2021 Juan Palacios <[email protected]> |
| 3 | |
| 4 | #pragma once |
| 5 | |
| 6 | #include "core/profilepartxmlparser.h" |
| 7 | #include "noopprofilepart.h" |
| 8 | |
| 9 | class NoopXMLParser final |
| 10 | : public ProfilePartXMLParser |
| 11 | , public NoopProfilePart::Exporter |
| 12 | , public NoopProfilePart::Importer |
| 13 | { |
| 14 | public: |
| 15 | NoopXMLParser() noexcept; |
| 16 | |
| 17 | std::unique_ptr<Exportable::Exporter> factory( |
| 18 | IProfilePartXMLParserProvider const &profilePartParserProvider) override; |
| 19 | std::unique_ptr<Exportable::Exporter> initializer() override; |
| 20 | |
| 21 | std::optional<std::reference_wrapper<Exportable::Exporter>> |
| 22 | provideExporter(Item const &i) override; |
| 23 | std::optional<std::reference_wrapper<Importable::Importer>> |
| 24 | provideImporter(Item const &i) override; |
| 25 | |
| 26 | void takeActive(bool active) override; |
| 27 | bool provideActive() const override; |
| 28 | |
| 29 | void appendTo(pugi::xml_node &parentNode) override; |
| 30 | |
| 31 | protected: |
| 32 | void resetAttributes() override; |
| 33 | void loadPartFrom(pugi::xml_node const &parentNode) override; |
| 34 | |
| 35 | private: |
| 36 | class Initializer; |
| 37 | |
| 38 | bool active_; |
| 39 | bool activeDefault_; |
| 40 | |
| 41 | static bool const registered_; |
| 42 | }; |