Debian Codegraph @

src/platform/platform.h

raw
1 /*
2 * Copyright (C) 2020 UBports foundation.
3 * Author(s): Marius Gripsgard <[email protected]>
4 *
5 * This program is free software: you can redistribute it and/or modify it under
6 * the terms of the GNU General Public License version 3, as published by
7 * the Free Software Foundation.
8 *
9 * This program is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranties of MERCHANTABILITY,
11 * SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
16 *
17 */
18
19 #pragma once
20
21 #include <memory>
22
23 #include "deviceinfo.h"
24
25 class Platform {
26 public:
27 Platform() = default;
28
29 virtual std::string name() = 0;
30 virtual std::string prettyName() = 0;
31 virtual std::string buildId() = 0;
32 virtual std::string deviceIdentifier() = 0;
33 virtual DeviceInfo::DeviceType deviceType() = 0;
34 virtual DeviceInfo::DriverType driverType() = 0;
35
36 // Checks if the value returned is valid or default value
37 virtual bool hasValidName() { return false; };
38 virtual bool hasValidPrettyName() { return false; };
39 virtual bool hasValidDeviceType() { return false; };
40
41 static std::shared_ptr<Platform> create();
42 };