2
* Copyright (C) 2007 Novell, Inc.
4
* This library is free software; you can redistribute it and/or
5
* modify it under the terms of the GNU Lesser General Public
6
* License as published by the Free Software Foundation; either
7
* version 2 of the License, or (at your option) any later version.
9
* This library is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12
* Lesser General Public License for more details.
14
* You should have received a copy of the GNU Lesser General Public
15
* License along with this library; if not, write to the
16
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17
* Boston, MA 02111-1307, USA.
20
#ifndef __EGG_SM_CLIENT_H__
21
#define __EGG_SM_CLIENT_H__
23
#include <glib-object.h>
27
#define EGG_TYPE_SM_CLIENT (egg_sm_client_get_type ())
28
#define EGG_SM_CLIENT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EGG_TYPE_SM_CLIENT, EggSMClient))
29
#define EGG_SM_CLIENT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), EGG_TYPE_SM_CLIENT, EggSMClientClass))
30
#define EGG_IS_SM_CLIENT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EGG_TYPE_SM_CLIENT))
31
#define EGG_IS_SM_CLIENT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), EGG_TYPE_SM_CLIENT))
32
#define EGG_SM_CLIENT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), EGG_TYPE_SM_CLIENT, EggSMClientClass))
34
typedef struct _EggSMClient EggSMClient;
35
typedef struct _EggSMClientClass EggSMClientClass;
36
typedef struct _EggSMClientPrivate EggSMClientPrivate;
39
EGG_SM_CLIENT_END_SESSION_DEFAULT,
42
EGG_SM_CLIENT_SHUTDOWN
43
} EggSMClientEndStyle;
46
EGG_SM_CLIENT_MODE_DISABLED,
47
EGG_SM_CLIENT_MODE_NO_RESTART,
48
EGG_SM_CLIENT_MODE_NORMAL
57
struct _EggSMClientClass
59
GObjectClass parent_class;
62
void (*save_state) (EggSMClient *client,
63
GKeyFile *state_file);
65
void (*quit_requested) (EggSMClient *client);
66
void (*quit_cancelled) (EggSMClient *client);
67
void (*quit) (EggSMClient *client);
70
void (*startup) (EggSMClient *client,
71
const char *client_id);
72
void (*set_restart_command) (EggSMClient *client,
75
void (*set_discard_command) (EggSMClient *client,
78
void (*will_quit) (EggSMClient *client,
80
gboolean (*end_session) (EggSMClient *client,
81
EggSMClientEndStyle style,
82
gboolean request_confirmation);
84
/* Padding for future expansion */
85
void (*_egg_reserved1) (void);
86
void (*_egg_reserved2) (void);
87
void (*_egg_reserved3) (void);
88
void (*_egg_reserved4) (void);
91
GType egg_sm_client_get_type (void) G_GNUC_CONST;
93
GOptionGroup *egg_sm_client_get_option_group (void);
96
void egg_sm_client_set_mode (EggSMClientMode mode);
97
EggSMClientMode egg_sm_client_get_mode (void);
98
EggSMClient *egg_sm_client_get (void);
100
/* Resuming a saved session */
101
gboolean egg_sm_client_is_resumed (EggSMClient *client);
102
GKeyFile *egg_sm_client_get_state_file (EggSMClient *client);
104
/* Alternate means of saving state */
105
void egg_sm_client_set_restart_command (EggSMClient *client,
108
void egg_sm_client_set_discard_command (EggSMClient *client,
112
/* Handling "quit_requested" signal */
113
void egg_sm_client_will_quit (EggSMClient *client,
116
/* Initiate a logout/reboot/shutdown */
117
gboolean egg_sm_client_end_session (EggSMClientEndStyle style,
118
gboolean request_confirmation);
123
#endif /* __EGG_SM_CLIENT_H__ */