MailTransport

transporttype.h
1/*
2 SPDX-FileCopyrightText: 2009 Constantin Berzan <exit3219@gmail.com>
3
4 SPDX-License-Identifier: LGPL-2.0-or-later
5*/
6
7#pragma once
8
9#include "mailtransport_export.h"
10#include "transport.h"
11
12#include <QString>
13
14namespace MailTransport
15{
16class AddTransportDialog;
18class TransportTypePrivate;
19
20/**
21 @short A representation of a transport type.
22
23 Represents an available transport type. SMTP is available
24
25 All available transport types can be retrieved via TransportManager::types().
26
27 @author Constantin Berzan <exit3219@gmail.com>
28 @since 4.4
29*/
30class MAILTRANSPORT_EXPORT TransportType
31{
32 Q_GADGET
33
34 /// This property holds whether the transport type is valid.
35 Q_PROPERTY(bool isValid READ isValid CONSTANT)
36
37 /// This property holds the i18n'ed name of the transport type.
38 Q_PROPERTY(QString name READ name CONSTANT)
39
40 /// This property holds the transport type.
41 Q_PROPERTY(QString description READ description CONSTANT)
42
43 /// This property holds the plugin identifier.
44 Q_PROPERTY(QString identifier READ identifier CONSTANT)
45
46 /// This property holds whether this transport is an akonadi resource.
47 Q_PROPERTY(bool isAkonadiResource READ isAkonadiResource CONSTANT)
48
49 friend class AddTransportDialog;
50 friend class Transport;
51 friend class TransportManager;
52 friend class TransportManagerPrivate;
53
54public:
55 /**
56 Describes a list of transport types.
57 */
59
60 /**
61 Constructs a new TransportType.
62 */
64
65 /**
66 Creates a copy of the @p other TransportType.
67 */
69
70 /**
71 Destroys the TransportType.
72 */
74
75 /**
76 * Replaces the transport type by the @p other.
77 */
78 TransportType &operator=(const TransportType &other);
79
80 /**
81 * Compares the transport type with the @p other.
82 */
83 [[nodiscard]] bool operator==(const TransportType &other) const;
84
85 /**
86 Returns whether the transport type is valid.
87 */
88 [[nodiscard]] bool isValid() const;
89
90 /**
91 Returns the i18n'ed name of the transport type.
92 */
93 [[nodiscard]] QString name() const;
94
95 /**
96 Returns a description of the transport type.
97 */
98 [[nodiscard]] QString description() const;
99
100 /**
101 * Returns a plugin identifier
102 */
103 [[nodiscard]] QString identifier() const;
104
105 /// Returns whether this transport is an akonadi resource.
106 [[nodiscard]] bool isAkonadiResource() const;
107
108private:
109 //@cond PRIVATE
110 QSharedDataPointer<TransportTypePrivate> d;
111 //@endcond
112};
113} // namespace MailTransport
114
115Q_DECLARE_TYPEINFO(MailTransport::TransportType, Q_RELOCATABLE_TYPE);
Central transport management interface.
QString name
This property holds the i18n'ed name of the transport type.
TransportType()
Constructs a new TransportType.
QString identifier
This property holds the plugin identifier.
QList< TransportType > List
Describes a list of transport types.
bool isAkonadiResource
This property holds whether this transport is an akonadi resource.
bool isValid
This property holds whether the transport type is valid.
QString description
This property holds the transport type.
This file is part of the KDE documentation.
Documentation copyright © 1996-2025 The KDE developers.
Generated on Fri Jan 24 2025 11:53:50 by doxygen 1.13.2 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.