gtkprintsettings.h 11.5 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
/* GTK - The GIMP Toolkit
 * gtkprintsettings.h: Print Settings
 * 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
 * License along with this library; if not, write to the
 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 * Boston, MA 02111-1307, USA.
 */
#ifndef __GTK_PRINT_SETTINGS_H__
#define __GTK_PRINT_SETTINGS_H__

#include <glib-object.h>
#include "gtkpapersize.h"

G_BEGIN_DECLS

typedef struct _GtkPrintSettings GtkPrintSettings;

#define GTK_TYPE_PRINT_SETTINGS    (gtk_print_settings_get_type ())
#define GTK_PRINT_SETTINGS(obj)    (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_PRINT_SETTINGS, GtkPrintSettings))
#define GTK_IS_PRINT_SETTINGS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_PRINT_SETTINGS))

typedef void  (*GtkPrintSettingsFunc)  (const gchar *key,
					const gchar *value,
					gpointer     user_data);

38 39
typedef struct _GtkPageRange GtkPageRange;
struct _GtkPageRange
40 41 42
{
  gint start;
  gint end;
43
};
44 45 46 47 48

GType             gtk_print_settings_get_type (void) G_GNUC_CONST;
GtkPrintSettings *gtk_print_settings_new      (void);

GtkPrintSettings *gtk_print_settings_copy                    (GtkPrintSettings     *other);
Matthias Clasen's avatar
Matthias Clasen committed
49 50 51

GtkPrintSettings *gtk_print_settings_new_from_file           (const gchar          *file_name,
							      GError              **error);
52 53 54
gboolean          gtk_print_settings_load_file               (GtkPrintSettings     *settings,
							      const gchar          *file_name,
							      GError              **error);
Matthias Clasen's avatar
Matthias Clasen committed
55 56 57 58 59
gboolean          gtk_print_settings_to_file                 (GtkPrintSettings     *settings,
							      const gchar          *file_name,
							      GError              **error);
GtkPrintSettings *gtk_print_settings_new_from_key_file       (GKeyFile             *key_file,
							      const gchar          *group_name,
60 61 62 63
							      GError              **error);
gboolean          gtk_print_settings_load_key_file           (GtkPrintSettings     *settings,
							      GKeyFile             *key_file,
							      const gchar          *group_name,
Matthias Clasen's avatar
Matthias Clasen committed
64 65 66 67
							      GError              **error);
void              gtk_print_settings_to_key_file             (GtkPrintSettings     *settings,
							      GKeyFile             *key_file,
							      const gchar          *group_name);
68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113
gboolean          gtk_print_settings_has_key                 (GtkPrintSettings     *settings,
							      const gchar          *key);
G_CONST_RETURN gchar *gtk_print_settings_get                (GtkPrintSettings     *settings,
							      const gchar          *key);
void              gtk_print_settings_set                     (GtkPrintSettings     *settings,
							      const gchar          *key,
							      const gchar          *value);
void              gtk_print_settings_unset                   (GtkPrintSettings     *settings,
							      const gchar          *key);
void              gtk_print_settings_foreach                 (GtkPrintSettings     *settings,
							      GtkPrintSettingsFunc  func,
							      gpointer              user_data);
gboolean          gtk_print_settings_get_bool                (GtkPrintSettings     *settings,
							      const gchar          *key);
void              gtk_print_settings_set_bool                (GtkPrintSettings     *settings,
							      const gchar          *key,
							      gboolean              value);
gdouble           gtk_print_settings_get_double              (GtkPrintSettings     *settings,
							      const gchar          *key);
gdouble           gtk_print_settings_get_double_with_default (GtkPrintSettings     *settings,
							      const gchar          *key,
							      gdouble               def);
void              gtk_print_settings_set_double              (GtkPrintSettings     *settings,
							      const gchar          *key,
							      gdouble               value);
gdouble           gtk_print_settings_get_length              (GtkPrintSettings     *settings,
							      const gchar          *key,
							      GtkUnit               unit);
void              gtk_print_settings_set_length              (GtkPrintSettings     *settings,
							      const gchar          *key,
							      gdouble               value,
							      GtkUnit               unit);
gint              gtk_print_settings_get_int                 (GtkPrintSettings     *settings,
							      const gchar          *key);
gint              gtk_print_settings_get_int_with_default    (GtkPrintSettings     *settings,
							      const gchar          *key,
							      gint                  def);
void              gtk_print_settings_set_int                 (GtkPrintSettings     *settings,
							      const gchar          *key,
							      gint                  value);

#define GTK_PRINT_SETTINGS_PRINTER        "printer"
#define GTK_PRINT_SETTINGS_ORIENTATION    "orientation"
#define GTK_PRINT_SETTINGS_PAPER_FORMAT   "paper-format"
#define GTK_PRINT_SETTINGS_PAPER_WIDTH    "paper-width"
#define GTK_PRINT_SETTINGS_PAPER_HEIGHT   "paper-height"
Alexander Larsson's avatar
Alexander Larsson committed
114
#define GTK_PRINT_SETTINGS_N_COPIES       "n-copies"
115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131
#define GTK_PRINT_SETTINGS_DEFAULT_SOURCE "default-source"
#define GTK_PRINT_SETTINGS_QUALITY        "quality"
#define GTK_PRINT_SETTINGS_RESOLUTION     "resolution"
#define GTK_PRINT_SETTINGS_USE_COLOR      "use-color"
#define GTK_PRINT_SETTINGS_DUPLEX         "duplex"
#define GTK_PRINT_SETTINGS_COLLATE        "collate"
#define GTK_PRINT_SETTINGS_REVERSE        "reverse"
#define GTK_PRINT_SETTINGS_MEDIA_TYPE     "media-type"
#define GTK_PRINT_SETTINGS_DITHER         "dither"
#define GTK_PRINT_SETTINGS_SCALE          "scale"
#define GTK_PRINT_SETTINGS_PRINT_PAGES    "print-pages"
#define GTK_PRINT_SETTINGS_PAGE_RANGES    "page-ranges"
#define GTK_PRINT_SETTINGS_PAGE_SET       "page-set"
#define GTK_PRINT_SETTINGS_FINISHINGS     "finishings"
#define GTK_PRINT_SETTINGS_NUMBER_UP      "number-up"
#define GTK_PRINT_SETTINGS_OUTPUT_BIN     "output-bin"

132 133 134
#define GTK_PRINT_SETTINGS_OUTPUT_FILE_FORMAT  "output-file-format"
#define GTK_PRINT_SETTINGS_OUTPUT_URI          "output-uri"

135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156
#define GTK_PRINT_SETTINGS_WIN32_DRIVER_VERSION "win32-driver-version"
#define GTK_PRINT_SETTINGS_WIN32_DRIVER_EXTRA   "win32-driver-extra"

/* Helpers: */

G_CONST_RETURN gchar *gtk_print_settings_get_printer     (GtkPrintSettings   *settings);
void               gtk_print_settings_set_printer        (GtkPrintSettings   *settings,
							  const gchar        *printer);
GtkPageOrientation gtk_print_settings_get_orientation    (GtkPrintSettings   *settings);
void               gtk_print_settings_set_orientation    (GtkPrintSettings   *settings,
							  GtkPageOrientation  orientation);
GtkPaperSize *     gtk_print_settings_get_paper_size     (GtkPrintSettings   *settings);
void               gtk_print_settings_set_paper_size     (GtkPrintSettings   *settings,
							  GtkPaperSize       *paper_size);
gdouble            gtk_print_settings_get_paper_width    (GtkPrintSettings   *settings,
							  GtkUnit             unit);
void               gtk_print_settings_set_paper_width    (GtkPrintSettings   *settings,
							  gdouble             width,
							  GtkUnit             unit);
gdouble            gtk_print_settings_get_paper_height   (GtkPrintSettings   *settings,
							  GtkUnit             unit);
void               gtk_print_settings_set_paper_height   (GtkPrintSettings   *settings,
157
							  gdouble             height,
158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173
							  GtkUnit             unit);
gboolean           gtk_print_settings_get_use_color      (GtkPrintSettings   *settings);
void               gtk_print_settings_set_use_color      (GtkPrintSettings   *settings,
							  gboolean            use_color);
gboolean           gtk_print_settings_get_collate        (GtkPrintSettings   *settings);
void               gtk_print_settings_set_collate        (GtkPrintSettings   *settings,
							  gboolean            collate);
gboolean           gtk_print_settings_get_reverse        (GtkPrintSettings   *settings);
void               gtk_print_settings_set_reverse        (GtkPrintSettings   *settings,
							  gboolean            reverse);
GtkPrintDuplex     gtk_print_settings_get_duplex         (GtkPrintSettings   *settings);
void               gtk_print_settings_set_duplex         (GtkPrintSettings   *settings,
							  GtkPrintDuplex      duplex);
GtkPrintQuality    gtk_print_settings_get_quality        (GtkPrintSettings   *settings);
void               gtk_print_settings_set_quality        (GtkPrintSettings   *settings,
							  GtkPrintQuality     quality);
Alexander Larsson's avatar
Alexander Larsson committed
174 175
gint               gtk_print_settings_get_n_copies       (GtkPrintSettings   *settings);
void               gtk_print_settings_set_n_copies       (GtkPrintSettings   *settings,
176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215
							  gint                num_copies);
gint               gtk_print_settings_get_number_up      (GtkPrintSettings   *settings);
void               gtk_print_settings_set_number_up      (GtkPrintSettings   *settings,
							  gint                number_up);
gint               gtk_print_settings_get_resolution     (GtkPrintSettings   *settings);
void               gtk_print_settings_set_resolution     (GtkPrintSettings   *settings,
							  gint                resolution);
gdouble            gtk_print_settings_get_scale          (GtkPrintSettings   *settings);
void               gtk_print_settings_set_scale          (GtkPrintSettings   *settings,
							  gdouble             scale);
GtkPrintPages      gtk_print_settings_get_print_pages    (GtkPrintSettings   *settings);
void               gtk_print_settings_set_print_pages    (GtkPrintSettings   *settings,
							  GtkPrintPages       pages);
GtkPageRange *     gtk_print_settings_get_page_ranges    (GtkPrintSettings   *settings,
							  gint               *num_ranges);
void               gtk_print_settings_set_page_ranges    (GtkPrintSettings   *settings,
							  GtkPageRange       *page_ranges,
							  gint                num_ranges);
GtkPageSet         gtk_print_settings_get_page_set       (GtkPrintSettings   *settings);
void               gtk_print_settings_set_page_set       (GtkPrintSettings   *settings,
							  GtkPageSet          page_set);
G_CONST_RETURN gchar *gtk_print_settings_get_default_source (GtkPrintSettings   *settings);
void               gtk_print_settings_set_default_source (GtkPrintSettings   *settings,
							  const gchar        *default_source);
G_CONST_RETURN gchar *gtk_print_settings_get_media_type  (GtkPrintSettings   *settings);
void               gtk_print_settings_set_media_type     (GtkPrintSettings   *settings,
							  const gchar        *media_type);
G_CONST_RETURN gchar *gtk_print_settings_get_dither      (GtkPrintSettings   *settings);
void               gtk_print_settings_set_dither         (GtkPrintSettings   *settings,
							  const gchar        *dither);
G_CONST_RETURN gchar *gtk_print_settings_get_finishings  (GtkPrintSettings   *settings);
void               gtk_print_settings_set_finishings     (GtkPrintSettings   *settings,
							  const gchar        *finishings);
G_CONST_RETURN gchar *gtk_print_settings_get_output_bin  (GtkPrintSettings   *settings);
void               gtk_print_settings_set_output_bin     (GtkPrintSettings   *settings,
							  const gchar        *output_bin);

G_END_DECLS

#endif /* __GTK_PRINT_SETTINGS_H__ */