Debian Codegraph @

libcolord-gtk/cd-window.h

raw
1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
2 *
3 * Copyright (C) 2012 Richard Hughes <[email protected]>
4 *
5 * Licensed under the GNU Lesser General Public License Version 2.1
6 *
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
11 *
12 * This library 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 GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 */
21
22 #if !defined (__COLORD_GTK_H_INSIDE__) && !defined (CD_COMPILATION)
23 #error "Only <colord-gtk.h> can be included directly."
24 #endif
25
26 #ifndef __CD_WINDOW_H
27 #define __CD_WINDOW_H
28
29 #include <glib-object.h>
30 #include <gio/gio.h>
31 #include <gtk/gtk.h>
32
33 G_BEGIN_DECLS
34
35 #define CD_TYPE_WINDOW (cd_window_get_type ())
36 #define CD_WINDOW(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), CD_TYPE_WINDOW, CdWindow))
37 #define CD_WINDOW_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), CD_TYPE_WINDOW, CdWindowClass))
38 #define CD_IS_WINDOW(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), CD_TYPE_WINDOW))
39 #define CD_IS_WINDOW_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), CD_TYPE_WINDOW))
40 #define CD_WINDOW_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), CD_TYPE_WINDOW, CdWindowClass))
41 #define CD_WINDOW_ERROR (cd_window_error_quark ())
42 #define CD_WINDOW_TYPE_ERROR (cd_window_error_get_type ())
43
44 typedef struct _CdWindowPrivate CdWindowPrivate;
45
46 typedef struct
47 {
48 GObject parent;
49 CdWindowPrivate *priv;
50 } CdWindow;
51
52 typedef struct
53 {
54 GObjectClass parent_class;
55 void (*changed) (CdWindow *window,
56 CdProfile *profile);
57 /*< private >*/
58 /* Padding for future expansion */
59 void (*_cd_window_reserved1) (void);
60 void (*_cd_window_reserved2) (void);
61 void (*_cd_window_reserved3) (void);
62 void (*_cd_window_reserved4) (void);
63 void (*_cd_window_reserved5) (void);
64 void (*_cd_window_reserved6) (void);
65 void (*_cd_window_reserved7) (void);
66 void (*_cd_window_reserved8) (void);
67 } CdWindowClass;
68
69 /**
70 * CdWindowError:
71 * @CD_WINDOW_ERROR_FAILED: the transaction failed for an unknown reason
72 *
73 * Errors that can be thrown
74 */
75 typedef enum
76 {
77 CD_WINDOW_ERROR_FAILED,
78 CD_WINDOW_ERROR_LAST
79 } CdWindowError;
80
81 GType cd_window_get_type (void);
82 GQuark cd_window_error_quark (void);
83 CdWindow *cd_window_new (void);
84
85 /* async */
86 void cd_window_get_profile (CdWindow *window,
87 GtkWidget *widget,
88 GCancellable *cancellable,
89 GAsyncReadyCallback callback,
90 gpointer user_data);
91 CdProfile *cd_window_get_profile_finish (CdWindow *window,
92 GAsyncResult *res,
93 GError **error);
94
95 /* getters */
96 CdProfile *cd_window_get_last_profile (CdWindow *window);
97
98 G_END_DECLS
99
100 #endif /* __CD_WINDOW_H */
101