ScummVM API documentation
printing-dialog.h
1 /* ScummVM - Graphic Adventure Engine
2  *
3  * ScummVM is the legal property of its developers, whose names
4  * are too numerous to list here. Please refer to the COPYRIGHT
5  * file distributed with this source distribution.
6  *
7  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <http://www.gnu.org/licenses/>.
19  *
20  */
21 
22 #ifndef GUI_PRINTING_DIALOGS_H
23 #define GUI_PRINTING_DIALOGS_H
24 
25 #include "gui/dialog.h"
26 
27 namespace GUI {
28 class ButtonWidget;
29 class CheckboxWidget;
30 class PopUpWidget;
31 class GraphicsWidget;
32 
33 class PrintingDialog : public Dialog {
34 public:
35  enum {
36  kCmdPrint = 'PRNT',
37  kCmdSelectPrinterName = 'SLPN',
38  kCmdSelectOrientation = 'SLOR',
39  kCmdSaveAsImage = 'SVIM',
40  kCmdFitToPage = 'FITP',
41  kCmdCenter = 'CNTR',
42  };
43 
44  PrintingDialog(const Graphics::ManagedSurface &surface, bool defaultFitToPage, bool defaultCenter, PageOrientation defaultOrientation);
45 
46  void handleCommand(CommandSender *sender, uint32 cmd, uint32 data) override;
47 
48 private:
49  void updatePreview();
50  static Common::Rect computePlacementInContainer(int16 srcW, int16 srcH, int16 containerW, int16 containerH, bool fitToContainer, bool center);
51 
52  const Graphics::ManagedSurface &_surface;
53 
54  bool _initDone;
55  GraphicsWidget *_preview;
56  ButtonWidget *_printButton;
57  CheckboxWidget *_saveAsImageCheckbox;
58  CheckboxWidget *_fitToPageCheckbox;
59  CheckboxWidget *_centerCheckbox;
60  PopUpWidget *_printersListPopUp;
61 
62  PopUpWidget *_orientationPopUp;
63 
65 };
66 
67 } // End of namespace GUI
68 
69 #endif
Definition: managed_surface.h:51
Definition: widget.h:445
Definition: rect.h:524
Definition: widget.h:330
Definition: printman.h:30
Definition: dialog.h:49
Definition: printing-dialog.h:33
Definition: widget.h:234
Definition: popup.h:39
Definition: object.h:40