KIMAP2

metadatajobbase.h
1/*
2 Copyright (c) 2009 Andras Mantia <amantia@kde.org>
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#ifndef KIMAP2_METADATAJOBBASE_H
21#define KIMAP2_METADATAJOBBASE_H
22
23#include "kimap2_export.h"
24
25#include "job.h"
26
27namespace KIMAP2
28{
29
30class Session;
31struct Message;
32class MetaDataJobBasePrivate;
33
34/**
35 * Base class for jobs that operate on mailbox metadata
36 *
37 * Provides support for the IMAP METADATA extension; both the
38 * final RFC version
39 * (<a href="http://tools.ietf.org/html/rfc5464">RFC 5464</a>)
40 * and the older, incompatible draft version (known as ANNOTATEMORE)
41 * (<a
42 * href="http://tools.ietf.org/html/draft-daboo-imap-annotatemore-07"
43 * >draft-daboo-imap-annotatemore-07</a>).
44 *
45 * This class cannot be used directly, you must subclass it and reimplement
46 * at least the doStart() method.
47*/
48class KIMAP2_EXPORT MetaDataJobBase : public Job
49{
50 Q_OBJECT
51 Q_DECLARE_PRIVATE(MetaDataJobBase)
52
53 friend class SessionPrivate;
54
55public:
56 explicit MetaDataJobBase(Session *session);
57 virtual ~MetaDataJobBase();
58
59 /**
60 * Represents the capability level of the server.
61 */
63 /**
64 * Used to indicate that the server supports the RFC 5464 version
65 * of the extension.
66 *
67 * This corresponds to the METADATA server capability.
68 */
69 Metadata = 0,
70 /**
71 * Used to indicate that the server supports the
72 * draft-daboo-imap-annotatemore-07 version of the extension.
73 *
74 * This corresponds to the ANNOTATEMORE server capability.
75 */
76 Annotatemore
77 };
78
79 /**
80 * Set the mailbox to act on
81 *
82 * This may be an empty string, in which case metadata for the
83 * server (rather than a specific mailbox) will be retrieved.
84 *
85 * @param mailBox the name of an existing mailbox, or an empty string
86 */
87 void setMailBox(const QString &mailBox);
88 /**
89 * The mailbox that will be acted upon.
90 *
91 * If this is an empty string, server metadata will be retrieved.
92 *
93 * @return a mailbox name, or an empty string
94 */
95 QString mailBox() const;
96
97 /**
98 * Set what version of the metadata extension to be compatible with.
99 *
100 * This will determine the commands that will be sent to the server.
101 *
102 * The draft for the metadata extension changed in an incompatible
103 * way between versions 7 and 8, and some servers support version 7.
104 * It should be possible to check which version the server supports
105 * using CapabilityJob: servers implementing
106 * draft-daboo-imap-annotatemore-07 should advertise the
107 * ANNOTATEMORE capability, whereas servers implementing the final
108 * RFC 5464 should advertise the METADATA capability.
109 *
110 * The default mode is Metadata.
111 *
112 * @param capability the version of the extension implemented by the server
113 */
114 void setServerCapability(ServerCapability capability);
115 /**
116 * The version of the metadata extension that will be used.
117 */
118 ServerCapability serverCapability() const;
119
120protected:
121 MetaDataJobBase(JobPrivate &dd);
122
123};
124
125}
126
127#endif
Base class for jobs that operate on mailbox metadata.
ServerCapability
Represents the capability level of the server.
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Tue Mar 26 2024 11:21:18 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.