on 551c708 help sign in
unity8/plugins/HudClient/hudclient.h
71 lines 2.1 kB history raw
1/*
2 * Copyright (C) 2012, 2013 Canonical, Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
17#ifndef HUDCLIENT_H
18#define HUDCLIENT_H
20#include <QObject>
22#include <hud-client.h>
24class DeeListModel;
25class QAbstractItemModel;
27class HudClient : public QObject
29 Q_OBJECT
30 Q_PROPERTY(DeeListModel* results READ results)
31 Q_PROPERTY(QAbstractItemModel* toolBarModel READ toolBarModel)
33public:
34 HudClient();
35 ~HudClient();
37 DeeListModel *results() const;
39 QAbstractItemModel *toolBarModel() const;
41 Q_INVOKABLE void executeCommand(int index);
42 Q_INVOKABLE void setQuery(const QString &new_query);
43 Q_INVOKABLE void startVoiceQuery();
44 Q_INVOKABLE void executeParametrizedAction(const QVariant &values);
45 Q_INVOKABLE void updateParametrizedAction(const QVariant &values);
46 Q_INVOKABLE void cancelParametrizedAction();
47 Q_INVOKABLE void executeToolBarAction(HudClientQueryToolbarItems action);
49 void modelReady(bool needDisconnect);
50 void modelReallyReady(bool needDisconnect);
51 void queryModelsChanged();
53Q_SIGNALS:
54 void voiceQueryLoading();
55 void voiceQueryListening();
56 void voiceQueryHeardSomething();
57 void voiceQueryFailed();
58 void voiceQueryFinished(const QString &query);
59 void commandExecuted();
60 void showParametrizedAction(const QString &action, const QVariant &items);
62private:
63 HudClientQuery *m_clientQuery;
64 DeeListModel *m_results;
65 QAbstractItemModel *m_toolBarModel;
66 int m_currentActionIndex;
67 HudClientParam *m_currentActionParam;
68};
69Q_DECLARE_METATYPE(HudClientQueryToolbarItems)
71#endif