~ubuntu-branches/ubuntu/oneiric/cups-pk-helper/oneiric-proposed

1 by Guido Günther
Import upstream version 0.1.0
1
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-
2
 * vim: set et ts=8 sw=8:
3
 *
4
 * Copyright (C) 2008 Novell, Inc.
5
 *
6
 * Authors: Vincent Untz
7
 *
8
 * This program is free software; you can redistribute it and/or modify
9
 * it under the terms of the GNU General Public License as published by
10
 * the Free Software Foundation; either version 2 of the License, or
11
 * (at your option) any later version.
12
 *
13
 * This program is distributed in the hope that it will be useful,
14
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
 * GNU General Public License for more details.
17
 *
18
 * You should have received a copy of the GNU General Public License
19
 * along with this program; if not, write to the Free Software
20
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21
 *
22
 */
23
24
#ifndef CPH_CUPS_H
25
#define CPH_CUPS_H
26
27
#include <glib-object.h>
28
29
G_BEGIN_DECLS
30
31
#define CPH_TYPE_CUPS         (cph_cups_get_type ())
32
#define CPH_CUPS(o)           (G_TYPE_CHECK_INSTANCE_CAST ((o), CPH_TYPE_CUPS, CphCups))
33
#define CPH_CUPS_CLASS(k)     (G_TYPE_CHECK_CLASS_CAST((k), CPH_TYPE_CUPS, CphCupsClass))
34
#define CPH_IS_CUPS(o)        (G_TYPE_CHECK_INSTANCE_TYPE ((o), CPH_TYPE_CUPS))
35
#define CPH_IS_CUPS_CLASS(k)  (G_TYPE_CHECK_CLASS_TYPE ((k), CPH_TYPE_CUPS))
36
#define CPH_CUPS_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), CPH_TYPE_CUPS, CphCupsClass))
37
38
typedef struct CphCupsPrivate CphCupsPrivate;
39
40
typedef struct
41
{
42
        GObject         parent;
43
        CphCupsPrivate *priv;
44
} CphCups;
45
46
typedef struct
47
{
48
        GObjectClass parent_class;
49
} CphCupsClass;
50
51
typedef enum
52
{
53
        CPH_JOB_STATUS_INVALID,
54
        CPH_JOB_STATUS_OWNED_BY_USER,
55
        CPH_JOB_STATUS_NOT_OWNED_BY_USER
56
} CphJobStatus;
57
58
GType     cph_cups_get_type    (void);
59
60
CphCups  *cph_cups_new         (void);
61
62
const char *cph_cups_last_status_to_string (CphCups *cups);
63
64
gboolean cph_cups_is_class (CphCups    *cups,
65
                            const char *name);
66
67
char *cph_cups_printer_get_uri (CphCups    *cups,
68
                                const char *printer_name);
69
70
gboolean cph_cups_is_printer_local (CphCups    *cups,
71
                                    const char *printer_name);
72
5 by Jeremy Bicha
* SECURITY UPDATE: CUPS function calls were wrapped insecurely, which
73
gboolean cph_cups_file_get (CphCups      *cups,
74
                            const char   *resource,
75
                            const char   *filename,
76
                            unsigned int  sender_uid);
1 by Guido Günther
Import upstream version 0.1.0
77
5 by Jeremy Bicha
* SECURITY UPDATE: CUPS function calls were wrapped insecurely, which
78
gboolean cph_cups_file_put (CphCups      *cups,
79
                            const char   *resource,
80
                            const char   *filename,
81
                            unsigned int  sender_uid);
1 by Guido Günther
Import upstream version 0.1.0
82
83
GHashTable *cph_cups_server_get_settings (CphCups *cups);
84
85
gboolean cph_cups_server_set_settings (CphCups    *cups,
86
                                       GHashTable *settings);
87
88
GHashTable *cph_cups_devices_get (CphCups     *cups,
89
                                  int          timeout,
90
                                  int          limit,
91
                                  const char **include_schemes,
92
                                  const char **exclude_schemes);
93
94
gboolean cph_cups_printer_add (CphCups    *cups,
95
                               const char *printer_name,
96
                               const char *printer_uri,
97
                               const char *ppd_file,
98
                               const char *info,
99
                               const char *location);
100
101
gboolean cph_cups_printer_add_with_ppd_file (CphCups    *cups,
102
                                             const char *printer_name,
103
                                             const char *printer_uri,
104
                                             const char *ppd_filename,
105
                                             const char *info,
106
                                             const char *location);
107
108
gboolean cph_cups_printer_delete (CphCups    *cups,
109
                                  const char *printer_name);
110
111
gboolean cph_cups_printer_set_default (CphCups    *cups,
112
                                       const char *printer_name);
113
114
gboolean cph_cups_printer_set_enabled (CphCups    *cups,
115
                                       const char *printer_name,
116
                                       gboolean    enabled);
117
118
gboolean cph_cups_printer_set_uri (CphCups    *cups,
119
                                   const char *printer_name,
120
                                   const char *printer_uri);
121
122
gboolean cph_cups_printer_set_accept_jobs (CphCups    *cups,
123
                                           const char *printer_name,
124
                                           gboolean    enabled,
125
                                           const char *reason);
126
127
gboolean cph_cups_class_add_printer (CphCups    *cups,
128
                                     const char *class_name,
129
                                     const char *printer_name);
130
131
gboolean cph_cups_class_delete_printer (CphCups    *cups,
132
                                        const char *class_name,
133
                                        const char *printer_name);
134
135
gboolean cph_cups_class_delete (CphCups    *cups,
136
                                const char *class_name);
137
138
gboolean cph_cups_printer_class_set_info (CphCups    *cups,
139
                                          const char *printer_name,
140
                                          const char *info);
141
142
gboolean cph_cups_printer_class_set_location (CphCups    *cups,
143
                                              const char *printer_name,
144
                                              const char *location);
145
146
gboolean cph_cups_printer_class_set_shared (CphCups    *cups,
147
                                            const char *printer_name,
148
                                            gboolean    shared);
149
150
gboolean cph_cups_printer_class_set_job_sheets (CphCups    *cups,
151
                                                const char *printer_name,
152
                                                const char *start,
153
                                                const char *end);
154
155
gboolean cph_cups_printer_class_set_error_policy (CphCups    *cups,
156
                                                  const char *printer_name,
157
                                                  const char *policy);
158
159
gboolean cph_cups_printer_class_set_op_policy (CphCups    *cups,
160
                                               const char *printer_name,
161
                                               const char *policy);
162
163
gboolean cph_cups_printer_class_set_users_allowed (CphCups     *cups,
164
                                                   const char  *printer_name,
165
                                                   const char **users);
166
167
gboolean cph_cups_printer_class_set_users_denied (CphCups     *cups,
168
                                                  const char  *printer_name,
169
                                                  const char **users);
170
171
gboolean cph_cups_printer_class_set_option_default (CphCups     *cups,
172
                                                    const char  *printer_name,
173
                                                    const char  *option,
174
                                                    const char **values);
175
176
gboolean cph_cups_job_cancel (CphCups    *cups,
177
                              int         job_id,
178
                              gboolean    purge_job,
179
                              const char *user_name);
180
181
gboolean cph_cups_job_restart (CphCups    *cups,
182
                               int         job_id,
183
                               const char *user_name);
184
185
gboolean cph_cups_job_set_hold_until (CphCups    *cups,
186
                                      int         job_id,
187
                                      const char *job_hold_until,
188
                                      const char *user_name);
189
190
CphJobStatus cph_cups_job_get_status (CphCups    *cups,
191
                                      int         job_id,
192
                                      const char *user);
193
194
gboolean cph_cups_is_printer_uri_local (const char *uri);
195
196
G_END_DECLS
197
198
#endif /* CPH_CUPS_H */