1
/****************************************************************************
2
* Copyright (C) 2014 by Savoir-Faire Linux *
3
* Author : Emmanuel Lepage Vallee <emmanuel.lepage@savoirfairelinux.com> *
5
* This library is free software; you can redistribute it and/or *
6
* modify it under the terms of the GNU Lesser General Public *
7
* License as published by the Free Software Foundation; either *
8
* version 2.1 of the License, or (at your option) any later version. *
10
* This library is distributed in the hope that it will be useful, *
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
13
* Lesser General Public License for more details. *
15
* You should have received a copy of the GNU General Public License *
16
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
17
***************************************************************************/
18
#ifndef COMMONBACKENDMANAGERINTERFACE_H
19
#define COMMONBACKENDMANAGERINTERFACE_H
23
class CommonItemBackendModel;
27
FORCE_ENABLED = 0x1 << 0,
28
FORCE_DISABLED = 0x1 << 1,
31
template <class T> class LIB_EXPORT CommonBackendManagerInterface {
33
virtual ~CommonBackendManagerInterface() {};
38
virtual void addBackend(T* backend, LoadOptions options = LoadOptions::NONE) = 0;
40
/// Do this manager have active backends
41
virtual bool hasEnabledBackends () const = 0;
42
virtual bool hasBackends () const = 0;
45
virtual const QVector<T*> backends () const = 0;
46
virtual const QVector<T*> enabledBackends() const = 0;
48
///Enable / disable a backend
49
virtual bool enableBackend(T* backend, bool enabled) = 0;
52
virtual CommonItemBackendModel* backendModel() const = 0;