12 #include <QResizeEvent>
13 #include <QMouseEvent>
17 #include <kdecoration.h>
18 #include <kdecorationfactory.h>
19 #include <kcommondecoration.h>
27 class NextButton
: public Q3Button
30 NextButton(NextClient
*parent
=0, const char *name
=0,
31 const unsigned char *bitmap
=NULL
, int bw
=0, int bh
=0,
32 const QString
& tip
=NULL
, const int realizeBtns
= Qt::LeftButton
);
33 void setBitmap(const unsigned char *bitmap
, int bw
, int bh
);
35 Qt::ButtonState
lastButton() { return last_button
; }
38 void mousePressEvent( QMouseEvent
* e
);
39 void mouseReleaseEvent( QMouseEvent
* e
);
40 virtual void drawButton(QPainter
*p
);
41 void drawButtonLabel(QPainter
*){;}
43 KPixmap aBackground
, iBackground
;
46 ButtonState last_button
;
50 class NextClient
: public KDecoration
54 NextClient(KDecorationBridge
*b
, KDecorationFactory
*f
);
57 virtual bool drawbound(const QRect
& geom
, bool clear
);
59 bool eventFilter(QObject
*o
, QEvent
*e
);
60 void resizeEvent( QResizeEvent
* );
61 void paintEvent( QPaintEvent
* );
62 void showEvent( QShowEvent
* );
64 void mouseDoubleClickEvent( QMouseEvent
* );
70 QSize
minimumSize() const;
71 void resize(const QSize
&size
);
72 void borders(int &left
, int &right
, int &top
, int &bottom
) const;
73 void reset(unsigned long changed
);
74 void calcHiddenButtons();
75 void updateActiveBuffer();
77 Position
mousePosition(const QPoint
&) const;
78 void maximizeChange();
82 void menuButtonPressed();
83 void maximizeButtonClicked();
89 void keepAboveChange(bool above
);
90 void keepBelowChange(bool below
);
93 void initializeButtonsAndTitlebar(QBoxLayout
* titleLayout
);
94 void addButtons(QBoxLayout
* titleLayout
, const QString
& buttons
);
95 bool mustDrawHandle() const;
97 QSpacerItem
* titlebar
;
99 // Helpful constants for buttons in array
100 enum { CLOSE_IDX
= 0,
110 MAX_NUM_BUTTONS
= STICKY_IDX
+ 1 };
112 // WARNING: button[i] may be null for any given i. Make sure you
113 // always check for null before doing button[i]->foo().
114 NextButton
* button
[MAX_NUM_BUTTONS
];
117 class NextClientFactory
: public QObject
, public KDecorationFactory
121 virtual ~NextClientFactory();
122 virtual KDecoration
*createDecoration(KDecorationBridge
*);
123 virtual bool reset(unsigned long changed
);
124 virtual bool supports( Ability ability
);
126 virtual QList
< NextClientFactory::BorderSize
> borderSizes() const;