summaryrefslogtreecommitdiff
path: root/mate-session/gsm-xsmp-client.h
blob: f14ab6146b0f4cc36f273d98b0f7ef0d11000d7e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-
 *
 * Copyright (C) 2007 Novell, Inc.
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License as
 * published by the Free Software Foundation; either version 2 of the
 * License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
 * 02110-1301, USA.
 */

#ifndef __GSM_XSMP_CLIENT_H__
#define __GSM_XSMP_CLIENT_H__

#include "gsm-client.h"

#include <X11/SM/SMlib.h>

#ifdef __cplusplus
extern "C" {
#endif

#define GSM_TYPE_XSMP_CLIENT            (gsm_xsmp_client_get_type ())
#define GSM_XSMP_CLIENT(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), GSM_TYPE_XSMP_CLIENT, GsmXSMPClient))
#define GSM_XSMP_CLIENT_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), GSM_TYPE_XSMP_CLIENT, GsmXSMPClientClass))
#define GSM_IS_XSMP_CLIENT(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GSM_TYPE_XSMP_CLIENT))
#define GSM_IS_XSMP_CLIENT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GSM_TYPE_XSMP_CLIENT))
#define GSM_XSMP_CLIENT_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), GSM_TYPE_XSMP_CLIENT, GsmXSMPClientClass))

typedef struct _GsmXSMPClient        GsmXSMPClient;
typedef struct _GsmXSMPClientClass   GsmXSMPClientClass;

typedef struct GsmXSMPClientPrivate  GsmXSMPClientPrivate;

struct _GsmXSMPClient
{
        GsmClient             parent;
        GsmXSMPClientPrivate *priv;
};

struct _GsmXSMPClientClass
{
        GsmClientClass parent_class;

        /* signals */
        gboolean (*register_request)     (GsmXSMPClient  *client,
                                          char          **client_id);
        gboolean (*logout_request)       (GsmXSMPClient  *client,
                                          gboolean        prompt);


        void     (*saved_state)          (GsmXSMPClient  *client);

        void     (*request_phase2)       (GsmXSMPClient  *client);

        void     (*request_interaction)  (GsmXSMPClient  *client);
        void     (*interaction_done)     (GsmXSMPClient  *client,
                                          gboolean        cancel_shutdown);

        void     (*save_yourself_done)   (GsmXSMPClient  *client);

};

GType       gsm_xsmp_client_get_type             (void) G_GNUC_CONST;

GsmClient  *gsm_xsmp_client_new                  (IceConn         ice_conn);

void        gsm_xsmp_client_connect              (GsmXSMPClient  *client,
                                                  SmsConn         conn,
                                                  unsigned long  *mask_ret,
                                                  SmsCallbacks   *callbacks_ret);

void        gsm_xsmp_client_save_state           (GsmXSMPClient  *client);
void        gsm_xsmp_client_save_yourself        (GsmXSMPClient  *client,
                                                  gboolean        save_state);
void        gsm_xsmp_client_save_yourself_phase2 (GsmXSMPClient  *client);
void        gsm_xsmp_client_interact             (GsmXSMPClient  *client);
void        gsm_xsmp_client_shutdown_cancelled   (GsmXSMPClient  *client);

#ifdef __cplusplus
}
#endif

#endif /* __GSM_XSMP_CLIENT_H__ */