• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdepimlibs-4.14.10 API Reference
  • KDE Home
  • Contact Us
 

mailtransport

  • mailtransport
transporttype.cpp
1/*
2 Copyright (c) 2009 Constantin Berzan <exit3219@gmail.com>
3
4 This library is free software; you can redistribute it and/or modify it
5 under the terms of the GNU Library General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or (at your
7 option) any later version.
8
9 This library is distributed in the hope that it will be useful, but WITHOUT
10 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
12 License for more details.
13
14 You should have received a copy of the GNU Library General Public License
15 along with this library; see the file COPYING.LIB. If not, write to the
16 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
17 02110-1301, USA.
18*/
19
20#include "transporttype.h"
21#include "transporttype_p.h"
22#include "transport.h"
23
24#include <akonadi/agentmanager.h>
25
26using namespace MailTransport;
27
28TransportType::TransportType()
29 : d( new Private )
30{
31}
32
33TransportType::TransportType( const TransportType &other )
34 : d( other.d )
35{
36}
37
38TransportType::~TransportType()
39{
40}
41
42TransportType &TransportType::operator=( const TransportType &other )
43{
44 if ( this != &other ) {
45 d = other.d;
46 }
47 return *this;
48}
49
50bool TransportType::operator==( const TransportType &other ) const
51{
52 if ( d->mType == Transport::EnumType::Akonadi &&
53 other.d->mType == Transport::EnumType::Akonadi ) {
54 return ( d->mAgentType == other.d->mAgentType );
55 }
56 return ( d->mType == other.d->mType );
57}
58
59bool TransportType::isValid() const
60{
61 using namespace Akonadi;
62
63 if ( d->mType == Transport::EnumType::Akonadi ) {
64 return d->mAgentType.isValid() &&
65 AgentManager::self()->types().contains( d->mAgentType );
66 } else {
67 return d->mType >= 0;
68 }
69}
70
71TransportBase::EnumType::type TransportType::type() const
72{
73 return static_cast<TransportBase::EnumType::type>( d->mType );
74}
75
76QString TransportType::name() const
77{
78 return d->mName;
79}
80
81QString TransportType::description() const
82{
83 return d->mDescription;
84}
85
86Akonadi::AgentType TransportType::agentType() const
87{
88 Q_ASSERT( d->mType == Transport::EnumType::Akonadi );
89 return d->mAgentType;
90}
MailTransport::TransportType::Private
Definition: transporttype_p.h:34
MailTransport::TransportType
A representation of a transport type.
Definition: transporttype.h:52
MailTransport::TransportType::type
TransportBase::EnumType::type type() const
Definition: transporttype.cpp:71
MailTransport::TransportType::operator==
bool operator==(const TransportType &other) const
Compares the transport type with the other.
Definition: transporttype.cpp:50
MailTransport::TransportType::isValid
bool isValid() const
Returns whether the transport type is valid.
Definition: transporttype.cpp:59
MailTransport::TransportType::operator=
TransportType & operator=(const TransportType &other)
Replaces the transport type by the other.
Definition: transporttype.cpp:42
MailTransport::TransportType::description
QString description() const
Returns a description of the transport type.
Definition: transporttype.cpp:81
MailTransport::TransportType::agentType
Akonadi::AgentType agentType() const
Returns the corresponding Akonadi::AgentType that this transport type represents.
Definition: transporttype.cpp:86
MailTransport::TransportType::TransportType
TransportType()
Constructs a new TransportType.
Definition: transporttype.cpp:28
MailTransport::TransportType::~TransportType
~TransportType()
Destroys the TransportType.
Definition: transporttype.cpp:38
MailTransport::TransportType::name
QString name() const
Returns the i18n'ed name of the transport type.
Definition: transporttype.cpp:76
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Thu Jul 21 2022 00:00:00 by doxygen 1.9.5 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

mailtransport

Skip menu "mailtransport"
  • Main Page
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • Related Pages

kdepimlibs-4.14.10 API Reference

Skip menu "kdepimlibs-4.14.10 API Reference"
  • akonadi
  •   contact
  •   kmime
  •   socialutils
  • kabc
  • kalarmcal
  • kblog
  • kcal
  • kcalcore
  • kcalutils
  • kholidays
  • kimap
  • kioslave
  •   imap4
  •   mbox
  •   nntp
  • kldap
  • kmbox
  • kmime
  • kontactinterface
  • kpimidentities
  • kpimtextedit
  • kpimutils
  • kresources
  • ktnef
  • kxmlrpcclient
  • mailtransport
  • microblog
  • qgpgme
  • syndication
  •   atom
  •   rdf
  •   rss2
Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal