1 | /* |
2 | Copyright (c) 2009 Kevin Ottens <ervin@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_STOREJOB_H |
21 | #define KIMAP_STOREJOB_H |
22 | |
23 | #include "kimap_export.h" |
24 | |
25 | #include "job.h" |
26 | #include "imapset.h" |
27 | |
28 | namespace KIMAP { |
29 | |
30 | class Session; |
31 | struct Message; |
32 | class StoreJobPrivate; |
33 | |
34 | typedef QList<QByteArray> MessageFlags; |
35 | |
36 | class KIMAP_EXPORT StoreJob : public Job |
37 | { |
38 | Q_OBJECT |
39 | Q_DECLARE_PRIVATE( StoreJob ) |
40 | |
41 | friend class SessionPrivate; |
42 | |
43 | public: |
44 | enum StoreMode { |
45 | SetFlags, |
46 | AppendFlags, |
47 | RemoveFlags |
48 | }; |
49 | |
50 | explicit StoreJob( Session *session ); |
51 | virtual ~StoreJob(); |
52 | |
53 | void setSequenceSet( const ImapSet &set ); |
54 | ImapSet sequenceSet() const; |
55 | |
56 | void setUidBased( bool uidBased ); |
57 | bool isUidBased() const; |
58 | |
59 | void setFlags( const MessageFlags &flags ); |
60 | MessageFlags flags() const; |
61 | |
62 | void setGMLabels( const MessageFlags &gmLabels ); |
63 | MessageFlags gmLabels() const; |
64 | |
65 | void setMode( StoreMode mode ); |
66 | StoreMode mode() const; |
67 | |
68 | QMap<int, MessageFlags> resultingFlags() const; |
69 | |
70 | protected: |
71 | virtual void doStart(); |
72 | virtual void handleResponse(const Message &response); |
73 | }; |
74 | |
75 | } |
76 | |
77 | #endif |
78 | |