~ubuntu-branches/debian/jessie/attica-kf5/jessie

« back to all changes in this revision

Viewing changes to src/privatedata.h

  • Committer: Package Import Robot
  • Author(s): Maximiliano Curia
  • Date: 2014-07-15 10:53:09 UTC
  • Revision ID: package-import@ubuntu.com-20140715105309-nnjxenwcs6h4qznf
Tags: upstream-5.0.0
ImportĀ upstreamĀ versionĀ 5.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
This file is part of KDE.
 
3
 
 
4
Copyright (c) 2010 Martin Sandsmark <martin.sandsmark@kde.org>
 
5
 
 
6
This library is free software; you can redistribute it and/or
 
7
modify it under the terms of the GNU Lesser General Public
 
8
License as published by the Free Software Foundation; either
 
9
version 2.1 of the License, or (at your option) version 3, or any
 
10
later version accepted by the membership of KDE e.V. (or its
 
11
successor approved by the membership of KDE e.V.), which shall
 
12
act as a proxy defined in Section 6 of version 3 of the license.
 
13
 
 
14
This library is distributed in the hope that it will be useful,
 
15
but WITHOUT ANY WARRANTY; without even the implied warranty of
 
16
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
17
Lesser General Public License for more details.
 
18
 
 
19
You should have received a copy of the GNU Lesser General Public
 
20
License along with this library.  If not, see <http://www.gnu.org/licenses/>.
 
21
 
 
22
*/
 
23
#ifndef ATTICA_PRIVATEDATA_H
 
24
#define ATTICA_PRIVATEDATA_H
 
25
 
 
26
#include "provider.h"
 
27
 
 
28
#include <QtCore/QDateTime>
 
29
#include <QtCore/QList>
 
30
#include <QtCore/QMap>
 
31
#include <QtCore/QSharedDataPointer>
 
32
#include <QtCore/QUrl>
 
33
 
 
34
#include "atticaclient_export.h"
 
35
 
 
36
namespace Attica
 
37
{
 
38
 
 
39
class ATTICA_EXPORT PrivateData
 
40
{
 
41
public:
 
42
    class Parser;
 
43
 
 
44
    typedef QList<PrivateData> List; // nonsense
 
45
 
 
46
    PrivateData();
 
47
    PrivateData(const PrivateData &other);
 
48
    PrivateData &operator=(const PrivateData &other);
 
49
    ~PrivateData();
 
50
 
 
51
    /**
 
52
     * Sets an attribute referenced by \key to \value.
 
53
     */
 
54
    void setAttribute(const QString &key, const QString &value);
 
55
 
 
56
    /**
 
57
     * Returns an attribute referenced by \key.
 
58
     */
 
59
    QString attribute(const QString &key) const;
 
60
 
 
61
    /**
 
62
     * Sets when an attribute last was changed (mostly for internal use).
 
63
     */
 
64
    void setTimestamp(const QString &key, const QDateTime &when);
 
65
 
 
66
    /**
 
67
     * Returns the date and time an attribute last was changed.
 
68
     */
 
69
    QDateTime timestamp(const QString &key) const;
 
70
 
 
71
    /**
 
72
     * Returns a list of fetched keys.
 
73
     */
 
74
    QStringList keys() const;
 
75
 
 
76
private:
 
77
    class Private;
 
78
    QSharedDataPointer<Private> d;
 
79
};
 
80
 
 
81
}
 
82
 
 
83
#endif//ATTICA_ATTRIBUTES_H