Akonadi

core/agenttype.h
1/*
2 SPDX-FileCopyrightText: 2008 Tobias Koenig <tokoe@kde.org>
3
4 SPDX-License-Identifier: LGPL-2.0-or-later
5*/
6
7#pragma once
8
9#include "akonadicore_export.h"
10
11#include <QMetaType>
12#include <QSharedDataPointer>
13
14class QIcon;
15#include <QStringList>
16class QVariant;
17using QVariantMap = QMap<QString, QVariant>;
18
19namespace Akonadi
20{
21class AgentTypePrivate;
22
23/**
24 * @short A representation of an agent type.
25 *
26 * The agent type is a representation of an available agent, that can
27 * be started as an agent instance.
28 * It provides all information about the type.
29 *
30 * All available agent types can be retrieved from the AgentManager.
31 *
32 * @code
33 *
34 * Akonadi::AgentType::List types = Akonadi::AgentManager::self()->types();
35 * for ( const Akonadi::AgentType &type : types ) {
36 * qDebug() << "Name:" << type.name() << "(" << type.identifier() << ")";
37 * }
38 *
39 * @endcode
40 *
41 * @author Tobias Koenig <tokoe@kde.org>
42 */
43class AKONADICORE_EXPORT AgentType
44{
45 friend class AgentManager;
46 friend class AgentManagerPrivate;
47
48public:
49 /**
50 * Describes a list of agent types.
51 */
53
54 /**
55 * Creates a new agent type.
56 */
58
59 /**
60 * Creates an agent type from an @p other agent type.
61 */
62 AgentType(const AgentType &other);
63
64 /**
65 * Destroys the agent type.
66 */
67 ~AgentType();
68
69 /**
70 * Returns whether the agent type is valid.
71 */
72 [[nodiscard]] bool isValid() const;
73
74 /**
75 * Returns the unique identifier of the agent type.
76 */
77 [[nodiscard]] QString identifier() const;
78
79 /**
80 * Returns the i18n'ed name of the agent type.
81 */
82 [[nodiscard]] QString name() const;
83
84 /**
85 * Returns the description of the agent type.
86 */
87 [[nodiscard]] QString description() const;
88
89 /**
90 * Returns the name of the icon of the agent type.
91 */
92 [[nodiscard]] QString iconName() const;
93
94 /**
95 * Returns the icon of the agent type.
96 */
97 [[nodiscard]] QIcon icon() const;
98
99 /**
100 * Returns the list of supported mime types of the agent type.
101 */
102 [[nodiscard]] QStringList mimeTypes() const;
103
104 /**
105 * Returns the list of supported capabilities of the agent type.
106 */
107 [[nodiscard]] QStringList capabilities() const;
108
109 /**
110 * Returns a Map of custom properties of the agent type.
111 * @since 4.12
112 */
113 [[nodiscard]] QVariantMap customProperties() const;
114
115 /**
116 * @internal
117 * @param other other agent type
118 */
119 AgentType &operator=(const AgentType &other);
120
121 /**
122 * @internal
123 * @param other other agent type
124 */
125 bool operator==(const AgentType &other) const;
126
127private:
128 /// @cond PRIVATE
130 /// @endcond
131};
132
133}
134
135Q_DECLARE_TYPEINFO(Akonadi::AgentType, Q_RELOCATABLE_TYPE);
136
137Q_DECLARE_METATYPE(Akonadi::AgentType)
A representation of an agent type.
AgentType()
Creates a new agent type.
QStringList mimeTypes() const
Returns the list of supported mime types of the agent type.
QString iconName() const
Returns the name of the icon of the agent type.
QIcon icon() const
Returns the icon of the agent type.
bool operator==(const AgentType &other) const
bool isValid() const
Returns whether the agent type is valid.
QList< AgentType > List
Describes a list of agent types.
QString identifier() const
Returns the unique identifier of the agent type.
QString description() const
Returns the description of the agent type.
QStringList capabilities() const
Returns the list of supported capabilities of the agent type.
QString name() const
Returns the i18n'ed name of the agent type.
AgentType & operator=(const AgentType &other)
QVariantMap customProperties() const
Returns a Map of custom properties of the agent type.
Helper integration between Akonadi and Qt.
This file is part of the KDE documentation.
Documentation copyright © 1996-2025 The KDE developers.
Generated on Fri Jan 24 2025 11:49:56 by doxygen 1.13.2 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.