// Example external provider plugin — a template for adding new package // providers without touching the application code. // // Build it as a shared library and drop it in a plugin directory // (next to the PacManager binary in ./plugins/ or in // ~/.local/share/PacManager/plugins/); the app discovers it at launch and on // the Providers page via "Recharger". // // A plugin only needs to: // 1. implement IPackageManager (see include/package-manager.h) // 2. export the C ABI symbols via the FWS_PROVIDER_PLUGIN macro // // To build with CMake from the project root: // cmake -B build -DFWS_BUILD_EXAMPLE_PLUGIN=ON && cmake --build build #include "provider-plugin.h" // A trivial provider that reports itself as always available but manages // nothing — replace the stubs with real commands (apt, dnf, zypper, ...). class SampleProvider : public IPackageManager { public: std::string getName() const override { return "sample"; } std::string getVersion() const override { return "0.1.0"; } std::string getDescription() const override { return "Exemple de plugin fournisseur (modèle à copier)"; } bool canSearch() const override { return false; } bool canInstall() const override { return false; } bool canRemove() const override { return false; } bool canUpdate() const override { return false; } bool canListInstalled() const override { return false; } bool isAvailable() const override { return true; } std::vector search(const std::string&) override { return {}; } bool install(const std::string&, std::function) override { return false; } bool remove(const std::string&, std::function) override { return false; } bool update(const std::string&, std::function) override { return false; } std::vector listInstalled() override { return {}; } std::vector listUpdates() override { return {}; } bool refresh(std::function) override { return false; } }; FWS_PROVIDER_PLUGIN(SampleProvider, "sample", "Sample Provider", "0.1.0", "Exemple de plugin fournisseur (modèle à copier)", "FWS");