on d07cfbe help sign in
unity8/tests/mocks/Unity/Launcher/MockAppDrawerModel.h
43 lines 1.4 kB history raw
1/*
2 * Copyright (C) 2016 Canonical, Ltd.
3 * Copyright (C) 2020 UBports Foundation.
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; version 3.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
18#include <unity/shell/launcher/AppDrawerModelInterface.h>
20#include "MockLauncherItem.h"
22class MockAppDrawerModel: public AppDrawerModelInterface
24 Q_OBJECT
25 // TODO: Add this to AppDrawerModelInterface in unity-api.
26 // Or, better yet, remove AppDrawerModelInterface from unity-api.
27 Q_PROPERTY(bool refreshing READ refreshing NOTIFY refreshingChanged)
28public:
29 MockAppDrawerModel(QObject* parent = nullptr);
31 int rowCount(const QModelIndex &parent) const override;
32 QVariant data(const QModelIndex &index, int role) const override;
34 bool refreshing();
35 Q_INVOKABLE void refresh();
37Q_SIGNALS:
38 void refreshingChanged();
40private:
41 QList<MockLauncherItem*> m_list;
42 bool m_refresing;
43};