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

KDE's Doxygen guidelines are available online.