/* * Copyright 2007 Matthew Woehlke * Copyright 2007 Casper Boemann * Copyright 2007 Fredrik Höglund * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License version 2 as published by the Free Software Foundation. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public License * along with this library; see the file COPYING.LIB. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #ifndef __OXYGEN_HELPER_H #define __OXYGEN_HELPER_H #include #include #include #include #include // alphaBlendColors Copyright 2003 Sandro Giessl // DEPRECATED QColor alphaBlendColors(const QColor &backgroundColor, const QColor &foregroundColor, const int alpha); // WARNING - OxygenHelper must be a K_GLOBAL_STATIC! class OxygenHelper { public: explicit OxygenHelper(const QByteArray &componentName); virtual ~OxygenHelper() {} KSharedConfigPtr config() const; static bool lowThreshold(const QColor &color); QColor backgroundRadialColor(const QColor &color) const; QColor backgroundTopColor(const QColor &color) const; QColor backgroundBottomColor(const QColor &color) const; QColor calcLightColor(const QColor &color); QColor calcDarkColor(const QColor &color); QPixmap verticalGradient(const QColor &color, int height); QPixmap radialGradient(const QColor &color, int width); QPixmap roundButton(const QColor &color, int size); protected: KComponentData _componentData; KSharedConfigPtr _config; qreal _contrast; QCache m_backgroundCache; QCache m_roundCache; }; #endif // __OXYGEN_HELPER_H