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

« back to all changes in this revision

Viewing changes to tests/auto/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
/**
 
37
 * Helper class which gathers the metadata retrieved when
 
38
 * AbstractSemanticInfoBackEnd::retrieveSemanticInfo() is called.
 
39
 */
 
40
class SemanticInfoBackEndClient : public QObject
 
41
{
 
42
    Q_OBJECT
 
43
public:
 
44
    SemanticInfoBackEndClient(AbstractSemanticInfoBackEnd*);
 
45
 
 
46
    SemanticInfo semanticInfoForUrl(const KUrl& url) const {
 
47
        return mSemanticInfoForUrl.value(url);
 
48
    }
 
49
 
 
50
private Q_SLOTS:
 
51
    void slotSemanticInfoRetrieved(const KUrl&, const SemanticInfo&);
 
52
 
 
53
private:
 
54
    QHash<KUrl, SemanticInfo> mSemanticInfoForUrl;
 
55
    AbstractSemanticInfoBackEnd* mBackEnd;
 
56
};
 
57
 
 
58
class SemanticInfoBackEndTest : public QObject
 
59
{
 
60
    Q_OBJECT
 
61
 
 
62
private Q_SLOTS:
 
63
    void initTestCase();
 
64
    void init();
 
65
    void cleanup();
 
66
    void testRating();
 
67
    void testTagForLabel();
 
68
 
 
69
private:
 
70
    AbstractSemanticInfoBackEnd* mBackEnd;
 
71
};
 
72
 
 
73
} // namespace
 
74
 
 
75
#endif // SEMANTICINFOBACKENDTEST_H