Okular

utils.h
1 /*
2  SPDX-FileCopyrightText: 2006 Luigi Toscano <[email protected]>
3 
4  SPDX-License-Identifier: GPL-2.0-or-later
5 */
6 
7 #ifndef _OKULAR_UTILS_H_
8 #define _OKULAR_UTILS_H_
9 
10 #include "area.h"
11 #include "okularcore_export.h"
12 
13 class QRect;
14 class QImage;
15 class QWidget;
16 
17 namespace Okular
18 {
19 /**
20  * @short General utility functions.
21  *
22  * This class contains some static functions of general utility.
23  */
24 class OKULARCORE_EXPORT Utils
25 {
26 public:
27  /**
28  * Rotate the rect \p source in the area \p width x \p height with the
29  * specified \p orientation .
30  */
31  static QRect rotateRect(const QRect &source, int width, int height, int orientation); // TODO remove the & when we do a BIC change elsewhere
32 
33  /**
34  * Return the real DPI of the display containing given widget
35  *
36  * On X11, it can indicate the real horizontal DPI value without any Xrdb
37  * setting. Otherwise, returns the same as realDpiX/Y(),
38  *
39  * @since 0.19 (KDE 4.13)
40  */
41  static QSizeF realDpi(QWidget *widgetOnScreen);
42 
43  /**
44  * Compute the smallest rectangle that contains all non-white pixels in image),
45  * in normalized [0,1] coordinates.
46  *
47  * @since 0.7 (KDE 4.1)
48  */
49  static NormalizedRect imageBoundingBox(const QImage *image);
50 };
51 
52 }
53 
54 #endif
55 
56 /* kate: replace-tabs on; indent-width 4; */
A NormalizedRect is a rectangle which can be defined by two NormalizedPoints.
Definition: area.h:189
global.h
Definition: action.h:16
General utility functions.
Definition: utils.h:24
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Mon Nov 29 2021 22:32:20 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.