Merged pidgin/main into default
[pidgin-git.git] / libpurple / idle.h
blob985300ca8d5699693216426df17eaab0e0e90347
1 /* purple
3 * Purple is the legal property of its developers, whose names are too numerous
4 * to list here. Please refer to the COPYRIGHT file distributed with this
5 * source distribution.
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
22 #ifndef _PURPLE_IDLE_H_
23 #define _PURPLE_IDLE_H_
24 /**
25 * SECTION:idle
26 * @section_id: libpurple-idle
27 * @short_description: <filename>idle.h</filename>
28 * @title: Idle API
31 #include <time.h>
32 #include <glib-object.h>
34 #define PURPLE_TYPE_IDLE_UI_OPS (purple_idle_ui_ops_get_type())
36 typedef struct _PurpleIdleUiOps PurpleIdleUiOps;
38 /**
39 * PurpleIdleUiOps:
41 * Idle UI operations.
43 struct _PurpleIdleUiOps
45 time_t (*get_time_idle)(void);
47 /*< private >*/
48 void (*_purple_reserved1)(void);
49 void (*_purple_reserved2)(void);
50 void (*_purple_reserved3)(void);
51 void (*_purple_reserved4)(void);
54 G_BEGIN_DECLS
56 /**************************************************************************/
57 /* Idle API */
58 /**************************************************************************/
60 /**
61 * purple_idle_touch:
63 * Touch our idle tracker. This signifies that the user is
64 * 'active'. The conversation code calls this when the
65 * user sends an IM, for example.
67 void purple_idle_touch(void);
69 /**
70 * purple_idle_set:
72 * Fake our idle time by setting the time at which our
73 * accounts purportedly became idle. This is used by
74 * the I'dle Mak'er plugin.
76 void purple_idle_set(time_t time);
78 /**************************************************************************/
79 /* Idle Subsystem */
80 /**************************************************************************/
82 /**
83 * purple_idle_ui_ops_get_type:
85 * Returns: The #GType for the #PurpleIdleUiOps boxed structure.
87 GType purple_idle_ui_ops_get_type(void);
89 /**
90 * purple_idle_set_ui_ops:
91 * @ops: The UI operations structure.
93 * Sets the UI operations structure to be used for idle reporting.
95 void purple_idle_set_ui_ops(PurpleIdleUiOps *ops);
97 /**
98 * purple_idle_get_ui_ops:
100 * Returns the UI operations structure used for idle reporting.
102 * Returns: The UI operations structure in use.
104 PurpleIdleUiOps *purple_idle_get_ui_ops(void);
107 * purple_idle_init:
109 * Initializes the idle system.
111 void purple_idle_init(void);
114 * purple_idle_uninit:
116 * Uninitializes the idle system.
118 void purple_idle_uninit(void);
120 G_END_DECLS
122 #endif /* _PURPLE_IDLE_H_ */