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/>.
17
#include "libhud_client_stub.h"
19
HudClientQuery *HudClientStub::m_query;
20
guint HudClientStub::m_querySignalToolbarUpdated;
21
int HudClientStub::m_lastExecutedToolbarItem;
22
QString HudClientStub::m_lastSetQuery;
23
int HudClientStub::m_lastExecutedCommandRow;
24
int HudClientStub::m_lastExecutedParametrizedCommandRow;
25
bool HudClientStub::m_lastParametrizedCommandCommited;
26
QVariantMap HudClientStub::m_activatedActions;
27
bool HudClientStub::m_helpToolbarItemEnabled = true;
29
int HudClientStub::lastExecutedToolbarItem() const
31
return m_lastExecutedToolbarItem;
34
QString HudClientStub::lastSetQuery() const
36
return m_lastSetQuery;
39
int HudClientStub::lastExecutedCommandRow() const
41
return m_lastExecutedCommandRow;
44
int HudClientStub::lastExecutedParametrizedCommandRow() const
46
return m_lastExecutedParametrizedCommandRow;
49
bool HudClientStub::lastParametrizedCommandCommited() const
51
return m_lastParametrizedCommandCommited;
54
QVariantMap HudClientStub::activatedActions() const
56
return m_activatedActions;
59
void HudClientStub::reset()
61
m_lastExecutedToolbarItem = -1;
62
m_lastSetQuery.clear();
63
m_lastExecutedCommandRow = -1;
64
m_lastExecutedParametrizedCommandRow = -1;
65
m_lastParametrizedCommandCommited = false;
66
m_activatedActions.clear();
69
int HudClientStub::fullScreenToolbarItemValue() const
71
return HUD_CLIENT_QUERY_TOOLBAR_FULLSCREEN;
74
int HudClientStub::helpToolbarItemValue() const
76
return HUD_CLIENT_QUERY_TOOLBAR_HELP;
79
int HudClientStub::preferencesToolbarItemValue() const
81
return HUD_CLIENT_QUERY_TOOLBAR_PREFERENCES;
84
int HudClientStub::undoToolbarItemValue() const
86
return HUD_CLIENT_QUERY_TOOLBAR_UNDO;
89
void HudClientStub::setHelpToolbarItemEnabled(bool enabled) const
91
m_helpToolbarItemEnabled = enabled;
92
g_signal_emit(G_OBJECT(m_query), m_querySignalToolbarUpdated, 0);