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
27namespace GUI {
28class ButtonWidget;
29class CheckboxWidget;
30class PopUpWidget;
31class GraphicsWidget;
32
33class PrintingDialog : public Dialog {
34public:
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 void reflowLayout() override;
48
49private:
50 void updatePreview();
51 static Common::Rect computePlacementInContainer(int16 srcW, int16 srcH, int16 containerW, int16 containerH, bool fitToContainer, bool center);
52
53 const Graphics::ManagedSurface &_surface;
54
55 bool _initDone;
56 GraphicsWidget *_preview;
57 ButtonWidget *_printButton;
58 CheckboxWidget *_saveAsImageCheckbox;
59 CheckboxWidget *_fitToPageCheckbox;
60 CheckboxWidget *_centerCheckbox;
61 PopUpWidget *_printersListPopUp;
62
63 PopUpWidget *_orientationPopUp;
64
66};
67
68} // End of namespace GUI
69
70#endif
Definition: widget.h:241
Definition: widget.h:338
Definition: object.h:40
Definition: dialog.h:49
Definition: widget.h:453
Definition: popup.h:39
Definition: printing-dialog.h:33
Definition: managed_surface.h:51
Definition: rect.h:536