| 1 |
/* This file is part of the KDE project |
| 2 |
SPDX-FileCopyrightText: 1998, 1999 Torben Weis <[email protected]> |
| 3 |
SPDX-FileCopyrightText: 2002, 2003 David Faure <[email protected]> |
| 4 |
SPDX-FileCopyrightText: 2003 Nicolas GOUTTE <[email protected]> |
| 5 |
|
| 6 |
SPDX-License-Identifier: LGPL-2.0-or-later |
| 7 |
*/ |
| 8 |
|
| 9 |
#ifndef KO_DPI_h |
| 10 |
#define KO_DPI_h |
| 11 |
|
| 12 |
#include <QStringList> |
| 13 |
#include <QFont> |
| 14 |
#include <QMap> |
| 15 |
|
| 16 |
#include "kowidgets_export.h" |
| 17 |
|
| 18 |
/** |
| 19 |
* Singleton to store user-overwritten DPI information. |
| 20 |
*/ |
| 21 |
class KOWIDGETS_EXPORT KoDpi |
| 22 |
{ |
| 23 |
public: |
| 24 |
KoDpi(); |
| 25 |
/// For KoApplication |
| 26 |
static void initialize() { |
| 27 |
(void)self(); // I don't want to make KoDpi instances public, so self() is private |
| 28 |
} |
| 29 |
|
| 30 |
static int dpiX() { |
| 31 |
return self()->m_dpiX; |
| 32 |
} |
| 33 |
|
| 34 |
static int dpiY() { |
| 35 |
return self()->m_dpiY; |
| 36 |
} |
| 37 |
|
| 38 |
/// @internal, for KoApplication |
| 39 |
static void setDPI(int x, int y); |
| 40 |
|
| 41 |
~KoDpi(); |
| 42 |
|
| 43 |
private: |
| 44 |
static KoDpi* self(); |
| 45 |
|
| 46 |
|
| 47 |
int m_dpiX; |
| 48 |
int m_dpiY; |
| 49 |
}; |
| 50 |
|
| 51 |
#endif // KO_DPI |