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,
20 #ifndef SQLIMAGEINFOCOLLECTION_H
21 #define SQLIMAGEINFOCOLLECTION_H
23 #include "DB/ImageInfoPtr.h"
24 #include "QueryHelper.h"
25 #include "DB/ResultId.h"
29 namespace DB
{ class Category
; }
32 class SQLImageInfoCollection
: public QObject
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);
47 void deleteTag(DB::Category
* category
, const QString
& item
);
48 void renameTag(DB::Category
* category
,
49 const QString
& oldName
, const QString
& newName
);
52 void setLocking(DB::ImageInfoPtr p
) const;
53 void updateLockingInfo() const;
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
;
66 #endif /* SQLIMAGEINFOCOLLECTION_H */