File indexing completed on 2024-12-01 07:24:55
0001 /* This file is part of the KDE project 0002 Copyright (C) 2003-2016 Jarosław Staniek <staniek@kde.org> 0003 0004 This program is free software; you can redistribute it and/or 0005 modify it under the terms of the GNU Library General Public 0006 License as published by the Free Software Foundation; either 0007 version 2 of the License, or (at your option) any later version. 0008 0009 This program is distributed in the hope that it will be useful, 0010 but WITHOUT ANY WARRANTY; without even the implied warranty of 0011 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 0012 Library General Public License for more details. 0013 0014 You should have received a copy of the GNU Library General Public License 0015 along with this program; see the file COPYING. If not, write to 0016 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 0017 * Boston, MA 02110-1301, USA. 0018 */ 0019 0020 #ifndef KDB_DRIVERMETADATA_H 0021 #define KDB_DRIVERMETADATA_H 0022 0023 #include <KPluginMetaData> 0024 0025 #include "kdb_export.h" 0026 0027 //! Provides information about a single driver plugin 0028 class KDB_EXPORT KDbDriverMetaData : public KPluginMetaData 0029 { 0030 public: 0031 ~KDbDriverMetaData(); 0032 0033 //! @return internal name of the plugin, a shortcut of pluginId() 0034 QString id() const; 0035 0036 //! @return true if the driver is for file-based databases like SQLite. 0037 /*! Defined by a "X-KDb-FileBased" field in .json information files. */ 0038 bool isFileBased() const; 0039 0040 //! @return true if the driver is for a backend that allows importing. 0041 /*! Defined by a "X-KDb-ImportingEnabled" field in .json information files. 0042 Used for database migration. */ 0043 bool isImportingEnabled() const; 0044 0045 protected: 0046 explicit KDbDriverMetaData(const QPluginLoader &loader); 0047 friend class DriverManagerInternal; 0048 0049 private: 0050 Q_DISABLE_COPY(KDbDriverMetaData) 0051 class Private; 0052 Private * const d; 0053 }; 0054 0055 #endif