~ubuntu-branches/ubuntu/precise/gwenview/precise-proposed

« back to all changes in this revision

Viewing changes to tests/semanticinfobackendtest.h

  • Committer: Package Import Robot
  • Author(s): Jonathan Riddell
  • Date: 2011-12-15 14:17:54 UTC
  • mto: This revision was merged to the branch mainline in revision 12.
  • Revision ID: package-import@ubuntu.com-20111215141754-z043hyx69dulbggf
Tags: upstream-4.7.90
Import upstream version 4.7.90

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
Gwenview: an image viewer
3
 
Copyright 2008 Aurélien Gâteau <agateau@kde.org>
4
 
 
5
 
This program is free software; you can redistribute it and/or
6
 
modify it under the terms of the GNU General Public License
7
 
as published by the Free Software Foundation; either version 2
8
 
of the License, or (at your option) any later version.
9
 
 
10
 
This program is distributed in the hope that it will be useful,
11
 
but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
 
GNU General Public License for more details.
14
 
 
15
 
You should have received a copy of the GNU General Public License
16
 
along with this program; if not, write to the Free Software
17
 
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
18
 
 
19
 
*/
20
 
#ifndef SEMANTICINFOBACKENDTEST_H
21
 
#define SEMANTICINFOBACKENDTEST_H
22
 
 
23
 
// Qt
24
 
#include <QHash>
25
 
#include <QObject>
26
 
 
27
 
// KDE
28
 
#include <kurl.h>
29
 
 
30
 
// Local
31
 
#include <lib/semanticinfo/abstractsemanticinfobackend.h>
32
 
 
33
 
namespace Gwenview {
34
 
 
35
 
/**
36
 
 * Helper class which gathers the metadata retrieved when
37
 
 * AbstractSemanticInfoBackEnd::retrieveSemanticInfo() is called.
38
 
 */
39
 
class SemanticInfoBackEndClient : public QObject {
40
 
        Q_OBJECT
41
 
public:
42
 
        SemanticInfoBackEndClient(AbstractSemanticInfoBackEnd*);
43
 
 
44
 
        SemanticInfo semanticInfoForUrl(const KUrl& url) const {
45
 
                return mSemanticInfoForUrl.value(url);
46
 
        }
47
 
 
48
 
private Q_SLOTS:
49
 
        void slotSemanticInfoRetrieved(const KUrl&, const SemanticInfo&);
50
 
 
51
 
private:
52
 
        QHash<KUrl, SemanticInfo> mSemanticInfoForUrl;
53
 
        AbstractSemanticInfoBackEnd* mBackEnd;
54
 
};
55
 
 
56
 
 
57
 
class SemanticInfoBackEndTest : public QObject {
58
 
        Q_OBJECT
59
 
 
60
 
private Q_SLOTS:
61
 
        void initTestCase();
62
 
        void init();
63
 
        void cleanup();
64
 
        void testRating();
65
 
        void testTagForLabel();
66
 
 
67
 
private:
68
 
        AbstractSemanticInfoBackEnd* mBackEnd;
69
 
};
70
 
 
71
 
} // namespace
72
 
 
73
 
#endif // SEMANTICINFOBACKENDTEST_H