]> git.saurik.com Git - wxWidgets.git/blob - interface/cmndata.h
documented that Freeze and Thaw are now recursive
[wxWidgets.git] / interface / cmndata.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: cmndata.h
3 // Purpose: interface of wxFontData
4 // Author: wxWidgets team
5 // RCS-ID: $Id$
6 // Licence: wxWindows license
7 /////////////////////////////////////////////////////////////////////////////
8
9 /**
10 @class wxFontData
11 @wxheader{cmndata.h}
12
13 @ref overview_wxfontdialogoverview "wxFontDialog overview"
14
15 This class holds a variety of information related to font dialogs.
16
17 @library{wxcore}
18 @category{FIXME}
19
20 @see Overview(), wxFont, wxFontDialog
21 */
22 class wxFontData : public wxObject
23 {
24 public:
25 /**
26 Constructor. Initializes @e fontColour to black, @e showHelp to black,
27 @e allowSymbols to @true, @e enableEffects to @true,
28 @e minSize to 0 and @e maxSize to 0.
29 */
30 wxFontData();
31
32 /**
33 Enables or disables 'effects' under MS Windows or generic only. This refers to
34 the
35 controls for manipulating colour, strikeout and underline properties.
36 The default value is @true.
37 */
38 void EnableEffects(bool enable);
39
40 /**
41 Under MS Windows, returns a flag determining whether symbol fonts can be
42 selected. Has no
43 effect on other platforms.
44 The default value is @true.
45 */
46 bool GetAllowSymbols();
47
48 /**
49 Gets the font chosen by the user if the user pressed OK
50 (wxFontDialog::ShowModal returned wxID_OK).
51 */
52 wxFont GetChosenFont();
53
54 /**
55 Gets the colour associated with the font dialog.
56 The default value is black.
57 */
58 wxColour GetColour();
59
60 /**
61 Determines whether 'effects' are enabled under Windows. This refers to the
62 controls for manipulating colour, strikeout and underline properties.
63 The default value is @true.
64 */
65 bool GetEnableEffects();
66
67 /**
68 Gets the font that will be initially used by the font dialog. This should have
69 previously been set by the application.
70 */
71 wxFont GetInitialFont();
72
73 /**
74 Returns @true if the Help button will be shown (Windows only).
75 The default value is @false.
76 */
77 bool GetShowHelp();
78
79 /**
80 Under MS Windows, determines whether symbol fonts can be selected. Has no
81 effect on other platforms.
82 The default value is @true.
83 */
84 void SetAllowSymbols(bool allowSymbols);
85
86 /**
87 Sets the font that will be returned to the user (for internal use only).
88 */
89 void SetChosenFont(const wxFont& font);
90
91 /**
92 Sets the colour that will be used for the font foreground colour.
93 The default colour is black.
94 */
95 void SetColour(const wxColour& colour);
96
97 /**
98 Sets the font that will be initially used by the font dialog.
99 */
100 void SetInitialFont(const wxFont& font);
101
102 /**
103 Sets the valid range for the font point size (Windows only).
104 The default is 0, 0 (unrestricted range).
105 */
106 void SetRange(int min, int max);
107
108 /**
109 Determines whether the Help button will be displayed in the font dialog
110 (Windows only).
111 The default value is @false.
112 */
113 void SetShowHelp(bool showHelp);
114
115 /**
116 Assignment operator for the font data.
117 */
118 void operator =(const wxFontData& data);
119 };
120
121
122
123 /**
124 @class wxPageSetupDialogData
125 @wxheader{cmndata.h}
126
127 This class holds a variety of information related to wxPageSetupDialog.
128
129 It contains a wxPrintData member which is used to hold basic printer
130 configuration data (as opposed to the
131 user-interface configuration settings stored by wxPageSetupDialogData).
132
133 @library{wxcore}
134 @category{printing}
135
136 @see @ref overview_printingoverview "Printing framework overview",
137 wxPageSetupDialog
138 */
139 class wxPageSetupDialogData : public wxObject
140 {
141 public:
142 //@{
143 /**
144 Construct an object from a print data object.
145 */
146 wxPageSetupDialogData();
147 wxPageSetupDialogData(wxPageSetupDialogData& data);
148 wxPageSetupDialogData(wxPrintData& printData);
149 //@}
150
151 /**
152 Destructor.
153 */
154 ~wxPageSetupDialogData();
155
156 /**
157 Enables or disables the 'Help' button (Windows only).
158 */
159 void EnableHelp(bool flag);
160
161 /**
162 Enables or disables the margin controls (Windows only).
163 */
164 void EnableMargins(bool flag);
165
166 /**
167 Enables or disables the orientation control (Windows only).
168 */
169 void EnableOrientation(bool flag);
170
171 /**
172 Enables or disables the paper size control (Windows only).
173 */
174 void EnablePaper(bool flag);
175
176 /**
177 Enables or disables the @b Printer button, which invokes a printer setup dialog.
178 */
179 void EnablePrinter(bool flag);
180
181 /**
182 Returns @true if the dialog will simply return default printer information (such
183 as orientation)
184 instead of showing a dialog. Windows only.
185 */
186 bool GetDefaultInfo() const;
187
188 /**
189 Returns @true if the page setup dialog will take its minimum margin values from
190 the currently
191 selected printer properties. Windows only.
192 */
193 bool GetDefaultMinMargins() const;
194
195 /**
196 Returns @true if the printer setup button is enabled.
197 */
198 bool GetEnableHelp() const;
199
200 /**
201 Returns @true if the margin controls are enabled (Windows only).
202 */
203 bool GetEnableMargins() const;
204
205 /**
206 Returns @true if the orientation control is enabled (Windows only).
207 */
208 bool GetEnableOrientation() const;
209
210 /**
211 Returns @true if the paper size control is enabled (Windows only).
212 */
213 bool GetEnablePaper() const;
214
215 /**
216 Returns @true if the printer setup button is enabled.
217 */
218 bool GetEnablePrinter() const;
219
220 /**
221 Returns the right (x) and bottom (y) margins in millimetres.
222 */
223 wxPoint GetMarginBottomRight() const;
224
225 /**
226 Returns the left (x) and top (y) margins in millimetres.
227 */
228 wxPoint GetMarginTopLeft() const;
229
230 /**
231 Returns the right (x) and bottom (y) minimum margins the user can enter
232 (Windows only). Units
233 are in millimetres
234 */
235 wxPoint GetMinMarginBottomRight() const;
236
237 /**
238 Returns the left (x) and top (y) minimum margins the user can enter (Windows
239 only). Units
240 are in millimetres
241 */
242 wxPoint GetMinMarginTopLeft() const;
243
244 /**
245 Returns the paper id (stored in the internal wxPrintData object).
246 For further information, see wxPrintData::SetPaperId.
247 */
248 wxPaperSize GetPaperId() const;
249
250 /**
251 Returns the paper size in millimetres.
252 */
253 wxSize GetPaperSize() const;
254
255 /**
256 Returns a reference to the @ref overview_wxprintdata "print data" associated
257 with this object.
258 */
259 wxPrintData GetPrintData();
260
261 /**
262 Returns @true if the print data associated with the dialog data is valid.
263 This can return @false on Windows if the current printer is not set, for example.
264 On all other platforms, it returns @true.
265 */
266 bool IsOk() const;
267
268 /**
269 Pass @true if the dialog will simply return default printer information (such as
270 orientation)
271 instead of showing a dialog. Windows only.
272 */
273 void SetDefaultInfo(bool flag);
274
275 /**
276 Pass @true if the page setup dialog will take its minimum margin values from the
277 currently
278 selected printer properties. Windows only. Units are in millimetres
279 */
280 void SetDefaultMinMargins(bool flag);
281
282 /**
283 Sets the right (x) and bottom (y) margins in millimetres.
284 */
285 void SetMarginBottomRight(const wxPoint& pt);
286
287 /**
288 Sets the left (x) and top (y) margins in millimetres.
289 */
290 void SetMarginTopLeft(const wxPoint& pt);
291
292 /**
293 Sets the right (x) and bottom (y) minimum margins the user can enter (Windows
294 only). Units are
295 in millimetres.
296 */
297 void SetMinMarginBottomRight(const wxPoint& pt);
298
299 /**
300 Sets the left (x) and top (y) minimum margins the user can enter (Windows
301 only). Units are
302 in millimetres.
303 */
304 void SetMinMarginTopLeft(const wxPoint& pt);
305
306 /**
307 Sets the paper size id. For further information, see wxPrintData::SetPaperId.
308 Calling this function overrides the explicit paper dimensions passed in
309 SetPaperSize().
310 */
311 void SetPaperId(wxPaperSize& id);
312
313 /**
314 Sets the paper size in millimetres. If a corresponding paper id is found, it
315 will be set in the
316 internal wxPrintData object, otherwise the paper size overrides the paper id.
317 */
318 void SetPaperSize(const wxSize& size);
319
320 /**
321 Sets the @ref overview_wxprintdata "print data" associated with this object.
322 */
323 void SetPrintData(const wxPrintData& printData);
324
325 //@{
326 /**
327 Assigns page setup data to this object.
328 */
329 void operator =(const wxPrintData& data);
330 void operator =(const wxPageSetupDialogData& data);
331 //@}
332 };
333
334
335
336 /**
337 @class wxColourData
338 @wxheader{cmndata.h}
339
340 This class holds a variety of information related to colour dialogs.
341
342 @library{wxcore}
343 @category{FIXME}
344
345 @see wxColour, wxColourDialog, @ref overview_wxcolourdialogoverview
346 "wxColourDialog overview"
347 */
348 class wxColourData : public wxObject
349 {
350 public:
351 /**
352 Constructor. Initializes the custom colours to @c wxNullColour,
353 the @e data colour setting
354 to black, and the @e choose full setting to @true.
355 */
356 wxColourData();
357
358 /**
359 Destructor.
360 */
361 ~wxColourData();
362
363 /**
364 Under Windows, determines whether the Windows colour dialog will display the
365 full dialog
366 with custom colour selection controls. Under PalmOS, determines whether colour
367 dialog
368 will display full rgb colour picker or only available palette indexer.
369 Has no meaning under other platforms.
370 The default value is @true.
371 */
372 bool GetChooseFull() const;
373
374 /**
375 Gets the current colour associated with the colour dialog.
376 The default colour is black.
377 */
378 wxColour GetColour() const;
379
380 /**
381 Gets the @e ith custom colour associated with the colour dialog. @a i should
382 be an integer between 0 and 15.
383 The default custom colours are invalid colours.
384 */
385 wxColour GetCustomColour(int i) const;
386
387 /**
388 Under Windows, tells the Windows colour dialog to display the full dialog
389 with custom colour selection controls. Under other platforms, has no effect.
390 The default value is @true.
391 */
392 void SetChooseFull(const bool flag);
393
394 /**
395 Sets the default colour for the colour dialog.
396 The default colour is black.
397 */
398 void SetColour(const wxColour& colour);
399
400 /**
401 Sets the @e ith custom colour for the colour dialog. @a i should
402 be an integer between 0 and 15.
403 The default custom colours are invalid colours.
404 */
405 void SetCustomColour(int i, const wxColour& colour);
406
407 /**
408 Assignment operator for the colour data.
409 */
410 void operator =(const wxColourData& data);
411 };
412
413
414
415 /**
416 @class wxPrintData
417 @wxheader{cmndata.h}
418
419 This class holds a variety of information related to printers and
420 printer device contexts. This class is used to create a wxPrinterDC
421 and a wxPostScriptDC. It is also used as a data member of wxPrintDialogData
422 and wxPageSetupDialogData, as part of the mechanism for transferring data
423 between the print dialogs and the application.
424
425 @library{wxcore}
426 @category{printing}
427
428 @see @ref overview_printingoverview "Printing framework overview",
429 wxPrintDialog, wxPageSetupDialog, wxPrintDialogData, wxPageSetupDialogData, @ref overview_wxprintdialogoverview "wxPrintDialog Overview", wxPrinterDC, wxPostScriptDC
430 */
431 class wxPrintData : public wxObject
432 {
433 public:
434 //@{
435 /**
436 Copy constructor.
437 */
438 wxPrintData();
439 wxPrintData(const wxPrintData& data);
440 //@}
441
442 /**
443 Destructor.
444 */
445 ~wxPrintData();
446
447 /**
448 Returns the current bin (papersource). By default, the system is left to select
449 the bin (@c wxPRINTBIN_DEFAULT is returned).
450 See SetBin() for the full list of bin values.
451 */
452 wxPrintBin GetBin() const;
453
454 /**
455 Returns @true if collation is on.
456 */
457 bool GetCollate() const;
458
459 /**
460 Returns @true if colour printing is on.
461 */
462 bool GetColour() const;
463
464 /**
465 Returns the duplex mode. One of wxDUPLEX_SIMPLEX, wxDUPLEX_HORIZONTAL,
466 wxDUPLEX_VERTICAL.
467 */
468 wxDuplexMode GetDuplex() const;
469
470 /**
471 Returns the number of copies requested by the user.
472 */
473 int GetNoCopies() const;
474
475 /**
476 Gets the orientation. This can be wxLANDSCAPE or wxPORTRAIT.
477 */
478 int GetOrientation() const;
479
480 /**
481 Returns the paper size id. For more information, see SetPaperId().
482 */
483 wxPaperSize GetPaperId() const;
484
485 /**
486 Returns the printer name. If the printer name is the empty string, it indicates
487 that the default
488 printer should be used.
489 */
490 const wxString GetPrinterName() const;
491
492 /**
493 Returns the current print quality. This can be a positive integer, denoting the
494 number of dots per inch, or
495 one of the following identifiers:
496
497 On input you should pass one of these identifiers, but on return you may get
498 back a positive integer
499 indicating the current resolution setting.
500 */
501 wxPrintQuality GetQuality() const;
502
503 /**
504 Returns @true if the print data is valid for using in print dialogs.
505 This can return @false on Windows if the current printer is not set, for example.
506 On all other platforms, it returns @true.
507 */
508 bool IsOk() const;
509
510 /**
511 Sets the current bin. Possible values are:
512 */
513 void SetBin(wxPrintBin flag);
514
515 /**
516 Sets collation to on or off.
517 */
518 void SetCollate(bool flag);
519
520 /**
521 Sets colour printing on or off.
522 */
523 void SetColour(bool flag);
524
525 /**
526 Returns the duplex mode. One of wxDUPLEX_SIMPLEX, wxDUPLEX_HORIZONTAL,
527 wxDUPLEX_VERTICAL.
528 */
529 void SetDuplex(wxDuplexMode mode);
530
531 /**
532 Sets the default number of copies to be printed out.
533 */
534 void SetNoCopies(int n);
535
536 /**
537 Sets the orientation. This can be wxLANDSCAPE or wxPORTRAIT.
538 */
539 void SetOrientation(int orientation);
540
541 /**
542 Sets the paper id. This indicates the type of paper to be used. For a mapping
543 between
544 paper id, paper size and string name, see wxPrintPaperDatabase in @c paper.h
545 (not yet documented).
546 @a paperId can be one of:
547 */
548 void SetPaperId(wxPaperSize paperId);
549
550 /**
551 Sets the printer name. This can be the empty string to indicate that the default
552 printer should be used.
553 */
554 void SetPrinterName(const wxString& printerName);
555
556 /**
557 Sets the desired print quality. This can be a positive integer, denoting the
558 number of dots per inch, or
559 one of the following identifiers:
560
561 On input you should pass one of these identifiers, but on return you may get
562 back a positive integer
563 indicating the current resolution setting.
564 */
565 void SetQuality(wxPrintQuality quality);
566
567 //@{
568 /**
569 Assigns print setup data to this object. wxPrintSetupData is deprecated,
570 but retained for backward compatibility.
571 */
572 void operator =(const wxPrintData& data);
573 void operator =(const wxPrintSetupData& data);
574 //@}
575 };
576
577
578
579 /**
580 @class wxPrintDialogData
581 @wxheader{cmndata.h}
582
583 This class holds information related to the visual characteristics of
584 wxPrintDialog.
585 It contains a wxPrintData object with underlying printing settings.
586
587 @library{wxcore}
588 @category{printing}
589
590 @see @ref overview_printingoverview "Printing framework overview",
591 wxPrintDialog, @ref overview_wxprintdialogoverview "wxPrintDialog Overview"
592 */
593 class wxPrintDialogData : public wxObject
594 {
595 public:
596 //@{
597 /**
598 Construct an object from a print dialog data object.
599 */
600 wxPrintDialogData();
601 wxPrintDialogData(wxPrintDialogData& dialogData);
602 wxPrintDialogData(wxPrintData& printData);
603 //@}
604
605 /**
606 Destructor.
607 */
608 ~wxPrintDialogData();
609
610 /**
611 Enables or disables the 'Help' button.
612 */
613 void EnableHelp(bool flag);
614
615 /**
616 Enables or disables the 'Page numbers' controls.
617 */
618 void EnablePageNumbers(bool flag);
619
620 /**
621 Enables or disables the 'Print to file' checkbox.
622 */
623 void EnablePrintToFile(bool flag);
624
625 /**
626 Enables or disables the 'Selection' radio button.
627 */
628 void EnableSelection(bool flag);
629
630 /**
631 Returns @true if the user requested that all pages be printed.
632 */
633 bool GetAllPages() const;
634
635 /**
636 Returns @true if the user requested that the document(s) be collated.
637 */
638 bool GetCollate() const;
639
640 /**
641 Returns the @e from page number, as entered by the user.
642 */
643 int GetFromPage() const;
644
645 /**
646 Returns the @e maximum page number.
647 */
648 int GetMaxPage() const;
649
650 /**
651 Returns the @e minimum page number.
652 */
653 int GetMinPage() const;
654
655 /**
656 Returns the number of copies requested by the user.
657 */
658 int GetNoCopies() const;
659
660 /**
661 Returns a reference to the internal wxPrintData object.
662 */
663 wxPrintData GetPrintData();
664
665 /**
666 Returns @true if the user has selected printing to a file.
667 */
668 bool GetPrintToFile() const;
669
670 /**
671 Returns @true if the user requested that the selection be printed (where
672 'selection' is
673 a concept specific to the application).
674 */
675 bool GetSelection() const;
676
677 /**
678 Returns the @e to page number, as entered by the user.
679 */
680 int GetToPage() const;
681
682 /**
683 Returns @true if the print data is valid for using in print dialogs.
684 This can return @false on Windows if the current printer is not set, for example.
685 On all other platforms, it returns @true.
686 */
687 bool IsOk() const;
688
689 /**
690 Sets the 'Collate' checkbox to @true or @false.
691 */
692 void SetCollate(bool flag);
693
694 /**
695 Sets the @e from page number.
696 */
697 void SetFromPage(int page);
698
699 /**
700 Sets the @e maximum page number.
701 */
702 void SetMaxPage(int page);
703
704 /**
705 Sets the @e minimum page number.
706 */
707 void SetMinPage(int page);
708
709 /**
710 Sets the default number of copies the user has requested to be printed out.
711 */
712 void SetNoCopies(int n);
713
714 /**
715 Sets the internal wxPrintData.
716 */
717 void SetPrintData(const wxPrintData& printData);
718
719 /**
720 Sets the 'Print to file' checkbox to @true or @false.
721 */
722 void SetPrintToFile(bool flag);
723
724 /**
725 Selects the 'Selection' radio button. The effect of printing the selection
726 depends on how the application
727 implements this command, if at all.
728 */
729 void SetSelection(bool flag);
730
731 /**
732 Determines whether the dialog to be shown will be the Print dialog
733 (pass @false) or Print Setup dialog (pass @true).
734 This function has been deprecated since version 2.5.4.
735 */
736 void SetSetupDialog(bool flag);
737
738 /**
739 Sets the @e to page number.
740 */
741 void SetToPage(int page);
742
743 //@{
744 /**
745 Assigns another print dialog data object to this object.
746 */
747 void operator =(const wxPrintData& data);
748 void operator =(const wxPrintDialogData& data);
749 //@}
750 };
751