digiKam
similaritydbaccess.h
Go to the documentation of this file.
1 /* ============================================================
2  *
3  * This file is a part of digiKam project
4  * https://www.digikam.org
5  *
6  * Date : 2017-06-28
7  * Description : Similarity database access wrapper.
8  *
9  * Copyright (C) 2007-2009 by Marcel Wiesweg <marcel dot wiesweg at gmx dot de>
10  * Copyright (C) 2010-2017 by Gilles Caulier <caulier dot gilles at gmail dot com>
11  * Copyright (C) 2017 by Swati Lodha <swatilodha27 at gmail dot com>
12  * Copyright (C) 2018 by Mario Frank <mario dot frank at uni minus potsdam dot de>
13  *
14  * This program is free software; you can redistribute it
15  * and/or modify it under the terms of the GNU General
16  * Public License as published by the Free Software Foundation;
17  * either version 2, or (at your option)
18  * any later version.
19  *
20  * This program is distributed in the hope that it will be useful,
21  * but WITHOUT ANY WARRANTY; without even the implied warranty of
22  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23  * GNU General Public License for more details.
24  *
25  * ============================================================ */
26 
27 #ifndef DIGIKAM_SIMILARITY_DB_ACCESS_H
28 #define DIGIKAM_SIMILARITY_DB_ACCESS_H
29 
30 // Local includes
31 
32 #include "digikam_export.h"
33 #include "dbengineparameters.h"
34 
35 namespace Digikam
36 {
37 
38 class DbEngineErrorHandler;
39 class InitializationObserver;
40 class SimilarityDb;
41 class SimilarityDbAccessStaticPriv;
42 class SimilarityDbBackend;
43 
44 class DIGIKAM_DATABASE_EXPORT SimilarityDbAccess
45 {
46 public:
47 
52  explicit SimilarityDbAccess();
54 
55  SimilarityDb* db() const;
56  SimilarityDbBackend* backend() const;
57  QString lastError() const;
58 
62  void setLastError(const QString& error);
63 
68  static DbEngineParameters parameters();
69 
70 public:
71 
76  static void initDbEngineErrorHandler(DbEngineErrorHandler* const errorhandler);
77 
82  static void setParameters(const DbEngineParameters& parameters);
83 
89  static bool checkReadyForUse(InitializationObserver* const observer);
90 
95  static bool isInitialized();
96 
100  static void cleanUpDatabase();
101 
102 private:
103 
107  explicit SimilarityDbAccess(bool);
108 
109  static SimilarityDbAccessStaticPriv* d;
110 };
111 
112 } // namespace Digikam
113 
114 #endif // DIGIKAM_SIMILARITY_DB_ACCESS_H
Definition: dbengineerrorhandler.h:60
Definition: dbengineparameters.h:49
Definition: collectionscannerobserver.h:57
Definition: similaritydbaccess.h:45
Definition: similaritydbbackend.h:40
Definition: similaritydb.h:58
Definition: datefolderview.cpp:43