kpmcore/src/backend/corebackendmanager.h

85 lines
2.5 KiB
C
Raw Normal View History

/*************************************************************************
* Copyright (C) 2010 by Volker Lanz <vl@fidra.de> *
* *
* This program is free software; you can redistribute it and/or *
* modify it under the terms of the GNU General Public License as *
* published by the Free Software Foundation; either version 3 of *
* the License, or (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program. If not, see <http://www.gnu.org/licenses/>.*
*************************************************************************/
#if !defined(KPMCORE_COREBACKENDMANAGER_H)
#define KPMCORE_COREBACKENDMANAGER_H
2016-05-06 22:36:24 +01:00
#include "util/libpartitionmanagerexport.h"
2017-10-01 21:57:03 +01:00
#include <QVector>
class QString;
class QStringList;
2017-10-01 21:57:03 +01:00
class KPluginMetaData;
class CoreBackend;
/**
* The backend manager class.
*
* This is basically a singleton class to give the application access to the currently
* selected backend and also to manage the available backend plugins.
* @author Volker Lanz <vl@fidra.de>
*/
class LIBKPMCORE_EXPORT CoreBackendManager
{
2015-07-13 15:16:36 +01:00
private:
CoreBackendManager();
2015-07-13 15:16:36 +01:00
public:
/**
* @return pointer to ourselves
*/
static CoreBackendManager* self();
2015-07-13 15:16:36 +01:00
/**
* @return the name of the default backend plugin
*/
static QString defaultBackendName() {
return QStringLiteral("pmlibpartedbackendplugin");
}
2015-07-13 15:16:36 +01:00
/**
* @return a list of available backend plugins
*/
2017-10-01 21:57:03 +01:00
QVector<KPluginMetaData> list() const;
2015-07-13 15:16:36 +01:00
/**
* Loads the given backend plugin into the application.
* @param name the name of the plugin to load
* @return true on success
*/
bool load(const QString& name);
2015-07-13 15:16:36 +01:00
/**
* Unload the current plugin.
*/
void unload();
2015-07-13 15:16:36 +01:00
/**
* @return a pointer to the currently loaded backend
*/
CoreBackend* backend() {
return m_Backend;
}
2015-07-13 15:16:36 +01:00
private:
CoreBackend* m_Backend;
};
#endif