File indexing completed on 2024-06-16 04:50:10

0001 /*
0002     SPDX-FileCopyrightText: 2008 Tobias Koenig <tokoe@kde.org>
0003 
0004     SPDX-License-Identifier: LGPL-2.0-or-later
0005 */
0006 
0007 #include "agenttype.h"
0008 #include "agenttype_p.h"
0009 
0010 #include <QIcon>
0011 
0012 using namespace Akonadi;
0013 
0014 AgentType::AgentType()
0015     : d(new AgentTypePrivate)
0016 {
0017 }
0018 
0019 AgentType::AgentType(const AgentType &other)
0020     : d(other.d)
0021 {
0022 }
0023 
0024 AgentType::~AgentType()
0025 {
0026 }
0027 
0028 bool AgentType::isValid() const
0029 {
0030     return !d->mIdentifier.isEmpty();
0031 }
0032 
0033 QString AgentType::identifier() const
0034 {
0035     return d->mIdentifier;
0036 }
0037 
0038 QString AgentType::name() const
0039 {
0040     return d->mName;
0041 }
0042 
0043 QString AgentType::description() const
0044 {
0045     return d->mDescription;
0046 }
0047 
0048 QString AgentType::iconName() const
0049 {
0050     return d->mIconName;
0051 }
0052 
0053 QIcon AgentType::icon() const
0054 {
0055     return QIcon::fromTheme(d->mIconName);
0056 }
0057 
0058 QStringList AgentType::mimeTypes() const
0059 {
0060     return d->mMimeTypes;
0061 }
0062 
0063 QStringList AgentType::capabilities() const
0064 {
0065     return d->mCapabilities;
0066 }
0067 
0068 QVariantMap AgentType::customProperties() const
0069 {
0070     return d->mCustomProperties;
0071 }
0072 
0073 AgentType &AgentType::operator=(const AgentType &other)
0074 {
0075     if (this != &other) {
0076         d = other.d;
0077     }
0078 
0079     return *this;
0080 }
0081 
0082 bool AgentType::operator==(const AgentType &other) const
0083 {
0084     return (d->mIdentifier == other.d->mIdentifier);
0085 }