~ubuntu-branches/ubuntu/oneiric/gdm3/oneiric

« back to all changes in this revision

Viewing changes to gui/simple-greeter/gdm-chooser-widget.h

  • Committer: Bazaar Package Importer
  • Author(s): Josselin Mouette
  • Date: 2010-03-25 20:02:20 UTC
  • Revision ID: james.westby@ubuntu.com-20100325200220-12cap62s6p304nuh
Tags: upstream-2.29.92
ImportĀ upstreamĀ versionĀ 2.29.92

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-
 
2
 *
 
3
 * Copyright (C) 2007 Ray Strode <rstrode@redhat.com>
 
4
 * Copyright (C) 2007 William Jon McCann <mccann@jhu.edu>
 
5
 *
 
6
 * This program is free software; you can redistribute it and/or modify
 
7
 * it under the terms of the GNU General Public License as published by
 
8
 * the Free Software Foundation; either version 2 of the License, or
 
9
 * (at your option) any later version.
 
10
 *
 
11
 * This program is distributed in the hope that it will be useful,
 
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
14
 * GNU General Public License for more details.
 
15
 *
 
16
 * You should have received a copy of the GNU General Public License
 
17
 * along with this program; if not, write to the Free Software
 
18
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
19
 *
 
20
 */
 
21
 
 
22
#ifndef __GDM_CHOOSER_WIDGET_H
 
23
#define __GDM_CHOOSER_WIDGET_H
 
24
 
 
25
#include <glib-object.h>
 
26
#include <gtk/gtk.h>
 
27
 
 
28
G_BEGIN_DECLS
 
29
 
 
30
#define GDM_TYPE_CHOOSER_WIDGET         (gdm_chooser_widget_get_type ())
 
31
#define GDM_CHOOSER_WIDGET(o)           (G_TYPE_CHECK_INSTANCE_CAST ((o), GDM_TYPE_CHOOSER_WIDGET, GdmChooserWidget))
 
32
#define GDM_CHOOSER_WIDGET_CLASS(k)     (G_TYPE_CHECK_CLASS_CAST((k), GDM_TYPE_CHOOSER_WIDGET, GdmChooserWidgetClass))
 
33
#define GDM_IS_CHOOSER_WIDGET(o)        (G_TYPE_CHECK_INSTANCE_TYPE ((o), GDM_TYPE_CHOOSER_WIDGET))
 
34
#define GDM_IS_CHOOSER_WIDGET_CLASS(k)  (G_TYPE_CHECK_CLASS_TYPE ((k), GDM_TYPE_CHOOSER_WIDGET))
 
35
#define GDM_CHOOSER_WIDGET_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GDM_TYPE_CHOOSER_WIDGET, GdmChooserWidgetClass))
 
36
 
 
37
typedef struct GdmChooserWidgetPrivate GdmChooserWidgetPrivate;
 
38
 
 
39
typedef struct
 
40
{
 
41
        GtkAlignment             parent;
 
42
        GdmChooserWidgetPrivate *priv;
 
43
} GdmChooserWidget;
 
44
 
 
45
typedef struct
 
46
{
 
47
        GtkAlignmentClass       parent_class;
 
48
 
 
49
        void (* loaded)         (GdmChooserWidget *widget);
 
50
 
 
51
        void (* activated)      (GdmChooserWidget *widget);
 
52
        void (* deactivated)    (GdmChooserWidget *widget);
 
53
} GdmChooserWidgetClass;
 
54
 
 
55
typedef enum {
 
56
        GDM_CHOOSER_WIDGET_POSITION_TOP = 0,
 
57
        GDM_CHOOSER_WIDGET_POSITION_BOTTOM,
 
58
} GdmChooserWidgetPosition;
 
59
 
 
60
typedef gboolean (*GdmChooserUpdateForeachFunc)          (GdmChooserWidget *widget,
 
61
                                                          const char       *id,
 
62
                                                          GdkPixbuf       **image,
 
63
                                                          char            **name,
 
64
                                                          char            **comment,
 
65
                                                          gulong           *priority,
 
66
                                                          gboolean         *is_in_use,
 
67
                                                          gboolean         *is_separate,
 
68
                                                          gpointer          data);
 
69
 
 
70
GType        gdm_chooser_widget_get_type                     (void);
 
71
GtkWidget *  gdm_chooser_widget_new                          (const char       *unactive_label,
 
72
                                                              const char       *active_label);
 
73
 
 
74
void         gdm_chooser_widget_add_item                     (GdmChooserWidget *widget,
 
75
                                                              const char       *id,
 
76
                                                              GdkPixbuf        *image,
 
77
                                                              const char       *name,
 
78
                                                              const char       *comment,
 
79
                                                              gulong            priority,
 
80
                                                              gboolean          is_in_use,
 
81
                                                              gboolean          keep_separate);
 
82
 
 
83
void         gdm_chooser_widget_update_foreach_item          (GdmChooserWidget           *widget,
 
84
                                                              GdmChooserUpdateForeachFunc cb,
 
85
                                                              gpointer                    data);
 
86
 
 
87
void         gdm_chooser_widget_update_item                  (GdmChooserWidget *widget,
 
88
                                                              const char       *id,
 
89
                                                              GdkPixbuf        *new_image,
 
90
                                                              const char       *new_name,
 
91
                                                              const char       *new_comment,
 
92
                                                              gulong            priority,
 
93
                                                              gboolean          new_in_use,
 
94
                                                              gboolean          new_is_separate);
 
95
 
 
96
void          gdm_chooser_widget_remove_item                  (GdmChooserWidget *widget,
 
97
                                                               const char       *id);
 
98
 
 
99
gboolean      gdm_chooser_widget_lookup_item                  (GdmChooserWidget           *widget,
 
100
                                                               const char                 *id,
 
101
                                                               GdkPixbuf                 **image,
 
102
                                                               char                      **name,
 
103
                                                               char                      **comment,
 
104
                                                               gulong                     *priority,
 
105
                                                               gboolean                   *is_in_use,
 
106
                                                               gboolean                   *is_separate);
 
107
 
 
108
char *         gdm_chooser_widget_get_selected_item            (GdmChooserWidget          *widget);
 
109
void           gdm_chooser_widget_set_selected_item            (GdmChooserWidget          *widget,
 
110
                                                                const char                *item);
 
111
 
 
112
char *         gdm_chooser_widget_get_active_item              (GdmChooserWidget          *widget);
 
113
void           gdm_chooser_widget_set_active_item              (GdmChooserWidget          *widget,
 
114
                                                                const char                *item);
 
115
 
 
116
void           gdm_chooser_widget_set_item_in_use              (GdmChooserWidget          *widget,
 
117
                                                                const char                *id,
 
118
                                                                gboolean                   is_in_use);
 
119
void           gdm_chooser_widget_set_item_priority            (GdmChooserWidget          *widget,
 
120
                                                                const char                *id,
 
121
                                                                gulong                     priority);
 
122
void           gdm_chooser_widget_set_item_timer               (GdmChooserWidget          *widget,
 
123
                                                                const char                *id,
 
124
                                                                gulong                     timeout);
 
125
void           gdm_chooser_widget_set_in_use_message           (GdmChooserWidget          *widget,
 
126
                                                                const char                *message);
 
127
 
 
128
void           gdm_chooser_widget_set_separator_position        (GdmChooserWidget         *widget,
 
129
                                                                 GdmChooserWidgetPosition  position);
 
130
void           gdm_chooser_widget_set_hide_inactive_items       (GdmChooserWidget         *widget,
 
131
                                                                 gboolean                  should_hide);
 
132
 
 
133
void           gdm_chooser_widget_activate_selected_item       (GdmChooserWidget          *widget);
 
134
 
 
135
int            gdm_chooser_widget_get_number_of_items          (GdmChooserWidget          *widget);
 
136
void           gdm_chooser_widget_activate_if_one_item         (GdmChooserWidget          *widget);
 
137
void           gdm_chooser_widget_propagate_pending_key_events (GdmChooserWidget          *widget);
 
138
 
 
139
/* Protected
 
140
 */
 
141
void           gdm_chooser_widget_loaded                       (GdmChooserWidget          *widget);
 
142
 
 
143
G_END_DECLS
 
144
 
 
145
#endif /* __GDM_CHOOSER_WIDGET_H */