/* * Copyright © 2016 Canonical Ltd. * * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU General Public License version 3, as published * by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranties of * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program. If not, see . * * Authors: * Ted Gould */ #include "application-impl-base.h" #include "application-info-desktop.h" #include #include #pragma once namespace lomiri { namespace app_launch { namespace app_info { class Desktop; } namespace app_impls { /** Application Implmentation for Click packages. Click packages are installed via the click tool and have information avaialable on them via libclick. There is one version per-user on the system and a Lomiri App Launch hook makes a link to each of those versions in the user's cache directory. Click ensures this is up-to-date. Application IDs for Click packages are the standard it was built on. Typically a package name is "$(application).$(developer id)" though there isn't a requirement in the local Click tools to require that. The appname element is gotten from the JSON manifest in the Click package and should reference a desktop file. All Click packages also have a version. More info: http://click.readthedocs.io/ */ class Click : public Base { public: Click(const AppID& appid, const std::shared_ptr& registry); Click(const AppID& appid, const std::shared_ptr& manifest, const std::shared_ptr& registry); AppID appId() const override; std::shared_ptr info() override; std::vector> instances() override; std::shared_ptr launch(const std::vector& urls = {}) override; std::shared_ptr launchTest(const std::vector& urls = {}) override; virtual std::shared_ptr findInstance(const std::string& instanceid) override; private: AppID _appid; std::shared_ptr _manifest; std::string _clickDir; std::shared_ptr _keyfile; std::string desktopPath_; std::shared_ptr _info; std::list> launchEnv(); }; } // namespace app_impls } // namespace app_launch } // namespace lomiri