Akonadi

core/agenttype.h
1 /*
2  SPDX-FileCopyrightText: 2008 Tobias Koenig <[email protected]>
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 
14 class QIcon;
15 class QString;
16 #include <QStringList>
17 class QVariant;
19 
20 namespace Akonadi
21 {
22 class 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 <[email protected]>
43  */
44 class AKONADICORE_EXPORT AgentType
45 {
46  friend class AgentManager;
47  friend class AgentManagerPrivate;
48 
49 public:
50  /**
51  * Describes a list of agent types.
52  */
54 
55  /**
56  * Creates a new agent type.
57  */
58  AgentType();
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  Q_REQUIRED_RESULT bool isValid() const;
74 
75  /**
76  * Returns the unique identifier of the agent type.
77  */
78  Q_REQUIRED_RESULT QString identifier() const;
79 
80  /**
81  * Returns the i18n'ed name of the agent type.
82  */
83  Q_REQUIRED_RESULT QString name() const;
84 
85  /**
86  * Returns the description of the agent type.
87  */
88  Q_REQUIRED_RESULT QString description() const;
89 
90  /**
91  * Returns the name of the icon of the agent type.
92  */
93  Q_REQUIRED_RESULT QString iconName() const;
94 
95  /**
96  * Returns the icon of the agent type.
97  */
98  Q_REQUIRED_RESULT QIcon icon() const;
99 
100  /**
101  * Returns the list of supported mime types of the agent type.
102  */
103  Q_REQUIRED_RESULT QStringList mimeTypes() const;
104 
105  /**
106  * Returns the list of supported capabilities of the agent type.
107  */
108  Q_REQUIRED_RESULT QStringList capabilities() const;
109 
110  /**
111  * Returns a Map of custom properties of the agent type.
112  * @since 4.12
113  */
114  Q_REQUIRED_RESULT 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 
128 private:
129  /// @cond PRIVATE
131  /// @endcond
132 };
133 
134 }
135 
136 Q_DECLARE_TYPEINFO(Akonadi::AgentType, Q_MOVABLE_TYPE);
137 
138 Q_DECLARE_METATYPE(Akonadi::AgentType)
139 
A representation of an agent type.
Provides an interface to retrieve agent types and manage agent instances.
Helper integration between Akonadi and Qt.
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Mon Jun 27 2022 04:01:05 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.