1 ////////////////////////////////////////////////////////////////////////////////
2 //3456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
3 //      10        20        30        40        50        60        70        80
4 //
5 // notify-osd
6 //
7 // timings.h - timings object handling duration and max. on-screen time
8 //
9 // Copyright 2009 Canonical Ltd.
10 //
11 // Authors:
12 //    Mirco "MacSlow" Mueller <mirco.mueller@canonical.com>
13 //
14 // This program is free software: you can redistribute it and/or modify it
15 // under the terms of the GNU General Public License version 3, as published
16 // by the Free Software Foundation.
17 //
18 // This program is distributed in the hope that it will be useful, but
19 // WITHOUT ANY WARRANTY; without even the implied warranties of
20 // MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
21 // PURPOSE.  See the GNU General Public License for more details.
22 //
23 // You should have received a copy of the GNU General Public License along
24 // with this program.  If not, see <http://www.gnu.org/licenses/>.
25 //
26 ////////////////////////////////////////////////////////////////////////////////
27 
28 #ifndef __TIMINGS_H
29 #define __TIMINGS_H
30 
31 #include <glib-object.h>
32 
33 G_BEGIN_DECLS
34 
35 #define TIMINGS_TYPE            (timings_get_type ())
36 #define TIMINGS(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), TIMINGS_TYPE, Timings))
37 #define TIMINGS_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), TIMINGS_TYPE, TimingsClass))
38 #define IS_TIMINGS(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TIMINGS_TYPE))
39 #define IS_TIMINGS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TIMINGS_TYPE))
40 #define TIMINGS_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), TIMINGS_TYPE, TimingsClass))
41 
42 typedef struct _Timings        Timings;
43 typedef struct _TimingsClass   TimingsClass;
44 typedef struct _TimingsPrivate TimingsPrivate;
45 
46 // instance structure
47 struct _Timings
48 {
49 	GObject parent;
50 
51 	//< private >
52 	TimingsPrivate* priv;
53 };
54 
55 // class structure
56 struct _TimingsClass
57 {
58 	GObjectClass parent;
59 
60 	//< signals >
61 	void (*completed) (Timings* timings);
62 	void (*limit_reached) (Timings* timings);
63 };
64 
65 GType timings_get_type (void);
66 
67 Timings*
68 timings_new (guint scheduled_duration,
69 	     guint max_duration);
70 
71 gboolean
72 timings_start (Timings* t);
73 
74 gboolean
75 timings_stop (Timings* t);
76 
77 gboolean
78 timings_pause (Timings* t);
79 
80 gboolean
81 timings_continue (Timings* t);
82 
83 gboolean
84 timings_extend (Timings* t,
85 		guint    extension);
86 
87 G_END_DECLS
88 
89 #endif // __TIMINGS_H
90