1 /* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */ 2 /* 3 * Copyright (C) 2012 Red Hat 4 * 5 * This program is free software; you can redistribute it and/or 6 * modify it under the terms of the GNU General Public License as 7 * published by the Free Software Foundation; either version 2 of the 8 * License, or (at your option) any later version. 9 * 10 * This program is distributed in the hope that it will be useful, but 11 * WITHOUT ANY WARRANTY; without even the implied warranty of 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 * General Public License for more details. 14 * 15 * You should have received a copy of the GNU General Public License 16 * along with this program; if not, see <http://www.gnu.org/licenses/>. 17 * 18 * Written by: 19 * Jasper St. Pierre <jstpierre@mecheye.net> 20 */ 21 22 #ifndef __GIS_DRIVER_H__ 23 #define __GIS_DRIVER_H__ 24 25 #include "gis-assistant.h" 26 #include "gis-page.h" 27 #include <act/act-user-manager.h> 28 #include <gdm/gdm-client.h> 29 30 G_BEGIN_DECLS 31 32 #define GIS_TYPE_DRIVER (gis_driver_get_type ()) 33 34 G_DECLARE_FINAL_TYPE (GisDriver, gis_driver, GIS, DRIVER, GtkApplication) 35 36 typedef enum { 37 UM_LOCAL, 38 UM_ENTERPRISE, 39 NUM_MODES, 40 } UmAccountMode; 41 42 typedef enum { 43 GIS_DRIVER_MODE_NEW_USER, 44 GIS_DRIVER_MODE_EXISTING_USER, 45 } GisDriverMode; 46 47 GisAssistant *gis_driver_get_assistant (GisDriver *driver); 48 49 void gis_driver_set_user_permissions (GisDriver *driver, 50 ActUser *user, 51 const gchar *password); 52 53 void gis_driver_get_user_permissions (GisDriver *driver, 54 ActUser **user, 55 const gchar **password); 56 57 void gis_driver_set_parent_permissions (GisDriver *driver, 58 ActUser *parent, 59 const gchar *password); 60 61 void gis_driver_get_parent_permissions (GisDriver *driver, 62 ActUser **parent, 63 const gchar **password); 64 65 void gis_driver_set_account_mode (GisDriver *driver, 66 UmAccountMode mode); 67 68 UmAccountMode gis_driver_get_account_mode (GisDriver *driver); 69 70 void gis_driver_set_parental_controls_enabled (GisDriver *driver, 71 gboolean parental_controls_enabled); 72 73 gboolean gis_driver_get_parental_controls_enabled (GisDriver *driver); 74 75 void gis_driver_set_user_language (GisDriver *driver, 76 const gchar *lang_id, 77 gboolean update_locale); 78 79 const gchar *gis_driver_get_user_language (GisDriver *driver); 80 81 void gis_driver_set_username (GisDriver *driver, 82 const gchar *username); 83 const gchar *gis_driver_get_username (GisDriver *driver); 84 85 void gis_driver_set_full_name (GisDriver *driver, 86 const gchar *full_name); 87 const gchar *gis_driver_get_full_name (GisDriver *driver); 88 89 void gis_driver_set_avatar (GisDriver *driver, 90 GdkPixbuf *avatar); 91 GdkPixbuf *gis_driver_get_avatar (GisDriver *driver); 92 93 gboolean gis_driver_get_gdm_objects (GisDriver *driver, 94 GdmGreeter **greeter, 95 GdmUserVerifier **user_verifier); 96 97 GisDriverMode gis_driver_get_mode (GisDriver *driver); 98 99 gboolean gis_driver_is_small_screen (GisDriver *driver); 100 101 void gis_driver_add_page (GisDriver *driver, 102 GisPage *page); 103 104 void gis_driver_hide_window (GisDriver *driver); 105 106 gboolean gis_driver_save_data (GisDriver *driver, 107 GError **error); 108 109 gboolean gis_driver_conf_get_boolean (GisDriver *driver, 110 const gchar *group, 111 const gchar *key, 112 gboolean default_value); 113 114 GStrv gis_driver_conf_get_string_list (GisDriver *driver, 115 const gchar *group, 116 const gchar *key, 117 gsize *out_length); 118 119 gchar *gis_driver_conf_get_string (GisDriver *driver, 120 const gchar *group, 121 const gchar *key); 122 123 GisDriver *gis_driver_new (GisDriverMode mode); 124 125 G_END_DECLS 126 127 #endif /* __GIS_DRIVER_H__ */ 128