Libksieve

response.h
1 /*
2  Copyright (c) 2010 Klarälvdalens Datakonsult AB, a KDAB Group company <[email protected]>
3  Author: Volker Krause <[email protected]>
4 
5  This library is free software; you can redistribute it and/or modify it
6  under the terms of the GNU Library General Public License as published by
7  the Free Software Foundation; either version 2 of the License, or (at your
8  option) any later version.
9 
10  This library is distributed in the hope that it will be useful, but WITHOUT
11  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12  FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
13  License for more details.
14 
15  You should have received a copy of the GNU Library General Public License
16  along with this library; see the file COPYING.LIB. If not, write to the
17  Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
18  02110-1301, USA.
19 */
20 
21 #ifndef KSIEVE_KMANAGESIEVE_RESPONSE_H
22 #define KSIEVE_KMANAGESIEVE_RESPONSE_H
23 
24 #include <QByteArray>
25 
26 namespace KManageSieve {
30 class Response
31 {
32 public:
33  enum Type {
34  None,
35  KeyValuePair,
36  Action,
37  Quantity
38  };
39 
40  Response()
41  : m_type(None)
42  , m_quantity(0)
43  {
44  }
45 
46  Type type() const;
47  QByteArray action() const;
48  uint quantity() const;
49  QByteArray key() const;
50  QByteArray value() const;
51  QByteArray extra() const;
52 
53  enum Result {
54  Ok,
55  No,
56  Bye,
57  Other
58  };
59 
60  Result operationResult() const;
61  bool operationSuccessful() const;
62 
63  void clear();
64  bool parseResponse(const QByteArray &line);
65 
66 private:
67  Type m_type;
68  uint m_quantity;
69  QByteArray m_key;
70  QByteArray m_value;
71  QByteArray m_extra;
72 };
73 }
74 
75 #endif
A response from a managesieve server.
Definition: response.h:30
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jul 13 2020 23:08:34 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.