gtkprinteroption.h 4.37 KB
Newer Older
Cody Russell's avatar
Cody Russell committed
1
/* GTK - The GIMP Toolkit
2 3 4 5 6 7 8 9 10 11 12 13 14 15
 * gtkprinteroption.h: printer option
 * Copyright (C) 2006, Red Hat, Inc.
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This library 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
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
Javier Jardón's avatar
Javier Jardón committed
16
 * License along with this library. If not, see <http://www.gnu.org/licenses/>.
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
 */

#ifndef __GTK_PRINTER_OPTION_H__
#define __GTK_PRINTER_OPTION_H__

/* This is a "semi-private" header; it is meant only for
 * alternate GtkPrintDialog backend modules; no stability guarantees 
 * are made at this point
 */
#ifndef GTK_PRINT_BACKEND_ENABLE_UNSUPPORTED
#error "GtkPrintBackend is not supported API for general use"
#endif

#include <glib-object.h>

G_BEGIN_DECLS

#define GTK_TYPE_PRINTER_OPTION             (gtk_printer_option_get_type ())
#define GTK_PRINTER_OPTION(obj)             (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_PRINTER_OPTION, GtkPrinterOption))
#define GTK_IS_PRINTER_OPTION(obj)          (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_PRINTER_OPTION))

typedef struct _GtkPrinterOption       GtkPrinterOption;
typedef struct _GtkPrinterOptionClass  GtkPrinterOptionClass;

#define GTK_PRINTER_OPTION_GROUP_IMAGE_QUALITY "ImageQuality"
#define GTK_PRINTER_OPTION_GROUP_FINISHING "Finishing"

typedef enum {
  GTK_PRINTER_OPTION_TYPE_BOOLEAN,
  GTK_PRINTER_OPTION_TYPE_PICKONE,
47 48 49 50 51
  GTK_PRINTER_OPTION_TYPE_PICKONE_PASSWORD,
  GTK_PRINTER_OPTION_TYPE_PICKONE_PASSCODE,
  GTK_PRINTER_OPTION_TYPE_PICKONE_REAL,
  GTK_PRINTER_OPTION_TYPE_PICKONE_INT,
  GTK_PRINTER_OPTION_TYPE_PICKONE_STRING,
52
  GTK_PRINTER_OPTION_TYPE_ALTERNATIVE,
53
  GTK_PRINTER_OPTION_TYPE_STRING,
54 55
  GTK_PRINTER_OPTION_TYPE_FILESAVE,
  GTK_PRINTER_OPTION_TYPE_INFO
56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71
} GtkPrinterOptionType;

struct _GtkPrinterOption
{
  GObject parent_instance;

  char *name;
  char *display_text;
  GtkPrinterOptionType type;

  char *value;
  
  int num_choices;
  char **choices;
  char **choices_display;
  
72 73
  gboolean activates_default;

74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90
  gboolean has_conflict;
  char *group;
};

struct _GtkPrinterOptionClass
{
  GObjectClass parent_class;

  void (*changed) (GtkPrinterOption *option);

  /* Padding for future expansion */
  void (*_gtk_reserved1) (void);
  void (*_gtk_reserved2) (void);
  void (*_gtk_reserved3) (void);
  void (*_gtk_reserved4) (void);
};

91
GDK_AVAILABLE_IN_ALL
92 93
GType   gtk_printer_option_get_type       (void) G_GNUC_CONST;

94
GDK_AVAILABLE_IN_ALL
95 96 97
GtkPrinterOption *gtk_printer_option_new                    (const char           *name,
							     const char           *display_text,
							     GtkPrinterOptionType  type);
98
GDK_AVAILABLE_IN_ALL
99 100
void              gtk_printer_option_set                    (GtkPrinterOption     *option,
							     const char           *value);
101
GDK_AVAILABLE_IN_ALL
102 103
void              gtk_printer_option_set_has_conflict       (GtkPrinterOption     *option,
							     gboolean              has_conflict);
104
GDK_AVAILABLE_IN_ALL
105
void              gtk_printer_option_clear_has_conflict     (GtkPrinterOption     *option);
106
GDK_AVAILABLE_IN_ALL
107 108
void              gtk_printer_option_set_boolean            (GtkPrinterOption     *option,
							     gboolean              value);
109
GDK_AVAILABLE_IN_ALL
110 111
void              gtk_printer_option_allocate_choices       (GtkPrinterOption     *option,
							     int                   num);
112
GDK_AVAILABLE_IN_ALL
113 114 115 116
void              gtk_printer_option_choices_from_array     (GtkPrinterOption     *option,
							     int                   num_choices,
							     char                 *choices[],
							     char                 *choices_display[]);
117
GDK_AVAILABLE_IN_ALL
118 119
gboolean          gtk_printer_option_has_choice             (GtkPrinterOption     *option,
							    const char           *choice);
120
GDK_AVAILABLE_IN_ALL
121 122
void              gtk_printer_option_set_activates_default (GtkPrinterOption     *option,
							    gboolean              activates);
123
GDK_AVAILABLE_IN_ALL
124
gboolean          gtk_printer_option_get_activates_default (GtkPrinterOption     *option);
125 126 127 128 129 130 131


G_END_DECLS

#endif /* __GTK_PRINTER_OPTION_H__ */