1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-
2  *
3  * Copyright (C) 2009 Red Hat, Inc.
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  * Lesser 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 
19 #ifndef __GSM_PRESENCE_H__
20 #define __GSM_PRESENCE_H__
21 
22 #include <glib-object.h>
23 #include <sys/types.h>
24 
25 #include "gsm-presence-flag.h"
26 
27 G_BEGIN_DECLS
28 
29 #define GSM_TYPE_PRESENCE            (gsm_presence_get_type ())
30 #define GSM_PRESENCE(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), GSM_TYPE_PRESENCE, GsmPresence))
31 #define GSM_PRESENCE_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), GSM_TYPE_PRESENCE, GsmPresenceClass))
32 #define GSM_IS_PRESENCE(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GSM_TYPE_PRESENCE))
33 #define GSM_IS_PRESENCE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GSM_TYPE_PRESENCE))
34 #define GSM_PRESENCE_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), GSM_TYPE_PRESENCE, GsmPresenceClass))
35 
36 typedef struct _GsmPresence        GsmPresence;
37 typedef struct _GsmPresenceClass   GsmPresenceClass;
38 
39 typedef struct GsmPresencePrivate GsmPresencePrivate;
40 
41 struct _GsmPresence
42 {
43         GObject             parent;
44         GsmPresencePrivate *priv;
45 };
46 
47 struct _GsmPresenceClass
48 {
49         GObjectClass parent_class;
50 
51         void          (* status_changed)        (GsmPresence     *presence,
52                                                  guint            status);
53 };
54 
55 typedef enum
56 {
57         GSM_PRESENCE_ERROR_GENERAL = 0,
58         GSM_PRESENCE_NUM_ERRORS
59 } GsmPresenceError;
60 
61 #define GSM_PRESENCE_ERROR gsm_presence_error_quark ()
62 GQuark         gsm_presence_error_quark          (void);
63 
64 GType          gsm_presence_get_type             (void) G_GNUC_CONST;
65 
66 GsmPresence *  gsm_presence_new                  (void);
67 
68 void           gsm_presence_set_idle_enabled     (GsmPresence  *presence,
69                                                   gboolean      enabled);
70 void           gsm_presence_set_idle_timeout     (GsmPresence  *presence,
71                                                   guint         n_seconds);
72 
73 G_END_DECLS
74 
75 #endif /* __GSM_PRESENCE_H__ */
76