/*
* Copyright (C) 2013 Canonical, Ltd.
*
* 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; version 3.
*
* 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 .
*
* Author: Nick Dedekind
*/
#ifndef FAKE_SCOPES_H
#define FAKE_SCOPES_H
#include
// Local
#include "fake_scope.h"
// Qt
#include
#include
class Scopes : public unity::shell::scopes::ScopesInterface
{
Q_OBJECT
public:
explicit Scopes(QObject *parent = 0);
~Scopes();
Q_INVOKABLE int rowCount(const QModelIndex& parent = QModelIndex()) const override;
Q_INVOKABLE unity::shell::scopes::ScopeInterface* getScope(int row) const override;
Q_INVOKABLE unity::shell::scopes::ScopeInterface* getScope(const QString& scope_id) const override;
Q_INVOKABLE void addScope(Scope* scope);
Q_INVOKABLE void clear();
Q_INVOKABLE void load();
QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const;
QModelIndex parent ( const QModelIndex & index ) const;
bool loaded() const override;
private Q_SLOTS:
void updateScopes();
private:
QList m_scopes;
bool m_loaded;
QTimer timer;
};
#endif // SCOPES_H