File: e-offline-listener.c

package info (click to toggle)
evolution-data-server 3.12.9~git20141128.5242b0-2%2Bdeb8u2
  • links: PTS, VCS
  • area: main
  • in suites: jessie-kfreebsd
  • size: 58,708 kB
  • sloc: ansic: 286,597; sh: 11,359; makefile: 4,454; cpp: 472; xml: 410; perl: 204; python: 69
file content (106 lines) | stat: -rw-r--r-- 2,639 bytes parent folder | download | duplicates (2)
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
94
95
96
97
98
99
100
101
102
103
104
105
106
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
/* server-interface-check.h
 *
 * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
 *
 * This library is free software you can redistribute it and/or modify it
 * under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation.
 *
 * This library 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 General Public License
 * for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this library; if not, see <http://www.gnu.org/licenses/>.
 *
 * Author: Sivaiah Nallagatla <snallagatla@novell.com>
 */

/**
 * SECTION: e-offline-listener
 * @short_description: Tracks Evolution's online/offline state
 *
 * An #EOfflineListener basically just tracks Evolution's online/offline
 * state and emits a #EOfflineListener:changed signal when a state change
 * is detected.
 *
 * This class is highly Evolution-centric and for that reason has been
 * deprecated.  Use #GNetworkMonitor instead.
 **/

#ifdef HAVE_CONFIG_H
#include "config.h"
#endif

#include "e-offline-listener.h"

G_DEFINE_TYPE (EOfflineListener, e_offline_listener, G_TYPE_OBJECT)

enum {
	CHANGED,
	NUM_SIGNALS
};

static guint signals[NUM_SIGNALS] = { 0 };

static void
e_offline_listener_class_init (EOfflineListenerClass *class)
{
	GObjectClass *object_class;

	object_class = G_OBJECT_CLASS (class);

	/**
	 * EOfflineListener::changed:
	 * @listener: the #EOfflineListener that received the signal
	 *
	 * Emitted when Evolution's online/offline state changes.
	 **/
	signals[CHANGED] = g_signal_new (
		"changed",
		G_OBJECT_CLASS_TYPE (object_class),
		G_SIGNAL_RUN_LAST,
		G_STRUCT_OFFSET (EOfflineListenerClass, changed),
		NULL, NULL, NULL,
		G_TYPE_NONE, 0);
}

static void
e_offline_listener_init (EOfflineListener *eol)
{
}

/**
 * e_offline_listener_new:
 *
 * Returns a new #EOfflineListener.
 *
 * Returns: a new #EOfflineListener
 *
 * Since: 2.30
 **/
EOfflineListener *
e_offline_listener_new (void)
{
	return g_object_new (E_TYPE_OFFLINE_LISTENER, NULL);
}

/**
 * e_offline_listener_get_state:
 * @eol: an #EOfflineListener
 *
 * This function now simply returns #EOL_STATE_ONLINE always.
 *
 * Returns: #EOL_STATE_OFFLINE or #EOL_STATE_ONLINE
 *
 * Since: 2.30
 **/
EOfflineListenerState
e_offline_listener_get_state (EOfflineListener *eol)
{
	g_return_val_if_fail (E_IS_OFFLINE_LISTENER (eol), EOL_STATE_OFFLINE);

	return EOL_STATE_ONLINE;
}