1 | /* |
2 | Copyright 2009 Constantin Berzan <exit3219@gmail.com> |
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_SPECIALCOLLECTIONATTRIBUTE_P_H |
21 | #define AKONADI_SPECIALCOLLECTIONATTRIBUTE_P_H |
22 | |
23 | #include "akonadi_export.h" |
24 | |
25 | #include <akonadi/attribute.h> |
26 | |
27 | #include <QtCore/QByteArray> |
28 | |
29 | namespace Akonadi { |
30 | |
31 | /** |
32 | * @short An Attribute that stores the special collection type of a collection. |
33 | * |
34 | * All collections registered with SpecialCollections must have this attribute set. |
35 | * |
36 | * @author Constantin Berzan <exit3219@gmail.com> |
37 | * @since 4.4 |
38 | */ |
39 | class AKONADI_EXPORT SpecialCollectionAttribute : public Akonadi::Attribute |
40 | { |
41 | public: |
42 | /** |
43 | * Creates a new special collection attribute. |
44 | */ |
45 | explicit SpecialCollectionAttribute(const QByteArray &type = QByteArray()); |
46 | |
47 | /** |
48 | * Destroys the special collection attribute. |
49 | */ |
50 | virtual ~SpecialCollectionAttribute(); |
51 | |
52 | /** |
53 | * Sets the special collections @p type of the collection. |
54 | */ |
55 | void setCollectionType(const QByteArray &type); |
56 | |
57 | /** |
58 | * Returns the special collections type of the collection. |
59 | */ |
60 | QByteArray collectionType() const; |
61 | |
62 | /* reimpl */ |
63 | virtual SpecialCollectionAttribute *clone() const; |
64 | virtual QByteArray type() const; |
65 | virtual QByteArray serialized() const; |
66 | virtual void deserialize(const QByteArray &data); |
67 | |
68 | private: |
69 | //@cond PRIVATE |
70 | class Private; |
71 | Private *const d; |
72 | //@endcond |
73 | }; |
74 | |
75 | } // namespace Akonadi |
76 | |
77 | #endif // AKONADI_SPECIALCOLLECTIONATTRIBUTE_H |
78 | |