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