Changeset View
Changeset View
Standalone View
Standalone View
src/wrtembed/KReportZoomHandler.cpp
Show All 15 Lines | 1 | /* This file is part of the KDE project | |||
---|---|---|---|---|---|
16 | You should have received a copy of the GNU Library General Public License | 16 | You should have received a copy of the GNU Library General Public License | ||
17 | along with this library; see the file COPYING.LIB. If not, write to | 17 | along with this library; see the file COPYING.LIB. If not, write to | ||
18 | the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | 18 | the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | ||
19 | Boston, MA 02110-1301, USA. | 19 | Boston, MA 02110-1301, USA. | ||
20 | */ | 20 | */ | ||
21 | 21 | | |||
22 | #include "KReportZoomHandler.h" | 22 | #include "KReportZoomHandler.h" | ||
23 | #include "KReportUnit.h" // for POINT_TO_INCH | 23 | #include "KReportUnit.h" // for POINT_TO_INCH | ||
24 | #include "KReportDpi.h" | 24 | #include "KReportUtils_p.h" | ||
25 | 25 | | |||
26 | #include <QPointF> | 26 | #include <QPointF> | ||
27 | #include <QRectF> | 27 | #include <QRectF> | ||
28 | 28 | | |||
29 | KReportZoomHandler::KReportZoomHandler() | 29 | KReportZoomHandler::KReportZoomHandler() | ||
30 | : m_zoomMode(KReportZoomMode::ZOOM_CONSTANT) | 30 | : m_zoomMode(KReportZoomMode::ZOOM_CONSTANT) | ||
31 | , m_resolutionX(0) | 31 | , m_resolutionX(0) | ||
32 | , m_resolutionY(0) | 32 | , m_resolutionY(0) | ||
33 | , m_zoomedResolutionX(0) | 33 | , m_zoomedResolutionX(0) | ||
34 | , m_zoomedResolutionY(0) | 34 | , m_zoomedResolutionY(0) | ||
35 | , m_zoomLevel(1.0) | 35 | , m_zoomLevel(1.0) | ||
36 | { | 36 | { | ||
37 | setZoom(1.0); | 37 | setZoom(1.0); | ||
38 | setZoomMode( KReportZoomMode::ZOOM_CONSTANT ); | 38 | setZoomMode( KReportZoomMode::ZOOM_CONSTANT ); | ||
39 | setDpi(KReportDpi::dpiX(), KReportDpi::dpiY()); | 39 | setDpi(KReportPrivate::dpiX(), KReportPrivate::dpiY()); | ||
40 | } | 40 | } | ||
41 | 41 | | |||
42 | KReportZoomHandler::~KReportZoomHandler() | 42 | KReportZoomHandler::~KReportZoomHandler() | ||
43 | { | 43 | { | ||
44 | } | 44 | } | ||
45 | 45 | | |||
46 | void KReportZoomHandler::setResolutionToStandard() | 46 | void KReportZoomHandler::setResolutionToStandard() | ||
47 | { | 47 | { | ||
48 | setDpi(KReportDpi::dpiX(), KReportDpi::dpiY()); | 48 | setDpi(KReportPrivate::dpiX(), KReportPrivate::dpiY()); | ||
49 | } | 49 | } | ||
50 | 50 | | |||
51 | void KReportZoomHandler::setDpi(int dpiX, int dpiY) | 51 | void KReportZoomHandler::setDpi(int dpiX, int dpiY) | ||
52 | { | 52 | { | ||
53 | setResolution(POINT_TO_INCH(static_cast<qreal>(dpiX)), | 53 | setResolution(POINT_TO_INCH(static_cast<qreal>(dpiX)), | ||
54 | POINT_TO_INCH(static_cast<qreal>(dpiY))); | 54 | POINT_TO_INCH(static_cast<qreal>(dpiY))); | ||
55 | } | 55 | } | ||
56 | 56 | | |||
▲ Show 20 Lines • Show All 113 Lines • Show Last 20 Lines |