~ubuntu-multiseat/ubuntu/saucy/unity-greeter/bug1201122

« back to all changes in this revision

Viewing changes to tests/unity-greeter.vala

Tags: upstream-12.10.3
ImportĀ upstreamĀ versionĀ 12.10.3

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* -*- Mode: Vala; indent-tabs-mode: nil; tab-width: 4 -*-
 
2
 *
 
3
 * Copyright (C) 2011 Canonical Ltd
 
4
 *
 
5
 * This program is free software: you can redistribute it and/or modify
 
6
 * it under the terms of the GNU General Public License version 3 as
 
7
 * published by the Free Software Foundation.
 
8
 *
 
9
 * This program is distributed in the hope that it will be useful,
 
10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
12
 * GNU General Public License for more details.
 
13
 *
 
14
 * You should have received a copy of the GNU General Public License
 
15
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
16
 *
 
17
 * Authored by: Robert Ancell <robert.ancell@canonical.com>
 
18
 */
 
19
 
 
20
public const int grid_size = 40;
 
21
 
 
22
public class UnityGreeter
 
23
{
 
24
    public static UnityGreeter singleton;
 
25
 
 
26
    public signal void show_message (string text, LightDM.MessageType type);
 
27
    public signal void show_prompt (string text, LightDM.PromptType type);
 
28
    public signal void authentication_complete ();
 
29
 
 
30
    public bool test_mode = false;
 
31
    public bool session_started = false;
 
32
    public string last_respond_response;
 
33
 
 
34
    public bool is_authenticated ()
 
35
    {
 
36
        return false;
 
37
    }
 
38
 
 
39
    public void authenticate (string? userid = null)
 
40
    {
 
41
    }
 
42
 
 
43
    public void authenticate_as_guest ()
 
44
    {
 
45
    }
 
46
 
 
47
    public void authenticate_remote (string? session, string? userid)
 
48
    {
 
49
    }
 
50
 
 
51
    public void cancel_authentication ()
 
52
    {
 
53
    }
 
54
 
 
55
    public void respond (string response)
 
56
    {
 
57
        last_respond_response = response;
 
58
    }
 
59
 
 
60
    public string authentication_user ()
 
61
    {
 
62
        return "";
 
63
    }
 
64
 
 
65
    public string default_session_hint ()
 
66
    {
 
67
        return "";
 
68
    }
 
69
 
 
70
    public string select_user_hint ()
 
71
    {
 
72
        return "";
 
73
    }
 
74
 
 
75
    public bool show_manual_login_hint ()
 
76
    {
 
77
        return false;
 
78
    }
 
79
 
 
80
    public bool hide_users_hint ()
 
81
    {
 
82
        return false;
 
83
    }
 
84
 
 
85
    public bool has_guest_account_hint ()
 
86
    {
 
87
        return false;
 
88
    }
 
89
 
 
90
    public void start_session (string? session)
 
91
    {
 
92
        session_started = true;
 
93
    }
 
94
 
 
95
    public void push_list (GreeterList widget)
 
96
    {
 
97
    }
 
98
 
 
99
    public void pop_list ()
 
100
    {
 
101
    }
 
102
 
 
103
    public string? get_state (string key)
 
104
    {
 
105
        return null;
 
106
    }
 
107
 
 
108
    public void set_state (string key, string value)
 
109
    {
 
110
    }
 
111
 
 
112
    public static LightDM.Layout? get_layout_by_name (string name)
 
113
    {
 
114
        foreach (var layout in LightDM.get_layouts ())
 
115
        {
 
116
            if (layout.name == name)
 
117
                return layout;
 
118
        }
 
119
        return null;
 
120
    }
 
121
 
 
122
    public static void add_style_class (Gtk.Widget widget)
 
123
    {
 
124
        /* Add style context class lightdm-user-list */
 
125
        var ctx = widget.get_style_context ();
 
126
        ctx.add_class ("lightdm");
 
127
    }
 
128
}