1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-
2  *
3  * Copyright (C) 2007 Novell, 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_XSMP_CLIENT_H__
23 #define __GSM_XSMP_CLIENT_H__
24 
25 #include "gsm-client.h"
26 
27 #include <X11/SM/SMlib.h>
28 
29 G_BEGIN_DECLS
30 
31 #define GSM_TYPE_XSMP_CLIENT              (gsm_xsmp_client_get_type ())
32 G_DECLARE_DERIVABLE_TYPE                  (GsmXSMPClient, gsm_xsmp_client, GSM, XSMP_CLIENT, GsmClient)
33 
34 struct _GsmXSMPClientClass
35 {
36         GsmClientClass parent_class;
37 
38         /* signals */
39         gboolean (*register_request)     (GsmXSMPClient  *client,
40                                           char          **client_id);
41         gboolean (*logout_request)       (GsmXSMPClient  *client,
42                                           gboolean        prompt);
43 
44 
45         void     (*saved_state)          (GsmXSMPClient  *client);
46 
47         void     (*request_phase2)       (GsmXSMPClient  *client);
48 
49         void     (*request_interaction)  (GsmXSMPClient  *client);
50         void     (*interaction_done)     (GsmXSMPClient  *client,
51                                           gboolean        cancel_shutdown);
52 
53         void     (*save_yourself_done)   (GsmXSMPClient  *client);
54 
55 };
56 
57 GsmClient  *gsm_xsmp_client_new                  (IceConn         ice_conn);
58 
59 void        gsm_xsmp_client_connect              (GsmXSMPClient  *client,
60                                                   SmsConn         conn,
61                                                   unsigned long  *mask_ret,
62                                                   SmsCallbacks   *callbacks_ret);
63 
64 void        gsm_xsmp_client_save_state           (GsmXSMPClient  *client);
65 void        gsm_xsmp_client_save_yourself        (GsmXSMPClient  *client,
66                                                   gboolean        save_state);
67 void        gsm_xsmp_client_save_yourself_phase2 (GsmXSMPClient  *client);
68 void        gsm_xsmp_client_interact             (GsmXSMPClient  *client);
69 void        gsm_xsmp_client_shutdown_cancelled   (GsmXSMPClient  *client);
70 
71 G_END_DECLS
72 
73 #endif /* __GSM_XSMP_CLIENT_H__ */
74