File indexing completed on 2024-05-12 04:19:48

0001 // vim: set tabstop=4 shiftwidth=4 expandtab:
0002 /*
0003 Gwenview: an image viewer
0004 Copyright 2008 Aurélien Gâteau <agateau@kde.org>
0005 Copyright 2014 Vishesh Handa <me@vhanda.in>
0006 
0007 This program is free software; you can redistribute it and/or
0008 modify it under the terms of the GNU General Public License
0009 as published by the Free Software Foundation; either version 2
0010 of the License, or (at your option) any later version.
0011 
0012 This program is distributed in the hope that it will be useful,
0013 but WITHOUT ANY WARRANTY; without even the implied warranty of
0014 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
0015 GNU General Public License for more details.
0016 
0017 You should have received a copy of the GNU General Public License
0018 along with this program; if not, write to the Free Software
0019 Foundation, Inc., 51 Franklin Street, Fifth Floor, Cambridge, MA 02110-1301, USA.
0020 
0021 */
0022 #ifndef BALOOSEMANTICINFOBACKEND_H
0023 #define BALOOSEMANTICINFOBACKEND_H
0024 
0025 #include <lib/gwenviewlib_export.h>
0026 
0027 // Qt
0028 
0029 // KF
0030 
0031 // Local
0032 #include "abstractsemanticinfobackend.h"
0033 
0034 namespace Gwenview
0035 {
0036 /**
0037  * A real metadata backend using Baloo to store and retrieve metadata.
0038  */
0039 class GWENVIEWLIB_EXPORT BalooSemanticInfoBackend : public AbstractSemanticInfoBackEnd
0040 {
0041     Q_OBJECT
0042 public:
0043     explicit BalooSemanticInfoBackend(QObject *parent);
0044     ~BalooSemanticInfoBackend() override;
0045 
0046     TagSet allTags() const override;
0047 
0048     void refreshAllTags() override;
0049 
0050     void storeSemanticInfo(const QUrl &, const SemanticInfo &) override;
0051 
0052     void retrieveSemanticInfo(const QUrl &) override;
0053 
0054     QString labelForTag(const SemanticInfoTag &) const override;
0055 
0056     SemanticInfoTag tagForLabel(const QString &) override;
0057 
0058 private:
0059     struct Private;
0060     Private *const d;
0061 };
0062 
0063 } // namespace
0064 
0065 #endif /* BALOOSEMANTICINFOBACKEND_H */