]> git.saurik.com Git - wxWidgets.git/blame - include/wx/cmndata.h
more fixes, printing works quite fine now
[wxWidgets.git] / include / wx / cmndata.h
CommitLineData
c801d85f
KB
1/////////////////////////////////////////////////////////////////////////////
2// Name: cmndata.h
3// Purpose: Common GDI data classes
4// Author: Julian Smart and others
5// Modified by:
6// Created: 01/02/97
7// RCS-ID: $Id$
8// Copyright: (c)
9// Licence: wxWindows licence
10/////////////////////////////////////////////////////////////////////////////
11
34138703
JS
12#ifndef _WX_CMNDATA_H_BASE_
13#define _WX_CMNDATA_H_BASE_
c801d85f
KB
14
15#ifdef __GNUG__
16#pragma interface "cmndata.h"
17#endif
18
34138703
JS
19#include "wx/font.h"
20#include "wx/colour.h"
21
c801d85f
KB
22class WXDLLEXPORT wxColourData: public wxObject
23{
24 DECLARE_DYNAMIC_CLASS(wxColourData)
25 public:
26 wxColour dataColour;
27 wxColour custColours[16];
28 bool chooseFull;
29
30 wxColourData(void);
31 ~wxColourData(void);
32
33 inline void SetChooseFull(bool flag) { chooseFull = flag; }
34 inline bool GetChooseFull(void) { return chooseFull; }
35 inline void SetColour(wxColour& colour) { dataColour = colour; }
36 inline wxColour &GetColour(void) { return dataColour; }
37
38 // Array of 16 custom colours
39 void SetCustomColour(int i, wxColour& colour);
40 wxColour GetCustomColour(int i);
41
42 void operator=(const wxColourData& data);
43};
44
45class WXDLLEXPORT wxFontData: public wxObject
46{
47 DECLARE_DYNAMIC_CLASS(wxFontData)
48 public:
49 wxColour fontColour;
50 bool showHelp;
51 bool allowSymbols;
52 bool enableEffects;
53 wxFont initialFont;
54 wxFont chosenFont;
55 int minSize;
56 int maxSize;
57
58 wxFontData(void);
59 ~wxFontData(void);
60
61 inline void SetAllowSymbols(bool flag) { allowSymbols = flag; }
62 inline bool GetAllowSymbols(void) { return allowSymbols; }
63 inline void SetColour(const wxColour& colour) { fontColour = colour; }
64 inline wxColour &GetColour(void) { return fontColour; }
65 inline void SetShowHelp(bool flag) { showHelp = flag; }
66 inline bool GetShowHelp(void) { return showHelp; }
67 inline void EnableEffects(bool flag) { enableEffects = flag; }
68 inline bool GetEnableEffects(void) { return enableEffects; }
69 inline void SetInitialFont(const wxFont& font) { initialFont = font; }
70 inline wxFont GetInitialFont(void) { return initialFont; }
71 inline void SetChosenFont(const wxFont& font) { chosenFont = font; }
72 inline wxFont GetChosenFont(void) { return chosenFont; }
73 inline void SetRange(int minRange, int maxRange) { minSize = minRange; maxSize = maxRange; }
74
75 void operator=(const wxFontData& data);
76};
77
78/*
79 * wxPrintData
80 * Encapsulates information displayed and edited in the printer dialog box.
81 */
82
83class WXDLLEXPORT wxPrintData: public wxObject
84{
85 DECLARE_DYNAMIC_CLASS(wxPrintData)
86
87 public:
2049ba38 88#ifdef __WXMSW__
c801d85f
KB
89 void *printData;
90#endif
91 int printFromPage;
92 int printToPage;
93 int printMinPage;
94 int printMaxPage;
95 int printNoCopies;
96 int printOrientation;
97 bool printAllPages;
98 bool printCollate;
99 bool printToFile;
100 bool printEnableSelection;
101 bool printEnablePageNumbers;
102 bool printEnableHelp;
103 bool printEnablePrintToFile;
104 bool printSetupDialog;
105
106 wxPrintData(void);
107 ~wxPrintData(void);
108
109 inline int GetFromPage(void) { return printFromPage; };
110 inline int GetToPage(void) { return printToPage; };
111 inline int GetMinPage(void) { return printMinPage; };
112 inline int GetMaxPage(void) { return printMaxPage; };
113 inline int GetNoCopies(void) { return printNoCopies; };
114 inline bool GetAllPages(void) { return printAllPages; };
115 inline bool GetCollate(void) { return printCollate; };
116 inline bool GetPrintToFile(void) { return printToFile; };
117 inline bool GetSetupDialog(void) { return printSetupDialog; };
118 inline int GetOrientation(void) { return printOrientation; };
119
120 inline void SetFromPage(int v) { printFromPage = v; };
121 inline void SetToPage(int v) { printToPage = v; };
122 inline void SetMinPage(int v) { printMinPage = v; };
123 inline void SetMaxPage(int v) { printMaxPage = v; };
124 inline void SetNoCopies(int v) { printNoCopies = v; };
125 inline void SetAllPages(bool flag) { printAllPages = flag; };
126 inline void SetCollate(bool flag) { printCollate = flag; };
127 inline void SetPrintToFile(bool flag) { printToFile = flag; };
128 inline void SetSetupDialog(bool flag) { printSetupDialog = flag; };
129 inline void SetOrientation(int orient) { printOrientation = orient; };
130
131 inline void EnablePrintToFile(bool flag) { printEnablePrintToFile = flag; };
132 inline void EnableSelection(bool flag) { printEnableSelection = flag; };
133 inline void EnablePageNumbers(bool flag) { printEnablePageNumbers = flag; };
134 inline void EnableHelp(bool flag) { printEnableHelp = flag; };
135
136 inline bool GetEnablePrintToFile(void) { return printEnablePrintToFile; };
137 inline bool GetEnableSelection(void) { return printEnableSelection; };
138 inline bool GetEnablePageNumbers(void) { return printEnablePageNumbers; };
139 inline bool GetEnableHelp(void) { return printEnableHelp; };
140
141 void operator=(const wxPrintData& data);
142
2049ba38 143#ifdef __WXMSW__
c801d85f
KB
144 // Convert to/from the PRINTDLG structure
145 void ConvertToNative(void);
146 void ConvertFromNative(void);
147 void SetOwnerWindow(wxWindow* win);
148 inline void* GetNativeData(void) { return printData; }
149#endif
150};
151
152/*
153 * This is the data used (and returned) by the wxPageSetupDialog.
154 */
155
156class WXDLLEXPORT wxPageSetupData: public wxObject
157{
158 DECLARE_DYNAMIC_CLASS(wxPageSetupData)
159
160 public:
161#if defined(__WIN95__)
162 void* m_pageSetupData;
163#endif
164 wxPoint m_paperSize;
165 wxPoint m_minMarginTopLeft;
166 wxPoint m_minMarginBottomRight;
167 wxPoint m_marginTopLeft;
168 wxPoint m_marginBottomRight;
169 int m_orientation;
170
171 // Flags
172 bool m_defaultMinMargins;
173 bool m_enableMargins;
174 bool m_enableOrientation;
175 bool m_enablePaper;
176 bool m_enablePrinter;
177 bool m_getDefaultInfo; // Equiv. to PSD_RETURNDEFAULT
178 bool m_enableHelp;
179
180 wxPageSetupData(void);
181 ~wxPageSetupData(void);
182
183 inline wxPoint GetPaperSize(void) { return m_paperSize; };
184 inline wxPoint GetMinMarginTopLeft(void) { return m_minMarginTopLeft; };
185 inline wxPoint GetMinMarginBottomRight(void) { return m_minMarginBottomRight; };
186 inline wxPoint GetMarginTopLeft(void) { return m_marginTopLeft; };
187 inline wxPoint GetMarginBottomRight(void) { return m_marginBottomRight; };
188 inline int GetOrientation(void) { return m_orientation; };
189
190 inline bool GetDefaultMinMargins(void) { return m_defaultMinMargins; };
191 inline bool GetEnableMargins(void) { return m_enableMargins; };
192 inline bool GetEnableOrientation(void) { return m_enableOrientation; };
193 inline bool GetEnablePaper(void) { return m_enablePaper; };
194 inline bool GetEnablePrinter(void) { return m_enablePrinter; };
195 inline bool GetDefaultInfo(void) { return m_getDefaultInfo; };
196 inline bool GetEnableHelp(void) { return m_enableHelp; };
197
198 inline void SetPaperSize(const wxPoint& pt) { m_paperSize = pt; };
199 inline void SetMinMarginTopLeft(const wxPoint& pt) { m_minMarginTopLeft = pt; };
200 inline void SetMinMarginBottomRight(const wxPoint& pt) { m_minMarginBottomRight = pt; };
201 inline void SetMarginTopLeft(const wxPoint& pt) { m_marginTopLeft = pt; };
202 inline void SetMarginBottomRight(const wxPoint& pt) { m_marginBottomRight = pt; };
203 inline void SetOrientation(int orient) { m_orientation = orient; };
204 inline void SetDefaultMinMargins(bool flag) { m_defaultMinMargins = flag; };
205 inline void SetDefaultInfo(bool flag) { m_getDefaultInfo = flag; };
206
207 inline void EnableMargins(bool flag) { m_enableMargins = flag; };
208 inline void EnableOrientation(bool flag) { m_enableOrientation = flag; };
209 inline void EnablePaper(bool flag) { m_enablePaper = flag; };
210 inline void EnablePrinter(bool flag) { m_enablePrinter = flag; };
211 inline void EnableHelp(bool flag) { m_enableHelp = flag; };
212
213#if defined(__WIN95__)
214 // Convert to/from the PAGESETUPDLG structure
215 void ConvertToNative(void);
216 void ConvertFromNative(void);
217 void SetOwnerWindow(wxWindow* win);
218 inline void* GetNativeData(void) { return m_pageSetupData; }
219#endif
220
221 void operator=(const wxPageSetupData& data);
222};
223
224
225#endif
34138703 226 // _WX_CMNDATA_H_BASE_