summaryrefslogtreecommitdiffstats
path: root/kstyles/klegacy/klegacystyle.h
blob: 18c073f9adeea2436295e26530600dfa152ba152 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
/*

  Copyright (c) 2000 KDE Project

  Permission is hereby granted, free of charge, to any person obtaining a
  copy of this software and associated documentation files (the "Software"),
  to deal in the Software without restriction, including without limitation
  the rights to use, copy, modify, merge, publish, distribute, sublicense,
  and/or sell copies of the Software, and to permit persons to whom the
  Software is furnished to do so, subject to the following conditions:

  The above copyright notice and this permission notice shall be included in
  all copies or substantial portions of the Software.

  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
  THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
  DEALINGS IN THE SOFTWARE.

 */

#ifndef   __KLegacyStyle_hh
#define   __KLegacyStyle_hh

#include <kstyle.h>

// forward declaration
class KLegacyStylePrivate;


class Q_EXPORT KLegacyStyle : public KStyle {
    Q_OBJECT
public:
    KLegacyStyle(void);
    virtual ~KLegacyStyle(void);

    virtual int defaultFrameWidth() const;

    virtual void polish(TQApplication *);
    virtual void polish(TQWidget *);
    virtual void polishPopupMenu(TQPopupMenu *);
    virtual void unPolish(TQWidget *);
    virtual void unPolish(TQApplication *);

    // combo box
    virtual void drawComboButton(TQPainter *, int, int, int, int, const TQColorGroup &,
				 bool = false, bool = false, bool = true,
				 const TQBrush * = 0);
    virtual TQRect comboButtonRect(int, int, int, int);
    virtual TQRect comboButtonFocusRect(int, int, int, int);

    // menubar items
    virtual void drawMenuBarItem(TQPainter *, int, int, int, int, TQMenuItem *,
				 TQColorGroup &, bool, bool);
    virtual void drawKMenuItem(TQPainter *, int, int, int, int, const TQColorGroup &, bool,
                               TQMenuItem *, TQBrush * = 0);
    
    // toolbar stuffs
    virtual void drawKBarHandle(TQPainter *p, int x, int y, int w, int h,
                                const TQColorGroup &g, KToolBarPos type, TQBrush *fill = 0);
    virtual void drawKickerHandle(TQPainter *p, int x, int y, int w, int h,
                                  const TQColorGroup &g, TQBrush *fill = 0);
    virtual void drawKickerAppletHandle(TQPainter *p, int x, int y, int w, int h,
                                        const TQColorGroup &g, TQBrush *fill = 0);
    virtual void drawKickerTaskButton(TQPainter *p, int x, int y, int w, int h,
                                      const TQColorGroup &g, const TQString &title, bool active,
                                      TQPixmap *icon = 0, TQBrush *fill = 0);

    // arrows
    virtual void drawArrow(TQPainter *, ArrowType, bool, int, int, int, int,
			   const TQColorGroup &, bool, const TQBrush * = 0);

    // button stuffs
    virtual void drawButton(TQPainter *, int, int, int, int, const TQColorGroup &g,
    			    bool = false, const TQBrush * = 0);
    virtual void drawPushButton(TQPushButton *, TQPainter *);
    virtual void drawBevelButton(TQPainter *, int, int, int, int,
				 const TQColorGroup &, bool = false,
				 const TQBrush * = 0);

    // indicators (TQCheckBox)
    virtual void drawCheckMark(TQPainter *, int, int, int, int, const TQColorGroup &,
			       bool = false, bool = true);
    virtual void drawIndicator(TQPainter *, int, int, int, int, const TQColorGroup &,
			       int, bool = false, bool = true);
    virtual void drawIndicatorMask(TQPainter *, int, int, int, int, int);
    virtual TQSize indicatorSize(void) const;

    // exclusive indicators (TQRadioButton)
    virtual void drawExclusiveIndicator(TQPainter *, int, int, int, int,
					const TQColorGroup &, bool, bool = false,
					bool = true);
    virtual void drawExclusiveIndicatorMask(TQPainter *, int, int, int, int, bool);
    virtual TQSize exclusiveIndicatorSize(void) const;

    // popup menus
    virtual void drawPopupPanel(TQPainter *, int, int, int, int, const TQColorGroup &,
				int = 2, const TQBrush * = 0);
    virtual void drawPopupMenuItem(TQPainter *, bool, int, int, TQMenuItem *,
				   const TQPalette &, bool, bool, int, int, int, int);


    // scrollbars
    virtual ScrollControl scrollBarPointOver(const TQScrollBar *, int, const TQPoint &);
    virtual void scrollBarMetrics(const TQScrollBar *, int &, int &, int &, int &);
    virtual void drawScrollBarControls(TQPainter *, const TQScrollBar *,
				       int, uint, uint);

    // sliders
    virtual void drawSlider(TQPainter *, int , int , int , int ,
			    const TQColorGroup &, Orientation, bool, bool);
    virtual void drawSliderGroove(TQPainter *, int, int, int, int, const TQColorGroup &,
				  QCOORD, Orientation);

    // panel
    virtual void drawPanel(TQPainter *, int, int, int, int, const TQColorGroup &,
			   bool = false, int = 1, const TQBrush * = 0);

    // splitters
    virtual void drawSplitter(TQPainter *, int, int, int, int,
			      const TQColorGroup &, Orientation);

    // tabs
    virtual void drawTab(TQPainter *, const TQTabBar *, TQTab *, bool);


protected:
    bool eventFilter(TQObject *, TQEvent *);

    void drawMenuArrow(TQPainter *, ArrowType, bool, int, int, int, int,
		       const TQColorGroup &, bool, const TQBrush * = 0);


private:
    KLegacyStylePrivate *priv;

#if defined(TQ_DISABLE_COPY)
    KLegacyStyle( const KLegacyStyle & );
    KLegacyStyle& operator=( const KLegacyStyle & );
#endif

};


#endif // __KLegacyStyle_hh