1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- 2 * 3 * Copyright (C) 2009 Red Hat, Inc. 4 * Copyright (C) 2012-2021 MATE Developers 5 * 6 * This program is free software; you can redistribute it and/or 7 * modify it under the terms of the GNU General Public License as 8 * published by the Free Software Foundation; either version 2 of the 9 * License, or (at your option) any later version. 10 * 11 * This program is distributed in the hope that it will be useful, but 12 * WITHOUT ANY WARRANTY; without even the implied warranty of 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 * Lesser 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., 51 Franklin St, Fifth Floor, Boston, MA 19 * 02110-1301, USA. 20 */ 21 22 #ifndef __GSM_PRESENCE_H__ 23 #define __GSM_PRESENCE_H__ 24 25 #include <glib-object.h> 26 #include <sys/types.h> 27 28 G_BEGIN_DECLS 29 30 #define GSM_TYPE_PRESENCE (gsm_presence_get_type ()) 31 G_DECLARE_DERIVABLE_TYPE (GsmPresence, gsm_presence, GSM, PRESENCE, GObject) 32 33 struct _GsmPresenceClass 34 { 35 GObjectClass parent_class; 36 37 void (* status_changed) (GsmPresence *presence, 38 guint status); 39 void (* status_text_changed) (GsmPresence *presence, 40 const char *status_text); 41 42 }; 43 44 typedef enum { 45 GSM_PRESENCE_STATUS_AVAILABLE = 0, 46 GSM_PRESENCE_STATUS_INVISIBLE, 47 GSM_PRESENCE_STATUS_BUSY, 48 GSM_PRESENCE_STATUS_IDLE, 49 } GsmPresenceStatus; 50 51 typedef enum 52 { 53 GSM_PRESENCE_ERROR_GENERAL = 0, 54 GSM_PRESENCE_NUM_ERRORS 55 } GsmPresenceError; 56 57 #define GSM_PRESENCE_ERROR gsm_presence_error_quark () 58 GType gsm_presence_error_get_type (void); 59 #define GSM_PRESENCE_TYPE_ERROR (gsm_presence_error_get_type ()) 60 61 GQuark gsm_presence_error_quark (void); 62 63 GsmPresence * gsm_presence_new (void); 64 65 void gsm_presence_set_idle_enabled (GsmPresence *presence, 66 gboolean enabled); 67 void gsm_presence_set_idle_timeout (GsmPresence *presence, 68 guint n_seconds); 69 70 /* exported to bus */ 71 gboolean gsm_presence_set_status (GsmPresence *presence, 72 guint status, 73 GError **error); 74 gboolean gsm_presence_set_status_text (GsmPresence *presence, 75 const char *status_text, 76 GError **error); 77 78 G_END_DECLS 79 80 #endif /* __GSM_PRESENCE_H__ */ 81