ScummVM API documentation
printman.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 COMMON_PRINTMAN_H
23#define COMMON_PRINTMAN_H
24
25#include "common/scummsys.h"
26#include "common/str.h"
27#include "common/str-array.h"
28#include "graphics/managed_surface.h"
29
30namespace GUI {
31class PrintingDialog;
32}
33
34enum PageOrientation {
35 kPageOrientationPortrait,
36 kPageOrientationLandscape,
37};
38
39namespace Common {
40
42public:
43 friend class GUI::PrintingDialog;
44
45 virtual ~PrintingManager();
46
48 _orientation = kPageOrientationLandscape;
49 _jobName = "ScummVM";
50 }
51
52 void saveAsImage(const Graphics::ManagedSurface &surf, const Common::String &fileName = "");
53
54 void setJobName(const Common::String &jobName) { _jobName = jobName; }
55
56 virtual Common::Rect getPrintableArea() const;
57 virtual Common::Point getPrintableAreaOffset() const;
58 virtual Common::Rect getPaperDimensions() const;
59
60protected:
61 virtual void doPrint(const Graphics::ManagedSurface &surf, const Common::Rect &destRect);
62
63 virtual Common::StringArray listPrinterNames() const;
64
65 virtual Common::String getDefaultPrinterName() const;
66
67 void setPrinterName(const Common::String &printerName) { _printerName = printerName; }
68
69 PageOrientation _orientation;
70
71 Common::String _jobName;
72 Common::String _printerName;
73};
74} // End of namespace Common
75
76#endif
Definition: printman.h:41
Definition: str.h:59
Definition: printing-dialog.h:33
Definition: managed_surface.h:51
Definition: algorithm.h:29
Definition: rect.h:144
Definition: rect.h:536