1 | /* |
2 | This file is part of KDE. |
3 | |
4 | SPDX-FileCopyrightText: 2010 Martin Sandsmark <martin.sandsmark@kde.org> |
5 | |
6 | SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL |
7 | */ |
8 | #ifndef ATTICA_PRIVATEDATA_H |
9 | #define ATTICA_PRIVATEDATA_H |
10 | |
11 | #include "provider.h" |
12 | |
13 | #include <QDateTime> |
14 | #include <QList> |
15 | #include <QMap> |
16 | #include <QSharedDataPointer> |
17 | #include <QUrl> |
18 | |
19 | #include "attica_export.h" |
20 | |
21 | namespace Attica |
22 | { |
23 | |
24 | /*! |
25 | * \class Attica::PrivateData |
26 | * \inheaderfile Attica/PrivateData |
27 | * \inmodule Attica |
28 | * |
29 | * \brief Represents private data. |
30 | */ |
31 | class ATTICA_EXPORT PrivateData |
32 | { |
33 | public: |
34 | class Parser; |
35 | |
36 | /*! |
37 | * |
38 | */ |
39 | typedef QList<PrivateData> List; // nonsense |
40 | |
41 | /*! |
42 | * |
43 | */ |
44 | PrivateData(); |
45 | PrivateData(const PrivateData &other); |
46 | PrivateData &operator=(const PrivateData &other); |
47 | ~PrivateData(); |
48 | |
49 | /*! |
50 | * Sets an attribute referenced by \a key to \a value. |
51 | */ |
52 | void setAttribute(const QString &key, const QString &value); |
53 | |
54 | /*! |
55 | * Returns an attribute referenced by \a key. |
56 | */ |
57 | QString attribute(const QString &key) const; |
58 | |
59 | /*! |
60 | * Sets when an attribute last was changed (mostly for internal use). |
61 | */ |
62 | void setTimestamp(const QString &key, const QDateTime &when); |
63 | |
64 | /*! |
65 | * Returns the date and time an attribute last was changed. |
66 | */ |
67 | QDateTime timestamp(const QString &key) const; |
68 | |
69 | /*! |
70 | * Returns a list of fetched keys. |
71 | */ |
72 | QStringList keys() const; |
73 | |
74 | private: |
75 | class Private; |
76 | QSharedDataPointer<Private> d; |
77 | }; |
78 | |
79 | } |
80 | |
81 | #endif // ATTICA_ATTRIBUTES_H |
82 | |