]> Pileus Git - ~andy/gtk/blob - gtk/gtkprinteroption.h
stylecontext: Do invalidation on first resize container
[~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, see <http://www.gnu.org/licenses/>.
17  */
18
19 #ifndef __GTK_PRINTER_OPTION_H__
20 #define __GTK_PRINTER_OPTION_H__
21
22 /* This is a "semi-private" header; it is meant only for
23  * alternate GtkPrintDialog backend modules; no stability guarantees 
24  * are made at this point
25  */
26 #ifndef GTK_PRINT_BACKEND_ENABLE_UNSUPPORTED
27 #error "GtkPrintBackend is not supported API for general use"
28 #endif
29
30 #include <glib-object.h>
31
32 G_BEGIN_DECLS
33
34 #define GTK_TYPE_PRINTER_OPTION             (gtk_printer_option_get_type ())
35 #define GTK_PRINTER_OPTION(obj)             (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_PRINTER_OPTION, GtkPrinterOption))
36 #define GTK_IS_PRINTER_OPTION(obj)          (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_PRINTER_OPTION))
37
38 typedef struct _GtkPrinterOption       GtkPrinterOption;
39 typedef struct _GtkPrinterOptionClass  GtkPrinterOptionClass;
40
41 #define GTK_PRINTER_OPTION_GROUP_IMAGE_QUALITY "ImageQuality"
42 #define GTK_PRINTER_OPTION_GROUP_FINISHING "Finishing"
43
44 typedef enum {
45   GTK_PRINTER_OPTION_TYPE_BOOLEAN,
46   GTK_PRINTER_OPTION_TYPE_PICKONE,
47   GTK_PRINTER_OPTION_TYPE_PICKONE_PASSWORD,
48   GTK_PRINTER_OPTION_TYPE_PICKONE_PASSCODE,
49   GTK_PRINTER_OPTION_TYPE_PICKONE_REAL,
50   GTK_PRINTER_OPTION_TYPE_PICKONE_INT,
51   GTK_PRINTER_OPTION_TYPE_PICKONE_STRING,
52   GTK_PRINTER_OPTION_TYPE_ALTERNATIVE,
53   GTK_PRINTER_OPTION_TYPE_STRING,
54   GTK_PRINTER_OPTION_TYPE_FILESAVE,
55   GTK_PRINTER_OPTION_TYPE_INFO
56 } GtkPrinterOptionType;
57
58 struct _GtkPrinterOption
59 {
60   GObject parent_instance;
61
62   char *name;
63   char *display_text;
64   GtkPrinterOptionType type;
65
66   char *value;
67   
68   int num_choices;
69   char **choices;
70   char **choices_display;
71   
72   gboolean activates_default;
73
74   gboolean has_conflict;
75   char *group;
76 };
77
78 struct _GtkPrinterOptionClass
79 {
80   GObjectClass parent_class;
81
82   void (*changed) (GtkPrinterOption *option);
83
84   /* Padding for future expansion */
85   void (*_gtk_reserved1) (void);
86   void (*_gtk_reserved2) (void);
87   void (*_gtk_reserved3) (void);
88   void (*_gtk_reserved4) (void);
89 };
90
91 GType   gtk_printer_option_get_type       (void) G_GNUC_CONST;
92
93 GtkPrinterOption *gtk_printer_option_new                    (const char           *name,
94                                                              const char           *display_text,
95                                                              GtkPrinterOptionType  type);
96 void              gtk_printer_option_set                    (GtkPrinterOption     *option,
97                                                              const char           *value);
98 void              gtk_printer_option_set_has_conflict       (GtkPrinterOption     *option,
99                                                              gboolean              has_conflict);
100 void              gtk_printer_option_clear_has_conflict     (GtkPrinterOption     *option);
101 void              gtk_printer_option_set_boolean            (GtkPrinterOption     *option,
102                                                              gboolean              value);
103 void              gtk_printer_option_allocate_choices       (GtkPrinterOption     *option,
104                                                              int                   num);
105 void              gtk_printer_option_choices_from_array     (GtkPrinterOption     *option,
106                                                              int                   num_choices,
107                                                              char                 *choices[],
108                                                              char                 *choices_display[]);
109 gboolean          gtk_printer_option_has_choice             (GtkPrinterOption     *option,
110                                                             const char           *choice);
111 void              gtk_printer_option_set_activates_default (GtkPrinterOption     *option,
112                                                             gboolean              activates);
113 gboolean          gtk_printer_option_get_activates_default (GtkPrinterOption     *option);
114
115
116 G_END_DECLS
117
118 #endif /* __GTK_PRINTER_OPTION_H__ */
119
120