fixed bug #211392: Incorrect rotation angle after annotating multiple
[kphotoalbum.git] / SQLDB / SQLImageInfoCollection.h
blob4368a3e73b6fc28dfc712a8f6bf7d47bafe437c4
1 /*
2 Copyright (C) 2006 Tuomas Suutari <thsuut@utu.fi>
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful, but
10 WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program (see the file COPYING); if not, write to the
16 Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
17 MA 02110-1301 USA.
20 #ifndef SQLIMAGEINFOCOLLECTION_H
21 #define SQLIMAGEINFOCOLLECTION_H
23 #include "DB/ImageInfoPtr.h"
24 #include "QueryHelper.h"
25 #include "DB/ResultId.h"
26 #include <qobject.h>
27 #include <qmap.h>
28 //#include <qmutex.h>
29 namespace DB { class Category; }
31 namespace SQLDB {
32 class SQLImageInfoCollection: public QObject
34 Q_OBJECT
36 public:
37 explicit SQLImageInfoCollection(QueryHelper& queryHelper);
38 ~SQLImageInfoCollection();
39 DB::ImageInfoPtr getImageInfoOf(const QString& relativeFilename) const;
40 DB::ImageInfoPtr getImageInfoOf(const DB::ResultId& id) const;
41 QString filenameForId(DB::RawId id) const;
42 void setLock(const DB::ImageSearchInfo& scope, bool invert=false);
43 void unsetLock();
44 void clearCache();
46 public slots:
47 void deleteTag(DB::Category* category, const QString& item);
48 void renameTag(DB::Category* category,
49 const QString& oldName, const QString& newName);
51 protected:
52 void setLocking(DB::ImageInfoPtr p) const;
53 void updateLockingInfo() const;
54 QueryHelper& _qh;
56 private:
57 mutable QMap<QString, DB::RawId> _filenameIdMap;
58 mutable QMap<DB::RawId, QString> _idFilenameMap;
59 mutable QMap<DB::RawId, DB::ImageInfoPtr> _infoPointers;
60 // mutable QMutex _mutex;
61 DB::ImageSearchInfo* _lockingScope;
62 bool _invertLock;
66 #endif /* SQLIMAGEINFOCOLLECTION_H */