MailTransport

transporttype.h
1 /*
2  SPDX-FileCopyrightText: 2009 Constantin Berzan <[email protected]>
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 
14 namespace MailTransport
15 {
16 class AddTransportDialog;
17 class TransportManager;
18 class 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 <[email protected]>
28  @since 4.4
29 */
30 class 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 
54 public:
55  /**
56  Describes a list of transport types.
57  */
59 
60  /**
61  Constructs a new TransportType.
62  */
63  TransportType();
64 
65  /**
66  Creates a copy of the @p other TransportType.
67  */
68  TransportType(const TransportType &other);
69 
70  /**
71  Destroys the TransportType.
72  */
73  ~TransportType();
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  Q_REQUIRED_RESULT bool operator==(const TransportType &other) const;
84 
85  /**
86  Returns whether the transport type is valid.
87  */
88  Q_REQUIRED_RESULT bool isValid() const;
89 
90  /**
91  Returns the i18n'ed name of the transport type.
92  */
93  Q_REQUIRED_RESULT QString name() const;
94 
95  /**
96  Returns a description of the transport type.
97  */
98  Q_REQUIRED_RESULT QString description() const;
99 
100  /**
101  * Returns a plugin identifier
102  */
103  Q_REQUIRED_RESULT QString identifier() const;
104 
105  /// Returns whether this transport is an akonadi resource.
106  Q_REQUIRED_RESULT bool isAkonadiResource() const;
107 
108 private:
109  //@cond PRIVATE
110  QSharedDataPointer<TransportTypePrivate> d;
111  //@endcond
112 };
113 } // namespace MailTransport
114 
115 Q_DECLARE_METATYPE(MailTransport::TransportType)
116 Q_DECLARE_TYPEINFO(MailTransport::TransportType, Q_MOVABLE_TYPE);
Central transport management interface.
A representation of a transport type.
Definition: transporttype.h:30
Represents the settings of a specific mail transport.
Definition: transport.h:32
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Mar 27 2023 04:23:13 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.