2011-03-07 17:09:00 +01:00
|
|
|
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-
|
|
|
|
*
|
|
|
|
* Copyright 2009-2010 Red Hat, Inc,
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program 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 General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __PP_UTILS_H__
|
|
|
|
#define __PP_UTILS_H__
|
|
|
|
|
|
|
|
#include <gtk/gtk.h>
|
|
|
|
#include <dbus/dbus-glib.h>
|
|
|
|
|
|
|
|
G_BEGIN_DECLS
|
|
|
|
|
2011-05-06 12:31:42 +02:00
|
|
|
/*
|
|
|
|
* Match level of PPD driver.
|
|
|
|
*/
|
|
|
|
enum
|
|
|
|
{
|
|
|
|
PPD_NO_MATCH = 0,
|
|
|
|
PPD_GENERIC_MATCH,
|
|
|
|
PPD_CLOSE_MATCH,
|
|
|
|
PPD_EXACT_MATCH,
|
|
|
|
PPD_EXACT_CMD_MATCH
|
|
|
|
};
|
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
gchar *ppd_name;
|
|
|
|
gint ppd_match_level;
|
|
|
|
} PPDName;
|
|
|
|
|
2011-03-07 17:09:00 +01:00
|
|
|
DBusGProxy *get_dbus_proxy (const gchar *name,
|
|
|
|
const gchar *path,
|
|
|
|
const gchar *iface,
|
|
|
|
const gboolean system_bus);
|
|
|
|
|
|
|
|
gchar *get_tag_value (const gchar *tag_string,
|
|
|
|
const gchar *tag_name);
|
|
|
|
|
2011-08-02 14:20:29 +02:00
|
|
|
PPDName *get_ppd_name (gchar *device_id,
|
2011-03-07 17:09:00 +01:00
|
|
|
gchar *device_make_and_model,
|
2011-08-02 14:20:29 +02:00
|
|
|
gchar *device_uri);
|
2011-03-07 17:09:00 +01:00
|
|
|
|
|
|
|
char *get_dest_attr (const char *dest_name,
|
|
|
|
const char *attr);
|
|
|
|
|
|
|
|
ipp_t *execute_maintenance_command (const char *printer_name,
|
|
|
|
const char *command,
|
|
|
|
const char *title);
|
|
|
|
|
|
|
|
int ccGetAllowedUsers (gchar ***allowed_users,
|
|
|
|
const char *printer_name);
|
|
|
|
|
2011-04-22 14:30:26 +02:00
|
|
|
gchar *get_ppd_attribute (const gchar *ppd_file_name,
|
2011-03-07 17:09:00 +01:00
|
|
|
const gchar *attribute_name);
|
|
|
|
|
2011-04-05 15:54:09 +02:00
|
|
|
void cancel_cups_subscription (gint id);
|
|
|
|
|
|
|
|
gint renew_cups_subscription (gint id,
|
|
|
|
const char * const *events,
|
|
|
|
gint num_events,
|
|
|
|
gint lease_duration);
|
|
|
|
|
2011-05-16 12:11:30 +02:00
|
|
|
void set_local_default_printer (const gchar *printer_name);
|
|
|
|
|
|
|
|
gboolean printer_set_location (const gchar *printer_name,
|
|
|
|
const gchar *location);
|
|
|
|
|
|
|
|
gboolean printer_set_accepting_jobs (const gchar *printer_name,
|
|
|
|
gboolean accepting_jobs,
|
|
|
|
const gchar *reason);
|
|
|
|
|
|
|
|
gboolean printer_set_enabled (const gchar *printer_name,
|
|
|
|
gboolean enabled);
|
|
|
|
|
|
|
|
gboolean printer_rename (const gchar *old_name,
|
|
|
|
const gchar *new_name);
|
|
|
|
|
|
|
|
gboolean printer_delete (const gchar *printer_name);
|
|
|
|
|
|
|
|
gboolean printer_set_default (const gchar *printer_name);
|
|
|
|
|
|
|
|
gboolean printer_set_shared (const gchar *printer_name,
|
|
|
|
gboolean shared);
|
|
|
|
|
|
|
|
gboolean printer_set_job_sheets (const gchar *printer_name,
|
|
|
|
const gchar *start_sheet,
|
|
|
|
const gchar *end_sheet);
|
|
|
|
|
|
|
|
gboolean printer_set_policy (const gchar *printer_name,
|
|
|
|
const gchar *policy,
|
|
|
|
gboolean error_policy);
|
|
|
|
|
|
|
|
gboolean printer_set_users (const gchar *printer_name,
|
|
|
|
gchar **users,
|
|
|
|
gboolean allowed);
|
|
|
|
|
|
|
|
gboolean class_add_printer (const gchar *class_name,
|
|
|
|
const gchar *printer_name);
|
2011-04-12 16:43:36 +02:00
|
|
|
|
2011-03-07 17:09:00 +01:00
|
|
|
G_END_DECLS
|
|
|
|
|
|
|
|
#endif /* __PP_UTILS_H */
|