File indexing completed on 2025-01-19 03:53:46

0001 /* ============================================================
0002  *
0003  * This file is a part of digiKam project
0004  * https://www.digikam.org
0005  *
0006  * Date        : 2007-04-15
0007  * Description : Thumbnails database backend
0008  *
0009  * SPDX-FileCopyrightText: 2007-2009 by Marcel Wiesweg <marcel dot wiesweg at gmx dot de>
0010  * SPDX-FileCopyrightText: 2010-2024 by Gilles Caulier <caulier dot gilles at gmail dot com>
0011  *
0012  * SPDX-License-Identifier: GPL-2.0-or-later
0013  *
0014  * ============================================================ */
0015 
0016 #ifndef DIGIKAM_THUMBS_DB_BACKEND_H
0017 #define DIGIKAM_THUMBS_DB_BACKEND_H
0018 
0019 // Local includes
0020 
0021 #include "digikam_export.h"
0022 #include "dbenginebackend.h"
0023 
0024 namespace Digikam
0025 {
0026 
0027 class ThumbsDbSchemaUpdater;
0028 
0029 class DIGIKAM_EXPORT ThumbsDbBackend : public BdEngineBackend
0030 {
0031     Q_OBJECT
0032 
0033 public:
0034 
0035     explicit ThumbsDbBackend(DbEngineLocking* const locking,
0036                              const QString& backendName = QLatin1String("thumbnailDatabase-"));
0037     ~ThumbsDbBackend() override;
0038 
0039     /**
0040      * Initialize the database schema to the current version,
0041      * carry out upgrades if necessary.
0042      * Shall only be called from the thread that called open().
0043      */
0044     bool initSchema(ThumbsDbSchemaUpdater* const updater);
0045 
0046 private:
0047 
0048     // Disabled
0049     explicit ThumbsDbBackend(QObject*) = delete;
0050 
0051     Q_DECLARE_PRIVATE(BdEngineBackend)
0052 };
0053 
0054 } // namespace Digikam
0055 
0056 #endif // DIGIKAM_THUMBS_DB_BACKEND_H