lib
KoPageFormat Namespace Reference
Functions | |
int | printerPageSize (KoFormat format) |
double | width (KoFormat format, KoOrientation orientation) |
double | height (KoFormat format, KoOrientation orientation) |
KoFormat | guessFormat (double width, double height) |
QString | formatString (KoFormat format) |
KoFormat | formatFromString (const QString &string) |
KoFormat | defaultFormat () |
QString | name (KoFormat format) |
QStringList | allFormats () |
Function Documentation
KOFFICECORE_EXPORT int KoPageFormat::printerPageSize | ( | KoFormat | format | ) |
Convert a KoFormat into a KPrinter::PageSize.
If format is 'screen' it will use A4 landscape. If format is 'custom' it will use A4 portrait. (you may want to take care of those cases separately). Usually passed to KPrinter::setPageSize().
- Note:
- We return int instead of the enum to avoid including kprinter.h
Definition at line 148 of file KoPageLayout.cpp.
KOFFICECORE_EXPORT double KoPageFormat::width | ( | KoFormat | format, | |
KoOrientation | orientation | |||
) |
Returns the width (in mm) for a given page format and orientation 'Custom' isn't supported by this function, obviously.
Definition at line 166 of file KoPageLayout.cpp.
KOFFICECORE_EXPORT double KoPageFormat::height | ( | KoFormat | format, | |
KoOrientation | orientation | |||
) |
Returns the height (in mm) for a given page format and orientation 'Custom' isn't supported by this function, obviously.
Definition at line 175 of file KoPageLayout.cpp.
KOFFICECORE_EXPORT KoFormat KoPageFormat::guessFormat | ( | double | width, | |
double | height | |||
) |
Try to find the paper format for the given width and height (in mm).
Useful to some import filters.
Definition at line 184 of file KoPageLayout.cpp.
KOFFICECORE_EXPORT QString KoPageFormat::formatString | ( | KoFormat | format | ) |
Returns the internal name of the given page format.
Use for saving.
Definition at line 198 of file KoPageLayout.cpp.
KOFFICECORE_EXPORT KoFormat KoPageFormat::formatFromString | ( | const QString & | string | ) |
Convert a format string (internal name) to a page format value.
Use for loading.
Definition at line 205 of file KoPageLayout.cpp.
KOFFICECORE_EXPORT KoFormat KoPageFormat::defaultFormat | ( | ) |
Returns the default format (based on the KControl settings).
Definition at line 216 of file KoPageLayout.cpp.
KOFFICECORE_EXPORT QString KoPageFormat::name | ( | KoFormat | format | ) |
Returns the translated name of the given page format.
Use for showing the user.
Definition at line 227 of file KoPageLayout.cpp.
KOFFICECORE_EXPORT QStringList KoPageFormat::allFormats | ( | ) |
Lists the translated names of all the available formats.
Definition at line 234 of file KoPageLayout.cpp.