2
* Copyright (C) 2012, 2013 Canonical, Ltd.
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.
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.
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/>.
22
#include <hud-client.h>
25
class QAbstractItemModel;
27
class HudClient : public QObject
30
Q_PROPERTY(DeeListModel* results READ results)
31
Q_PROPERTY(QAbstractItemModel* toolBarModel READ toolBarModel)
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();
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);
63
HudClientQuery *m_clientQuery;
64
DeeListModel *m_results;
65
QAbstractItemModel *m_toolBarModel;
66
int m_currentActionIndex;
67
HudClientParam *m_currentActionParam;
69
Q_DECLARE_METATYPE(HudClientQueryToolbarItems)