agenttype.h 1.14 KB
Newer Older
1
/*
2
    SPDX-FileCopyrightText: 2007-2008 Volker Krause <vkrause@kde.org>
3

4
    SPDX-License-Identifier: LGPL-2.0-or-later
5
6
*/

7
8
#ifndef AGENTTYPE_H
#define AGENTTYPE_H
9
10
11

#include <QString>
#include <QStringList>
12
#include <QVariantMap>
13
#include <QHash>
14
15
16
17

class AgentManager;
class QSettings;

18
class AgentType
19
{
20
public:
21
    enum LaunchMethod {
22
23
24
        Process, /// Standalone executable
        Server,  /// Agent plugin launched in AgentManager
        Launcher /// Agent plugin launched in own process
25
26
    };

27
public:
28
    AgentType();
Laurent Montel's avatar
Laurent Montel committed
29
    Q_REQUIRED_RESULT bool load(const QString &fileName, AgentManager *manager);
30
    void save(QSettings *config) const;
31
32

    QString identifier;
33
34
    QString name;
    QString comment;
35
36
37
38
    QString icon;
    QStringList mimeTypes;
    QStringList capabilities;
    QString exec;
39
    QVariantMap custom;
Laurent Montel's avatar
Laurent Montel committed
40
41
    uint instanceCounter = 0;
    LaunchMethod launchMethod = Process;
42

Volker Krause's avatar
Volker Krause committed
43
44
45
46
47
    static const QLatin1String CapabilityUnique;
    static const QLatin1String CapabilityResource;
    static const QLatin1String CapabilityAutostart;
    static const QLatin1String CapabilityPreprocessor;
    static const QLatin1String CapabilitySearch;
48
49
50
};

#endif