MailTransport

transportattribute.cpp
1 /*
2  SPDX-FileCopyrightText: 2009 Constantin Berzan <[email protected]>
3 
4  SPDX-License-Identifier: LGPL-2.0-or-later
5 */
6 
7 #include "transportattribute.h"
8 
9 using namespace Akonadi;
10 using namespace MailTransport;
11 
12 class MailTransport::TransportAttributePrivate
13 {
14 public:
15  int mId = -1;
16 };
17 
18 TransportAttribute::TransportAttribute(int id)
19  : d(new TransportAttributePrivate)
20 {
21  d->mId = id;
22 }
23 
25 
26 TransportAttribute *TransportAttribute::clone() const
27 {
28  return new TransportAttribute(d->mId);
29 }
30 
31 QByteArray TransportAttribute::type() const
32 {
33  static const QByteArray sType("TransportAttribute");
34  return sType;
35 }
36 
37 QByteArray TransportAttribute::serialized() const
38 {
39  return QByteArray::number(d->mId);
40 }
41 
42 void TransportAttribute::deserialize(const QByteArray &data)
43 {
44  d->mId = data.toInt();
45 }
46 
48 {
49  return d->mId;
50 }
51 
53 {
54  d->mId = id;
55 }
void setTransportId(int id)
Sets the transport id to use for sending this message.
QByteArray number(int n, int base)
int toInt(bool *ok, int base) const const
~TransportAttribute() override
Destroys this TransportAttribute.
Attribute determining which transport to use for sending a message.
TransportAttribute(int id=-1)
Creates a new TransportAttribute.
int transportId() const
Returns the transport id to use for sending this message.
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Tue Feb 7 2023 03:58:25 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.