//
//     Copyright 2008 Jim Bublitz <jbublitz@nwinternet.com>
//     Earlier copyrights 1998 - 2007 Jim Bublitz also apply

//                 Generated by twine

// This file is part of PyKDE4.

// PyKDE4 is free software; you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as
// published by the Free Software Foundation; either version 2.1 of
// the License, or (at your option) any later version.

// PyKDE4 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 General Public License for more details.

// You should have received a copy of the GNU General Public License
// along with this program.  If not, see <http://www.gnu.org/licenses/>.



class KStyle : QStyle
{
%TypeHeaderCode
#include <kstyle.h>
%End


public:
                            KStyle ();
    static QString          defaultStyle ();
    static QStyle::StyleHint  customStyleHint (const QString& element, const QWidget* widget);
    static QStyle::ControlElement  customControlElement (const QString& element, const QWidget* widget);
    static QStyle::SubElement  customSubElement (const QString& element, const QWidget* widget);

protected:
    QStyle::StyleHint       newStyleHint (const QString& element);
    QStyle::ControlElement  newControlElement (const QString& element);
    QStyle::SubElement      newSubElement (const QString& element);
    void                    drawInsideRect (QPainter* p, const QRect& r) const;
    QRect                   centerRect (const QRect& in, int w, int h) const;
    QRect                   centerRect (const QRect& in, const QSize& size) const;

    enum WidgetType
    {
        WT_Generic,
        WT_PushButton,
        WT_Splitter,
        WT_CheckBox,
        WT_RadioButton,
        WT_DockWidget,
        WT_ProgressBar,
        WT_MenuBar,
        WT_MenuBarItem,
        WT_Menu,
        WT_MenuItem,
        WT_ScrollBar,
        WT_TabBar,
        WT_TabWidget,
        WT_Slider,
        WT_Tree,
        WT_SpinBox,
        WT_ComboBox,
        WT_Header,
        WT_LineEdit,
        WT_GroupBox,
        WT_StatusBar,
        WT_ToolBar,
        WT_ToolButton,
        WT_ToolBoxTab,
        WT_Window,
        WT_Limit
    };


    enum MarginOffsets
    {
        MainMargin,
        Top,
        Bot,
        Left,
        Right,
        MarginInc
    };

    void                    setWidgetLayoutProp (KStyle::WidgetType widget, int metric, int value);
    virtual int             widgetLayoutProp (KStyle::WidgetType widgetType, int metric, const QStyleOption* opt = 0, const QWidget* w = 0) const;
//ig     virtual void       drawKStylePrimitive (KStyle::WidgetType widgetType, int primitive, const QStyleOption* opt, const QRect& r, const QPalette& pal, QStyle::State flags, QPainter* p, const QWidget* widget = 0, Option* kOpt = 0) const;

public:
    void                    drawControl (QStyle::ControlElement elem, const QStyleOption* opt, QPainter* p, const QWidget* w) const;
    void                    drawPrimitive (QStyle::PrimitiveElement elem, const QStyleOption* opt, QPainter* p, const QWidget* w) const;
    int                     pixelMetric (QStyle::PixelMetric metric, const QStyleOption* opt = 0, const QWidget* w = 0) const;
    QRect                   subElementRect (QStyle::SubElement subRect, const QStyleOption* opt, const QWidget* w) const;
    QSize                   sizeFromContents (QStyle::ContentsType type, const QStyleOption* opt, const QSize& contentsSize, const QWidget* w) const;
    int                     styleHint (QStyle::StyleHint hint, const QStyleOption* opt, const QWidget* w, QStyleHintReturn* returnData) const;
    QRect                   subControlRect (QStyle::ComplexControl control, const QStyleOptionComplex* opt, QStyle::SubControl subControl, const QWidget* w) const;
    QStyle::SubControl      hitTestComplexControl (QStyle::ComplexControl cc, const QStyleOptionComplex* opt, const QPoint& pt, const QWidget* w) const;
    void                    drawComplexControl (QStyle::ComplexControl cc, const QStyleOptionComplex* opt, QPainter* p, const QWidget* w) const;
    void                    polish (QWidget*);
    void                    unpolish (QWidget*);
    void                    polish (QApplication*);
    void                    unpolish (QApplication*);
    void                    polish (QPalette&);
    QRect                   itemTextRect (const QFontMetrics& fm, const QRect& r, int flags, bool enabled, const QString& text) const;
    QRect                   itemPixmapRect (const QRect& r, int flags, const QPixmap& pixmap) const;
    void                    drawItemText (QPainter* painter, const QRect& rect, int flags, const QPalette& pal, bool enabled, const QString& text, QPalette::ColorRole textRole = QPalette::NoRole) const;
    void                    drawItemPixmap (QPainter* painter, const QRect& rect, int alignment, const QPixmap& pixmap) const;
    QPalette                standardPalette () const;
    QPixmap                 standardPixmap (QStyle::StandardPixmap standardPixmap, const QStyleOption* opt, const QWidget* widget = 0) const;
    QPixmap                 generatedIconPixmap (QIcon::Mode iconMode, const QPixmap& pixmap, const QStyleOption* opt) const;
    bool                    eventFilter (QObject*, QEvent*);

protected:
    int                     layoutSpacingImplementation (QSizePolicy::ControlType control1, QSizePolicy::ControlType control2, Qt::Orientation orientation, const QStyleOption* option, const QWidget* widget) const;
    QIcon                   standardIconImplementation (QStyle::StandardPixmap standardIcon, const QStyleOption* option = 0, const QWidget* widget = 0) const;
};   // KStyle


//ig class KStyleFactory;


