~unity-team/unity8/trunk

« back to all changes in this revision

Viewing changes to tests/qmltests/plugins/HudClient/libhud_client_stub.cpp

  • Committer: Michał Sawicz
  • Date: 2013-06-05 22:03:08 UTC
  • Revision ID: michal.sawicz@canonical.com-20130605220308-yny8fv3futtr04fg
Inital unity8 commit.

Previous history can be found at https://code.launchpad.net/~unity-team/unity/phablet

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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
 */
 
16
 
 
17
#include "libhud_client_stub.h"
 
18
 
 
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;
 
28
 
 
29
int HudClientStub::lastExecutedToolbarItem() const
 
30
{
 
31
    return m_lastExecutedToolbarItem;
 
32
}
 
33
 
 
34
QString HudClientStub::lastSetQuery() const
 
35
{
 
36
    return m_lastSetQuery;
 
37
}
 
38
 
 
39
int HudClientStub::lastExecutedCommandRow() const
 
40
{
 
41
    return m_lastExecutedCommandRow;
 
42
}
 
43
 
 
44
int HudClientStub::lastExecutedParametrizedCommandRow() const
 
45
{
 
46
    return m_lastExecutedParametrizedCommandRow;
 
47
}
 
48
 
 
49
bool HudClientStub::lastParametrizedCommandCommited() const
 
50
{
 
51
    return m_lastParametrizedCommandCommited;
 
52
}
 
53
 
 
54
QVariantMap HudClientStub::activatedActions() const
 
55
{
 
56
    return m_activatedActions;
 
57
}
 
58
 
 
59
void HudClientStub::reset()
 
60
{
 
61
    m_lastExecutedToolbarItem = -1;
 
62
    m_lastSetQuery.clear();
 
63
    m_lastExecutedCommandRow = -1;
 
64
    m_lastExecutedParametrizedCommandRow = -1;
 
65
    m_lastParametrizedCommandCommited = false;
 
66
    m_activatedActions.clear();
 
67
}
 
68
 
 
69
int HudClientStub::fullScreenToolbarItemValue() const
 
70
{
 
71
    return HUD_CLIENT_QUERY_TOOLBAR_FULLSCREEN;
 
72
}
 
73
 
 
74
int HudClientStub::helpToolbarItemValue() const
 
75
{
 
76
    return HUD_CLIENT_QUERY_TOOLBAR_HELP;
 
77
}
 
78
 
 
79
int HudClientStub::preferencesToolbarItemValue() const
 
80
{
 
81
    return HUD_CLIENT_QUERY_TOOLBAR_PREFERENCES;
 
82
}
 
83
 
 
84
int HudClientStub::undoToolbarItemValue() const
 
85
{
 
86
    return HUD_CLIENT_QUERY_TOOLBAR_UNDO;
 
87
}
 
88
 
 
89
void HudClientStub::setHelpToolbarItemEnabled(bool enabled) const
 
90
{
 
91
    m_helpToolbarItemEnabled = enabled;
 
92
    g_signal_emit(G_OBJECT(m_query), m_querySignalToolbarUpdated, 0);
 
93
}