agenttype.h 1.94 KB
Newer Older
1
/*
2
    Copyright (c) 2007 - 2008 Volker Krause <vkrause@kde.org>
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19

    This library is free software; you can redistribute it and/or modify it
    under the terms of the GNU Library General Public License as published by
    the Free Software Foundation; either version 2 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 Library General Public
    License for more details.

    You should have received a copy of the GNU Library General Public License
    along with this library; see the file COPYING.LIB.  If not, write to the
    Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    02110-1301, USA.
*/

20
21
#ifndef AGENTTYPE_H
#define AGENTTYPE_H
22
23
24

#include <QString>
#include <QStringList>
25
#include <QVariantMap>
26
#include <QHash>
27
28

namespace Akonadi {
29
class ProcessControl;
30
31
32
33
34
}

class AgentManager;
class QSettings;

35
class AgentType
36
{
37
public:
38
    enum LaunchMethod {
39
40
41
        Process, /// Standalone executable
        Server,  /// Agent plugin launched in AgentManager
        Launcher /// Agent plugin launched in own process
42
43
    };

44
public:
45
    AgentType();
46
47
    bool load(const QString &fileName, AgentManager *manager);
    void save(QSettings *config) const;
48
49

    QString identifier;
50
51
    QString name;
    QString comment;
52
53
54
55
    QString icon;
    QStringList mimeTypes;
    QStringList capabilities;
    QString exec;
56
    QVariantMap custom;
57
    uint instanceCounter;
58
    LaunchMethod launchMethod;
59

Volker Krause's avatar
Volker Krause committed
60
61
62
63
64
    static const QLatin1String CapabilityUnique;
    static const QLatin1String CapabilityResource;
    static const QLatin1String CapabilityAutostart;
    static const QLatin1String CapabilityPreprocessor;
    static const QLatin1String CapabilitySearch;
65

66
67
private:
    QString readString(const QSettings &file, const QString &key);
68
69
70
};

#endif