1 | /* |
2 | Copyright (c) 2007 Tobias Koenig <tokoe@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 AKONADI_COLLECTIONRIGHTSATTRIBUTE_P_H |
21 | #define AKONADI_COLLECTIONRIGHTSATTRIBUTE_P_H |
22 | |
23 | #include "akonadi_export.h" |
24 | |
25 | #include <akonadi/collection.h> |
26 | #include <akonadi/attribute.h> |
27 | |
28 | namespace Akonadi { |
29 | |
30 | /** |
31 | * @internal |
32 | * |
33 | * @short Attribute that stores the rights of a collection. |
34 | * |
35 | * Every collection can have rights set which describes whether |
36 | * the collection is readable or writable. That information is stored |
37 | * in this custom attribute. |
38 | * |
39 | * @note You shouldn't use this class directly but the convenience methods |
40 | * Collection::rights() and Collection::setRights() instead. |
41 | * |
42 | * @author Tobias Koenig <tokoe@kde.org> |
43 | */ |
44 | class AKONADI_EXPORT CollectionRightsAttribute : public Attribute |
45 | { |
46 | public: |
47 | /** |
48 | * Creates a new collection rights attribute. |
49 | */ |
50 | CollectionRightsAttribute(); |
51 | |
52 | /** |
53 | * Destroys the collection rights attribute. |
54 | */ |
55 | ~CollectionRightsAttribute(); |
56 | |
57 | /** |
58 | * Sets the @p rights of the collection. |
59 | */ |
60 | void setRights(Collection::Rights rights); |
61 | |
62 | /** |
63 | * Returns the rights of the collection. |
64 | */ |
65 | Collection::Rights rights() const; |
66 | |
67 | virtual QByteArray type() const; |
68 | |
69 | virtual CollectionRightsAttribute *clone() const; |
70 | |
71 | virtual QByteArray serialized() const; |
72 | |
73 | virtual void deserialize(const QByteArray &); |
74 | |
75 | private: |
76 | //@cond PRIVATE |
77 | class Private; |
78 | Private *const d; |
79 | //@endcond |
80 | }; |
81 | |
82 | } |
83 | |
84 | #endif |
85 | |