Debian Codegraph @

liblomiri-app-launch/app-store-base.h

raw
1 /*
2 * Copyright © 2017 Canonical Ltd.
3 *
4 * This program is free software: you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License version 3, as published
6 * by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful, but
9 * WITHOUT ANY WARRANTY; without even the implied warranties of
10 * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
11 * PURPOSE. See the GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License along
14 * with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * Authors:
17 * Ted Gould <[email protected]>
18 */
19
20 #pragma once
21
22 #include "appid.h"
23 #include "application-impl-base.h"
24 #include "info-watcher.h"
25 #include "registry.h"
26
27 namespace lomiri
28 {
29 namespace app_launch
30 {
31 namespace app_impls
32 {
33 class Base;
34 }
35 namespace app_store
36 {
37
38 class Base : public info_watcher::Base
39 {
40 public:
41 Base(const std::shared_ptr<Registry::Impl>& registry);
42 virtual ~Base();
43
44 /* Discover tools */
45 virtual bool verifyPackage(const AppID::Package& package) = 0;
46 virtual bool verifyAppname(const AppID::Package& package, const AppID::AppName& appname) = 0;
47 virtual AppID::AppName findAppname(const AppID::Package& package, AppID::ApplicationWildcard card) = 0;
48 virtual AppID::Version findVersion(const AppID::Package& package, const AppID::AppName& appname) = 0;
49 virtual bool hasAppId(const AppID& appid) = 0;
50
51 /* Possible apps */
52 virtual std::list<std::shared_ptr<Application>> list() = 0;
53
54 /* Application Creation */
55 virtual std::shared_ptr<app_impls::Base> create(const AppID& appid) = 0;
56
57 /* Static get all */
58 static std::list<std::shared_ptr<Base>> allAppStores(const std::shared_ptr<Registry::Impl>& registry);
59 };
60
61 } // namespace app_store
62 } // namespace app_launch
63 } // namespace lomiri