• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdepimlibs-4.11.3 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 
26 using namespace MailTransport;
27 
28 TransportType::TransportType()
29  : d( new Private )
30 {
31 }
32 
33 TransportType::TransportType( const TransportType &other )
34  : d( other.d )
35 {
36 }
37 
38 TransportType::~TransportType()
39 {
40 }
41 
42 TransportType &TransportType::operator=( const TransportType &other )
43 {
44  if ( this != &other ) {
45  d = other.d;
46  }
47  return *this;
48 }
49 
50 bool 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 
59 bool 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 
71 TransportBase::EnumType::type TransportType::type() const
72 {
73  return static_cast<TransportBase::EnumType::type>( d->mType );
74 }
75 
76 QString TransportType::name() const
77 {
78  return d->mName;
79 }
80 
81 QString TransportType::description() const
82 {
83  return d->mDescription;
84 }
85 
86 Akonadi::AgentType TransportType::agentType() const
87 {
88  Q_ASSERT( d->mType == Transport::EnumType::Akonadi );
89  return d->mAgentType;
90 }
MailTransport::TransportType
A representation of a transport type.
Definition: transporttype.h:51
MailTransport::TransportType::name
QString name() const
Returns the i18n&#39;ed name of the transport type.
Definition: transporttype.cpp:76
MailTransport::TransportType::~TransportType
~TransportType()
Destroys the TransportType.
Definition: transporttype.cpp:38
MailTransport::TransportType::isValid
bool isValid() const
Returns whether the transport type is valid.
Definition: transporttype.cpp:59
MailTransport::TransportType::description
QString description() const
Returns a description of the transport type.
Definition: transporttype.cpp:81
MailTransport::TransportType::Private
Definition: transporttype_p.h:33
MailTransport::TransportType::operator=
TransportType & operator=(const TransportType &other)
Replaces the transport type by the other.
Definition: transporttype.cpp:42
MailTransport::TransportType::type
TransportBase::EnumType::type type() const
Definition: transporttype.cpp:71
MailTransport::TransportType::TransportType
TransportType()
Constructs a new TransportType.
Definition: transporttype.cpp:28
MailTransport::TransportType::operator==
bool operator==(const TransportType &other) const
Compares the transport type with the other.
Definition: transporttype.cpp:50
MailTransport::TransportType::agentType
Akonadi::AgentType agentType() const
Returns the corresponding Akonadi::AgentType that this transport type represents. ...
Definition: transporttype.cpp:86
This file is part of the KDE documentation.
Documentation copyright © 1996-2013 The KDE developers.
Generated on Tue Nov 26 2013 09:03:01 by doxygen 1.8.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.11.3 API Reference

Skip menu "kdepimlibs-4.11.3 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