1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- 2 * 3 * ck-connector.h : Code for login managers to register with ConsoleKit. 4 * 5 * Copyright (c) 2007 David Zeuthen <davidz@redhat.com> 6 * Copyright (c) 2007 William Jon McCann <mccann@jhu.edu> 7 * 8 * Permission is hereby granted, free of charge, to any person 9 * obtaining a copy of this software and associated documentation 10 * files (the "Software"), to deal in the Software without 11 * restriction, including without limitation the rights to use, 12 * copy, modify, merge, publish, distribute, sublicense, and/or sell 13 * copies of the Software, and to permit persons to whom the 14 * Software is furnished to do so, subject to the following 15 * conditions: 16 * 17 * The above copyright notice and this permission notice shall be 18 * included in all copies or substantial portions of the Software. 19 * 20 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 22 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 23 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 24 * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 25 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 26 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 27 * OTHER DEALINGS IN THE SOFTWARE. 28 */ 29 30 #ifndef CK_CONNECTOR_H 31 #define CK_CONNECTOR_H 32 33 #include <sys/types.h> 34 #include <dbus/dbus.h> 35 36 DBUS_BEGIN_DECLS 37 38 struct _CkConnector; 39 typedef struct _CkConnector CkConnector; 40 41 CkConnector *ck_connector_new (void); 42 43 CkConnector *ck_connector_ref (CkConnector *ckc); 44 void ck_connector_unref (CkConnector *ckc); 45 46 dbus_bool_t ck_connector_open_session_for_user (CkConnector *ckc, 47 uid_t user, 48 const char *tty, 49 const char *x11_display, 50 DBusError *error); 51 dbus_bool_t ck_connector_open_session_with_parameters (CkConnector *ckc, 52 DBusError *error, 53 const char *first_parameter_name, 54 ...); 55 dbus_bool_t ck_connector_open_session (CkConnector *ckc, 56 DBusError *error); 57 58 const char *ck_connector_get_cookie (CkConnector *ckc); 59 const char *ck_connector_get_runtime_dir (CkConnector *ckc, 60 DBusError *error); 61 dbus_bool_t ck_connector_close_session (CkConnector *ckc, 62 DBusError *error); 63 64 DBUS_END_DECLS 65 66 #endif /* CK_CONNECTOR_H */ 67