lib
KoTextZoomHandler Class Reference
#include <KoTextZoomHandler.h>

Detailed Description
This class extends KoZoomHandler to add support for WYSIWYG text layouting.Definition at line 28 of file KoTextZoomHandler.h.
Public Member Functions | |
int | pixelToLayoutUnitX (int x) const |
int | pixelToLayoutUnitY (int y) const |
QPoint | pixelToLayoutUnit (const QPoint &p) const |
QRect | pixelToLayoutUnit (const QRect &r) const |
int | layoutUnitToPixelX (int lupix) const |
int | layoutUnitToPixelY (int lupix) const |
int | layoutUnitToPixelX (int x, int w) const |
int | layoutUnitToPixelY (int y, int h) const |
QPoint | layoutUnitToPixel (const QPoint &p) const |
QRect | layoutUnitToPixel (const QRect &r) const |
int | ptToPixelX (double pt) const |
int | ptToPixelY (double pt) const |
QPoint | ptToPixel (const KoPoint &p) const |
double | pixelXToPt (int x) const |
double | pixelYToPt (int y) const |
KoPoint | pixelToPt (const QPoint &p) const |
int | ptToLayoutUnitPixX (double x_pt) const |
int | ptToLayoutUnitPixY (double y_pt) const |
QPoint | ptToLayoutUnitPix (const KoPoint &p) const |
double | layoutUnitToFontSize (int luSize, bool) const |
Static Public Member Functions | |
static void | setPtToLayoutUnitFactor (int factor) |
static double | ptToLayoutUnitPt (double pt) |
static int | ptToLayoutUnitPt (int ptSize) |
static KoPoint | ptToLayoutUnitPt (const KoPoint &p) |
static KoRect | ptToLayoutUnitPt (const KoRect &r) |
static double | layoutUnitPtToPt (double lupt) |
static KoPoint | layoutUnitPtToPt (const KoPoint &p) |
Static Protected Attributes | |
static int | m_layoutUnitFactor = 20 |
Member Function Documentation
int KoTextZoomHandler::pixelToLayoutUnitX | ( | int | x | ) | const |
The "[zoomed] view pixel" -> "layout unit pixel" conversions.
Definition at line 78 of file KoTextZoomHandler.cpp.
int KoTextZoomHandler::layoutUnitToPixelX | ( | int | lupix | ) | const |
The "layout unit pixel" -> "[zoomed] view pixel" conversions.
Definition at line 65 of file KoTextZoomHandler.cpp.
int KoTextZoomHandler::layoutUnitToPixelX | ( | int | x, | |
int | w | |||
) | const |
This variant converts a width, using a reference X position.
This prevents rounding problems.
Definition at line 49 of file KoTextZoomHandler.cpp.
int KoTextZoomHandler::layoutUnitToPixelY | ( | int | y, | |
int | h | |||
) | const |
This variant converts a height, using a reference Y position.
This prevents rounding problems.
Definition at line 57 of file KoTextZoomHandler.cpp.
int KoTextZoomHandler::ptToPixelX | ( | double | pt | ) | const [inline] |
Basic pt to pixel and pixel to pt conversions, valid at any zoom level, as well as at the Layout Unit level (and mostly useful for Layout Units).
Don't confuse with zoomIt, which also converts pt to pixels, but applying the zoom!
Definition at line 67 of file KoTextZoomHandler.h.
int KoTextZoomHandler::ptToLayoutUnitPixX | ( | double | x_pt | ) | const [inline] |
The "document pt" -> "Layout Unit pixels" conversions, for convenience.
Definition at line 83 of file KoTextZoomHandler.h.
double KoTextZoomHandler::layoutUnitToFontSize | ( | int | luSize, | |
bool | ||||
) | const |
Given the font size for the font in layout units, in pt (use pointSize()) this returns the font size to use on screen the current zoom, in pt (use setPointSizeFloat()),.
Definition at line 39 of file KoTextZoomHandler.cpp.
static void KoTextZoomHandler::setPtToLayoutUnitFactor | ( | int | factor | ) | [inline, static] |
Change the factor that converts between pointsizes and layout units (by default 20 - for 1440 DPI at 72 DPI).
Definition at line 108 of file KoTextZoomHandler.h.
static double KoTextZoomHandler::ptToLayoutUnitPt | ( | double | pt | ) | [inline, static] |
Not zoom dependent.
Simply convert a pt value (e.g. a frame) to high-resolution layout unit coordinates (in pt).
Definition at line 112 of file KoTextZoomHandler.h.
static int KoTextZoomHandler::ptToLayoutUnitPt | ( | int | ptSize | ) | [inline, static] |
Same thing for integer values, e.g.
a font size in pt
Definition at line 115 of file KoTextZoomHandler.h.
Member Data Documentation
int KoTextZoomHandler::m_layoutUnitFactor = 20 [static, protected] |
This being static ensures that the same value is used by all KoTextZoomHandler instances.
Definition at line 133 of file KoTextZoomHandler.h.
The documentation for this class was generated from the following files: