File indexing completed on 2024-09-08 07:56:39
0001 /** 0002 * Copyright © 2014 Red Hat, Inc 0003 * SPDX-License-Identifier: LGPL-2.1-or-later 0004 */ 0005 0006 #pragma once 0007 0008 #include <QMetaType> 0009 0010 // This file contains helpers, constants and other minor nice things from flatpak internals. 0011 0012 /* See flatpak-metadata(5) */ 0013 0014 #define FLATPAK_METADATA_GROUP_APPLICATION "Application" 0015 #define FLATPAK_METADATA_GROUP_RUNTIME "Runtime" 0016 #define FLATPAK_METADATA_KEY_COMMAND "command" 0017 #define FLATPAK_METADATA_KEY_NAME "name" 0018 #define FLATPAK_METADATA_KEY_REQUIRED_FLATPAK "required-flatpak" 0019 #define FLATPAK_METADATA_KEY_RUNTIME "runtime" 0020 #define FLATPAK_METADATA_KEY_SDK "sdk" 0021 #define FLATPAK_METADATA_KEY_TAGS "tags" 0022 0023 #define FLATPAK_METADATA_GROUP_CONTEXT "Context" 0024 #define FLATPAK_METADATA_KEY_SHARED "shared" 0025 #define FLATPAK_METADATA_KEY_SOCKETS "sockets" 0026 #define FLATPAK_METADATA_KEY_FILESYSTEMS "filesystems" 0027 #define FLATPAK_METADATA_KEY_PERSISTENT "persistent" 0028 #define FLATPAK_METADATA_KEY_DEVICES "devices" 0029 #define FLATPAK_METADATA_KEY_FEATURES "features" 0030 #define FLATPAK_METADATA_KEY_UNSET_ENVIRONMENT "unset-environment" 0031 0032 #define FLATPAK_METADATA_GROUP_INSTANCE "Instance" 0033 #define FLATPAK_METADATA_KEY_INSTANCE_PATH "instance-path" 0034 #define FLATPAK_METADATA_KEY_INSTANCE_ID "instance-id" 0035 #define FLATPAK_METADATA_KEY_ORIGINAL_APP_PATH "original-app-path" 0036 #define FLATPAK_METADATA_KEY_APP_PATH "app-path" 0037 #define FLATPAK_METADATA_KEY_APP_COMMIT "app-commit" 0038 #define FLATPAK_METADATA_KEY_APP_EXTENSIONS "app-extensions" 0039 #define FLATPAK_METADATA_KEY_ARCH "arch" 0040 #define FLATPAK_METADATA_KEY_BRANCH "branch" 0041 #define FLATPAK_METADATA_KEY_FLATPAK_VERSION "flatpak-version" 0042 #define FLATPAK_METADATA_KEY_ORIGINAL_RUNTIME_PATH "original-runtime-path" 0043 #define FLATPAK_METADATA_KEY_RUNTIME_PATH "runtime-path" 0044 #define FLATPAK_METADATA_KEY_RUNTIME_COMMIT "runtime-commit" 0045 #define FLATPAK_METADATA_KEY_RUNTIME_EXTENSIONS "runtime-extensions" 0046 #define FLATPAK_METADATA_KEY_SESSION_BUS_PROXY "session-bus-proxy" 0047 #define FLATPAK_METADATA_KEY_SYSTEM_BUS_PROXY "system-bus-proxy" 0048 #define FLATPAK_METADATA_KEY_EXTRA_ARGS "extra-args" 0049 #define FLATPAK_METADATA_KEY_SANDBOX "sandbox" 0050 #define FLATPAK_METADATA_KEY_BUILD "build" 0051 #define FLATPAK_METADATA_KEY_DEVEL "devel" 0052 0053 #define FLATPAK_METADATA_GROUP_SESSION_BUS_POLICY "Session Bus Policy" 0054 #define FLATPAK_METADATA_GROUP_SYSTEM_BUS_POLICY "System Bus Policy" 0055 #define FLATPAK_METADATA_GROUP_PREFIX_POLICY "Policy " 0056 #define FLATPAK_METADATA_GROUP_ENVIRONMENT "Environment" 0057 0058 #define FLATPAK_METADATA_GROUP_PREFIX_EXTENSION "Extension " 0059 #define FLATPAK_METADATA_KEY_ADD_LD_PATH "add-ld-path" 0060 #define FLATPAK_METADATA_KEY_AUTODELETE "autodelete" 0061 #define FLATPAK_METADATA_KEY_DIRECTORY "directory" 0062 #define FLATPAK_METADATA_KEY_DOWNLOAD_IF "download-if" 0063 #define FLATPAK_METADATA_KEY_ENABLE_IF "enable-if" 0064 #define FLATPAK_METADATA_KEY_AUTOPRUNE_UNLESS "autoprune-unless" 0065 #define FLATPAK_METADATA_KEY_MERGE_DIRS "merge-dirs" 0066 #define FLATPAK_METADATA_KEY_NO_AUTODOWNLOAD "no-autodownload" 0067 #define FLATPAK_METADATA_KEY_SUBDIRECTORIES "subdirectories" 0068 #define FLATPAK_METADATA_KEY_SUBDIRECTORY_SUFFIX "subdirectory-suffix" 0069 #define FLATPAK_METADATA_KEY_LOCALE_SUBSET "locale-subset" 0070 #define FLATPAK_METADATA_KEY_VERSION "version" 0071 #define FLATPAK_METADATA_KEY_VERSIONS "versions" 0072 0073 #define FLATPAK_METADATA_KEY_COLLECTION_ID "collection-id" 0074 0075 #define FLATPAK_METADATA_GROUP_EXTRA_DATA "Extra Data" 0076 #define FLATPAK_METADATA_KEY_EXTRA_DATA_CHECKSUM "checksum" 0077 #define FLATPAK_METADATA_KEY_EXTRA_DATA_INSTALLED_SIZE "installed-size" 0078 #define FLATPAK_METADATA_KEY_EXTRA_DATA_NAME "name" 0079 #define FLATPAK_METADATA_KEY_EXTRA_DATA_SIZE "size" 0080 #define FLATPAK_METADATA_KEY_EXTRA_DATA_URI "uri" 0081 #define FLATPAK_METADATA_KEY_NO_RUNTIME "NoRuntime" 0082 0083 #define FLATPAK_METADATA_GROUP_EXTENSION_OF "ExtensionOf" 0084 #define FLATPAK_METADATA_KEY_PRIORITY "priority" 0085 #define FLATPAK_METADATA_KEY_REF "ref" 0086 #define FLATPAK_METADATA_KEY_TAG "tag" 0087 0088 /* clang-format off */ 0089 0090 typedef enum { 0091 FLATPAK_POLICY_NONE, 0092 FLATPAK_POLICY_SEE, 0093 FLATPAK_POLICY_TALK, 0094 FLATPAK_POLICY_OWN 0095 } FlatpakPolicy; 0096 0097 Q_DECLARE_METATYPE(FlatpakPolicy) 0098 0099 typedef enum { 0100 FLATPAK_CONTEXT_SHARED_NETWORK = 1 << 0, 0101 FLATPAK_CONTEXT_SHARED_IPC = 1 << 1, 0102 } FlatpakContextShares; 0103 0104 typedef enum { 0105 FLATPAK_CONTEXT_SOCKET_X11 = 1 << 0, 0106 FLATPAK_CONTEXT_SOCKET_WAYLAND = 1 << 1, 0107 FLATPAK_CONTEXT_SOCKET_PULSEAUDIO = 1 << 2, 0108 FLATPAK_CONTEXT_SOCKET_SESSION_BUS = 1 << 3, 0109 FLATPAK_CONTEXT_SOCKET_SYSTEM_BUS = 1 << 4, 0110 FLATPAK_CONTEXT_SOCKET_FALLBACK_X11 = 1 << 5, /* For backwards compat, also set SOCKET_X11 */ 0111 FLATPAK_CONTEXT_SOCKET_SSH_AUTH = 1 << 6, 0112 FLATPAK_CONTEXT_SOCKET_PCSC = 1 << 7, 0113 FLATPAK_CONTEXT_SOCKET_CUPS = 1 << 8, 0114 FLATPAK_CONTEXT_SOCKET_GPG_AGENT = 1 << 9, 0115 } FlatpakContextSockets; 0116 0117 typedef enum { 0118 FLATPAK_CONTEXT_DEVICE_DRI = 1 << 0, 0119 FLATPAK_CONTEXT_DEVICE_ALL = 1 << 1, 0120 FLATPAK_CONTEXT_DEVICE_KVM = 1 << 2, 0121 FLATPAK_CONTEXT_DEVICE_SHM = 1 << 3, 0122 } FlatpakContextDevices; 0123 0124 typedef enum { 0125 FLATPAK_CONTEXT_FEATURE_DEVEL = 1 << 0, 0126 FLATPAK_CONTEXT_FEATURE_MULTIARCH = 1 << 1, 0127 FLATPAK_CONTEXT_FEATURE_BLUETOOTH = 1 << 2, 0128 FLATPAK_CONTEXT_FEATURE_CANBUS = 1 << 3, 0129 FLATPAK_CONTEXT_FEATURE_PER_APP_DEV_SHM = 1 << 4, 0130 } FlatpakContextFeatures; 0131 0132 /* clang-format on */ 0133 0134 namespace FlatpakStrings 0135 { 0136 0137 extern const char *flatpak_policy[]; 0138 extern const char *flatpak_context_sockets[]; 0139 extern const char *flatpak_context_devices[]; 0140 extern const char *flatpak_context_features[]; 0141 extern const char *flatpak_context_shares[]; 0142 extern const char *flatpak_context_special_filesystems[]; 0143 0144 }