/usr/include/AppStreamQt/pool.h is in libappstreamqt-dev 0.12.0-3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 | /*
* Copyright (C) 2016 Matthias Klumpp <matthias@tenstral.net>
*
* Licensed under the GNU Lesser General Public License Version 2.1
*
* This library is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 2.1 of the license, or
* (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef APPSTREAMQT_POOL_H
#define APPSTREAMQT_POOL_H
#include "appstreamqt_export.h"
#include <QString>
#include <QList>
#include <QStringList>
#include "component.h"
namespace AppStream {
/**
* Access the AppStream metadata pool.
*
* See http://www.freedesktop.org/wiki/Distributions/AppStream/ for details
*/
class PoolPrivate;
class APPSTREAMQT_EXPORT Pool : QObject{
Q_OBJECT
public:
Pool(QObject *parent = nullptr);
~Pool();
/**
* Pool::Flags:
* FlagNone: No flags.
* FlagReadCollection: Add AppStream collection metadata to the pool.
* FlagReadMetainfo: Add data from AppStream metainfo files to the pool.
* FlagReadDesktopFiles: Add metadata from .desktop files to the pool.
*
* Flags on how caching should be used.
**/
enum Flags {
FlagNone = 0,
FlagReadCollection = 1 << 0,
FlagReadMetainfo = 1 << 1,
FlagReadDesktopFiles = 1 << 2,
};
/**
* Pool::CacheFlags:
* None: No flags.
* UseUser: Create an user-specific metadata cache.
* UseSystem: Use and - if possible - update the global metadata cache.
*
* Flags on how caching should be used.
**/
enum CacheFlags {
CacheFlagNone = 0,
CacheFlagUseUser = 1 << 0,
CacheFlagUseSystem = 1 << 1,
};
/**
* \return true on success. False on failure
*/
bool load();
/**
* \return true on success. False on failure
*
* In case of failure, @p error will be initialized with the error message
*/
bool load(QString* error);
/**
* Remove all software component information from the pool.
*/
void clear();
/**
* Add a component to the pool.
*/
bool addComponent(const AppStream::Component& cpt);
QList<AppStream::Component> components() const;
QList<AppStream::Component> componentsById(const QString& cid) const;
QList<AppStream::Component> componentsByProvided(Provided::Kind kind, const QString& item) const;
QList<AppStream::Component> componentsByKind(Component::Kind kind) const;
QList<AppStream::Component> componentsByCategories(const QStringList categories) const;
QList<AppStream::Component> componentsByLaunchable(Launchable::Kind kind, const QString& value) const;
QList<AppStream::Component> search(const QString& term) const;
void clearMetadataLocations();
void addMetadataLocation(const QString& directory);
void setLocale(const QString& locale);
uint flags() const;
void setFlags(uint flags);
uint cacheFlags() const;
void setCacheFlags(uint flags);
private:
Q_DISABLE_COPY(Pool);
QScopedPointer<PoolPrivate> d;
};
}
#endif // APPSTREAMQT_POOL_H
|