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 KIMAP_CREATEJOB_H
21#define KIMAP_CREATEJOB_H
22
23#include "kimap_export.h"
24
25#include "job.h"
26
27namespace KIMAP {
28
29class Session;
30struct Message;
31class CreateJobPrivate;
32
33/**
34 * Creates a new mailbox
35 *
36 * This job can only be run when the session is in the
37 * authenticated (or selected) state.
38 *
39 * This job will fail if the mailbox already exists.
40 *
41 * If the server supports ACLs, the user must have the
42 * Acl::CreateMailbox permission on the parent
43 * mailbox. Note that what is meant by "parent mailbox"
44 * depends on the server: . and / are typical hierachy
45 * delimiters.
46 */
47class KIMAP_EXPORT CreateJob : public Job
48{
49 Q_OBJECT
50 Q_DECLARE_PRIVATE( CreateJob )
51
52 friend class SessionPrivate;
53
54 public:
55 explicit CreateJob( Session *session );
56 virtual ~CreateJob();
57
58 /**
59 * Set the name of the new mailbox
60 *
61 * @param mailBox an (unquoted) identifier that does not correspond
62 * to an existing mailbox name
63 */
64 void setMailBox( const QString &mailBox );
65 /**
66 * The name of the mailbox that will be created
67 */
68 QString mailBox() const;
69
70 protected:
71 virtual void doStart();
72};
73
74}
75
76#endif
77