File indexing completed on 2025-01-05 04:46:27

0001 /*
0002     SPDX-FileCopyrightText: 2007-2008 Volker Krause <vkrause@kde.org>
0003 
0004     SPDX-License-Identifier: LGPL-2.0-or-later
0005 */
0006 
0007 #pragma once
0008 
0009 #include <QHash>
0010 #include <QString>
0011 #include <QStringList>
0012 #include <QVariantMap>
0013 
0014 class AgentManager;
0015 class QSettings;
0016 
0017 class AgentType
0018 {
0019 public:
0020     enum LaunchMethod {
0021         Process, /// Standalone executable
0022         Server, /// Agent plugin launched in AgentManager
0023         Launcher /// Agent plugin launched in own process
0024     };
0025 
0026 public:
0027     AgentType();
0028     [[nodiscard]] bool load(const QString &fileName, AgentManager *manager);
0029     void save(QSettings *config) const;
0030 
0031     QString identifier;
0032     QString name;
0033     QString comment;
0034     QString icon;
0035     QStringList mimeTypes;
0036     QStringList capabilities;
0037     QString exec;
0038     QVariantMap custom;
0039     uint instanceCounter = 0;
0040     LaunchMethod launchMethod = Process;
0041 
0042     static const QLatin1StringView CapabilityUnique;
0043     static const QLatin1StringView CapabilityResource;
0044     static const QLatin1StringView CapabilityAutostart;
0045     static const QLatin1StringView CapabilityPreprocessor;
0046     static const QLatin1StringView CapabilitySearch;
0047 };