]> Pileus Git - ~andy/gtk/blob - gtk/gtkprinteroption.h
50e7ddf324a56676c0671edeba3ef79197f22130
[~andy/gtk] / gtk / gtkprinteroption.h
1 /* GTK - The GIMP Toolkit
2  * gtkprinteroption.h: printer option
3  * Copyright (C) 2006, Red Hat, Inc.
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this library; if not, write to the
17  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18  * Boston, MA 02111-1307, USA.
19  */
20
21 #ifndef __GTK_PRINTER_OPTION_H__
22 #define __GTK_PRINTER_OPTION_H__
23
24 /* This is a "semi-private" header; it is meant only for
25  * alternate GtkPrintDialog backend modules; no stability guarantees 
26  * are made at this point
27  */
28 #ifndef GTK_PRINT_BACKEND_ENABLE_UNSUPPORTED
29 #error "GtkPrintBackend is not supported API for general use"
30 #endif
31
32 #include <glib-object.h>
33
34 G_BEGIN_DECLS
35
36 #define GTK_TYPE_PRINTER_OPTION             (gtk_printer_option_get_type ())
37 #define GTK_PRINTER_OPTION(obj)             (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_PRINTER_OPTION, GtkPrinterOption))
38 #define GTK_IS_PRINTER_OPTION(obj)          (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_PRINTER_OPTION))
39
40 typedef struct _GtkPrinterOption       GtkPrinterOption;
41 typedef struct _GtkPrinterOptionClass  GtkPrinterOptionClass;
42
43 #define GTK_PRINTER_OPTION_GROUP_IMAGE_QUALITY "ImageQuality"
44 #define GTK_PRINTER_OPTION_GROUP_FINISHING "Finishing"
45
46 typedef enum {
47   GTK_PRINTER_OPTION_TYPE_BOOLEAN,
48   GTK_PRINTER_OPTION_TYPE_PICKONE,
49   GTK_PRINTER_OPTION_TYPE_PICKONE_PASSWORD,
50   GTK_PRINTER_OPTION_TYPE_PICKONE_PASSCODE,
51   GTK_PRINTER_OPTION_TYPE_PICKONE_REAL,
52   GTK_PRINTER_OPTION_TYPE_PICKONE_INT,
53   GTK_PRINTER_OPTION_TYPE_PICKONE_STRING,
54   GTK_PRINTER_OPTION_TYPE_ALTERNATIVE,
55   GTK_PRINTER_OPTION_TYPE_STRING,
56   GTK_PRINTER_OPTION_TYPE_FILESAVE
57 } GtkPrinterOptionType;
58
59 struct _GtkPrinterOption
60 {
61   GObject parent_instance;
62
63   char *name;
64   char *display_text;
65   GtkPrinterOptionType type;
66
67   char *value;
68   
69   int num_choices;
70   char **choices;
71   char **choices_display;
72   
73   gboolean activates_default;
74
75   gboolean has_conflict;
76   char *group;
77 };
78
79 struct _GtkPrinterOptionClass
80 {
81   GObjectClass parent_class;
82
83   void (*changed) (GtkPrinterOption *option);
84
85   /* Padding for future expansion */
86   void (*_gtk_reserved1) (void);
87   void (*_gtk_reserved2) (void);
88   void (*_gtk_reserved3) (void);
89   void (*_gtk_reserved4) (void);
90 };
91
92 GType   gtk_printer_option_get_type       (void) G_GNUC_CONST;
93
94 GtkPrinterOption *gtk_printer_option_new                    (const char           *name,
95                                                              const char           *display_text,
96                                                              GtkPrinterOptionType  type);
97 void              gtk_printer_option_set                    (GtkPrinterOption     *option,
98                                                              const char           *value);
99 void              gtk_printer_option_set_has_conflict       (GtkPrinterOption     *option,
100                                                              gboolean              has_conflict);
101 void              gtk_printer_option_clear_has_conflict     (GtkPrinterOption     *option);
102 void              gtk_printer_option_set_boolean            (GtkPrinterOption     *option,
103                                                              gboolean              value);
104 void              gtk_printer_option_allocate_choices       (GtkPrinterOption     *option,
105                                                              int                   num);
106 void              gtk_printer_option_choices_from_array     (GtkPrinterOption     *option,
107                                                              int                   num_choices,
108                                                              char                 *choices[],
109                                                              char                 *choices_display[]);
110 gboolean          gtk_printer_option_has_choice             (GtkPrinterOption     *option,
111                                                             const char           *choice);
112 void              gtk_printer_option_set_activates_default (GtkPrinterOption     *option,
113                                                             gboolean              activates);
114 gboolean          gtk_printer_option_get_activates_default (GtkPrinterOption     *option);
115
116
117 G_END_DECLS
118
119 #endif /* __GTK_PRINTER_OPTION_H__ */
120
121