• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright 2012 Canonical Ltd.
3  *
4  * This program is free software: you can redistribute it and/or modify it
5  * under the terms of the GNU General Public License version 3, as published
6  * by the Free Software Foundation.
7  *
8  * This program is distributed in the hope that it will be useful, but
9  * WITHOUT ANY WARRANTY; without even the implied warranties of
10  * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
11  * PURPOSE.  See the GNU General Public License for more details.
12  *
13  * You should have received a copy of the GNU General Public License along
14  * with this program.  If not, see <http://www.gnu.org/licenses/>.
15  */
16 
17 #ifndef banner_h
18 #define banner_h
19 
20 #include <config.h>
21 #include <stdio.h>
22 #include <cups/cups.h>
23 
24 enum banner_info {
25     INFO_IMAGEABLE_AREA            = 1,
26     INFO_JOB_BILLING               = 1 << 1,
27     INFO_JOB_ID                    = 1 << 2,
28     INFO_JOB_NAME                  = 1 << 3,
29     INFO_JOB_ORIGINATING_HOST_NAME = 1 << 4,
30     INFO_JOB_ORIGINATING_USER_NAME = 1 << 5,
31     INFO_JOB_UUID                  = 1 << 6,
32     INFO_OPTIONS                   = 1 << 7,
33     INFO_PAPER_NAME                = 1 << 8,
34     INFO_PAPER_SIZE                = 1 << 9,
35     INFO_PRINTER_DRIVER_NAME       = 1 << 10,
36     INFO_PRINTER_DRIVER_VERSION    = 1 << 11,
37     INFO_PRINTER_INFO              = 1 << 12,
38     INFO_PRINTER_LOCATION          = 1 << 13,
39     INFO_PRINTER_MAKE_AND_MODEL    = 1 << 14,
40     INFO_PRINTER_NAME              = 1 << 15,
41     INFO_TIME_AT_CREATION          = 1 << 16,
42     INFO_TIME_AT_PROCESSING        = 1 << 17
43 };
44 
45 
46 typedef struct {
47     char *template_file;
48     char *header, *footer;
49     unsigned infos;
50 } banner_t;
51 
52 
53 banner_t * banner_new_from_file(const char *filename,
54         int *num_options, cups_option_t **options);
55 void banner_free(banner_t *banner);
56 
57 #endif
58 
59