1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: Common GDI data classes
4 // Author: Julian Smart and others
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 #ifndef _WX_CMNDATA_H_BASE_
13 #define _WX_CMNDATA_H_BASE_
16 #pragma interface "cmndata.h"
20 #include "wx/colour.h"
22 class WXDLLEXPORT wxColourData
: public wxObject
24 DECLARE_DYNAMIC_CLASS(wxColourData
)
27 wxColour custColours
[16];
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
; }
38 // Array of 16 custom colours
39 void SetCustomColour(int i
, wxColour
& colour
);
40 wxColour
GetCustomColour(int i
);
42 void operator=(const wxColourData
& data
);
45 class WXDLLEXPORT wxFontData
: public wxObject
47 DECLARE_DYNAMIC_CLASS(wxFontData
)
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
; }
75 void operator=(const wxFontData
& data
);
80 * Encapsulates information displayed and edited in the printer dialog box.
83 class WXDLLEXPORT wxPrintData
: public wxObject
85 DECLARE_DYNAMIC_CLASS(wxPrintData
)
100 bool printEnableSelection
;
101 bool printEnablePageNumbers
;
102 bool printEnableHelp
;
103 bool printEnablePrintToFile
;
104 bool printSetupDialog
;
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
; };
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
; };
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
; };
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
; };
141 void operator=(const wxPrintData
& data
);
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
; }
153 * This is the data used (and returned) by the wxPageSetupDialog.
156 class WXDLLEXPORT wxPageSetupData
: public wxObject
158 DECLARE_DYNAMIC_CLASS(wxPageSetupData
)
161 #if defined(__WIN95__)
162 void* m_pageSetupData
;
165 wxPoint m_minMarginTopLeft
;
166 wxPoint m_minMarginBottomRight
;
167 wxPoint m_marginTopLeft
;
168 wxPoint m_marginBottomRight
;
172 bool m_defaultMinMargins
;
173 bool m_enableMargins
;
174 bool m_enableOrientation
;
176 bool m_enablePrinter
;
177 bool m_getDefaultInfo
; // Equiv. to PSD_RETURNDEFAULT
180 wxPageSetupData(void);
181 ~wxPageSetupData(void);
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
; };
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
; };
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
; };
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
; };
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
; }
221 void operator=(const wxPageSetupData
& data
);
226 // _WX_CMNDATA_H_BASE_