]> git.saurik.com Git - wxWidgets.git/blob - interface/dcps.h
c93c6f81785f1255968ee34ac2aa6090c1ef0fcc
[wxWidgets.git] / interface / dcps.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: dcps.h
3 // Purpose: interface of wxPostScriptDC
4 // Author: wxWidgets team
5 // RCS-ID: $Id$
6 // Licence: wxWindows license
7 /////////////////////////////////////////////////////////////////////////////
8
9 /**
10 @class wxPostScriptDC
11 @wxheader{dcps.h}
12
13 This defines the wxWidgets Encapsulated PostScript device context,
14 which can write PostScript files on any platform. See wxDC for
15 descriptions of the member functions.
16
17 @library{wxbase}
18 @category{dc}
19 */
20 class wxPostScriptDC : public wxDC
21 {
22 public:
23 //@{
24 /**
25 Constructor. @a output is an optional file for printing to, and if
26 @a interactive is @true a dialog box will be displayed for adjusting
27 various parameters. @a parent is the parent of the printer dialog box.
28 Use the @e Ok member to test whether the constructor was successful
29 in creating a usable device context.
30 See @ref overview_printersettings "Printer settings" for functions to set and
31 get PostScript printing settings.
32 This constructor and the global printer settings are now deprecated;
33 use the wxPrintData constructor instead.
34 */
35 wxPostScriptDC(const wxPrintData& printData);
36 wxPostScriptDC(const wxString& output,
37 bool interactive = true,
38 wxWindow* parent);
39 //@}
40
41 /**
42 Return resolution used in PostScript output. See
43 SetResolution().
44 */
45 static int GetResolution();
46
47 /**
48 Set resolution (in pixels per inch) that will be used in PostScript
49 output. Default is 720ppi.
50 */
51 static void SetResolution(int ppi);
52 };
53
54
55
56 // ============================================================================
57 // Global functions/macros
58 // ============================================================================
59
60 /**
61 Gets the printer command used to print a file. The default is @c lpr.
62 */
63 wxString wxGetPrinterCommand();
64
65 /**
66 Sets the printer command used to print a file. The default is @c lpr.
67 */
68 void wxSetPrinterCommand(const wxString& command);
69
70 /**
71 Gets the orientation (PS_PORTRAIT or PS_LANDSCAPE). The default is PS_PORTRAIT.
72 */
73 int wxGetPrinterOrientation();
74
75 /**
76 Sets the additional options for the print command (e.g. specific printer). The
77 default is nothing.
78 */
79 void wxSetPrinterOptions(const wxString& options);
80
81 /**
82 Gets the translation (from the top left corner) for PostScript output. The
83 default is 0.0, 0.0.
84 */
85 void wxGetPrinterTranslation(float* x, float* y);
86
87 /**
88 Sets the scaling factor for PostScript output. The default is 1.0, 1.0.
89 */
90 void wxSetPrinterScaling(float x, float y);
91
92 /**
93 Sets the orientation (PS_PORTRAIT or PS_LANDSCAPE). The default is PS_PORTRAIT.
94 */
95 void wxSetPrinterOrientation(int orientation);
96
97 /**
98 Sets the printing mode controlling where output is sent (PS_PREVIEW, PS_FILE or
99 PS_PRINTER).
100 The default is PS_PREVIEW.
101 */
102 void wxSetPrinterMode(int mode);
103
104 /**
105 Sets the PostScript output filename.
106 */
107 void wxSetPrinterFile(const wxString& filename);
108
109 /**
110 Gets the PostScript output filename.
111 */
112 wxString wxGetPrinterFile();
113
114 /**
115 Gets the additional options for the print command (e.g. specific printer). The
116 default is nothing.
117 */
118 wxString wxGetPrinterOptions();
119
120 /**
121 Gets the command used to view a PostScript file. The default depends on the
122 platform.
123 */
124 wxString wxGetPrinterPreviewCommand();
125
126 /**
127 Gets the printing mode controlling where output is sent (PS_PREVIEW, PS_FILE or
128 PS_PRINTER).
129 The default is PS_PREVIEW.
130 */
131 int wxGetPrinterMode();
132
133 /**
134 Gets the scaling factor for PostScript output. The default is 1.0, 1.0.
135 */
136 void wxGetPrinterScaling(float* x, float* y);
137
138 /**
139 Sets the command used to view a PostScript file. The default depends on the
140 platform.
141 */
142 void wxSetPrinterPreviewCommand(const wxString& command);
143