2006-06-30 21:42:41 +00:00
|
|
|
/***************************************************************************
|
|
|
|
* Copyright (C) 2006 by Luigi Toscano <luigi.toscano@tiscali.it> *
|
|
|
|
* *
|
|
|
|
* This program is free software; you can redistribute it and/or modify *
|
|
|
|
* it under the terms of the GNU General Public License as published by *
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or *
|
|
|
|
* (at your option) any later version. *
|
|
|
|
***************************************************************************/
|
|
|
|
|
|
|
|
#ifndef _OKULAR_UTILS_H_
|
|
|
|
#define _OKULAR_UTILS_H_
|
|
|
|
|
2014-10-27 21:35:06 +00:00
|
|
|
#include "okularcore_export.h"
|
2011-06-01 08:31:44 +00:00
|
|
|
#include "area.h"
|
2006-06-30 21:42:41 +00:00
|
|
|
|
2006-10-29 15:21:03 +00:00
|
|
|
class QRect;
|
2008-05-18 23:03:17 +00:00
|
|
|
class QImage;
|
2014-01-13 00:15:55 +00:00
|
|
|
class QWidget;
|
2006-06-30 21:42:41 +00:00
|
|
|
|
2006-09-21 08:45:36 +00:00
|
|
|
namespace Okular
|
2006-06-30 21:42:41 +00:00
|
|
|
{
|
2006-09-21 08:45:36 +00:00
|
|
|
|
2006-10-29 15:21:03 +00:00
|
|
|
/**
|
|
|
|
* @short General utility functions.
|
|
|
|
*
|
|
|
|
* This class contains some static functions of general utility.
|
|
|
|
*/
|
2014-10-27 21:35:06 +00:00
|
|
|
class OKULARCORE_EXPORT Utils
|
2006-09-21 08:45:36 +00:00
|
|
|
{
|
|
|
|
public:
|
2006-06-30 21:42:41 +00:00
|
|
|
/**
|
|
|
|
* Rotate the rect \p source in the area \p width x \p height with the
|
|
|
|
* specified \p orientation .
|
|
|
|
*/
|
2006-09-21 08:45:36 +00:00
|
|
|
static QRect rotateRect( const QRect & source, int width, int height, int orientation );
|
2006-10-29 15:08:18 +00:00
|
|
|
|
2014-01-13 00:15:55 +00:00
|
|
|
/**
|
|
|
|
* Return the real DPI of the display containing given widget
|
|
|
|
*
|
|
|
|
* On X11, it can indicate the real horizontal DPI value without any Xrdb
|
|
|
|
* setting. Otherwise, returns the same as realDpiX/Y(),
|
|
|
|
*
|
|
|
|
* @since 0.19 (KDE 4.13)
|
|
|
|
*/
|
|
|
|
static QSizeF realDpi(QWidget* widgetOnScreen);
|
|
|
|
|
2008-05-18 23:03:17 +00:00
|
|
|
/**
|
|
|
|
* Compute the smallest rectangle that contains all non-white pixels in image),
|
|
|
|
* in normalized [0,1] coordinates.
|
|
|
|
*
|
|
|
|
* @since 0.7 (KDE 4.1)
|
|
|
|
*/
|
|
|
|
static NormalizedRect imageBoundingBox( const QImage* image );
|
2006-09-21 08:45:36 +00:00
|
|
|
};
|
2006-06-30 21:42:41 +00:00
|
|
|
|
2006-09-21 08:45:36 +00:00
|
|
|
}
|
2006-06-30 21:42:41 +00:00
|
|
|
|
|
|
|
#endif
|
2014-01-13 00:15:55 +00:00
|
|
|
|
|
|
|
/* kate: replace-tabs on; indent-width 4; */
|