25 #ifndef KCOMMONDECORATION_H
26 #define KCOMMONDECORATION_H
29 #include <tqvaluevector.h>
31 #include "kdecoration.h"
33 class KDecorationBridge;
34 class KDecorationFactory;
51 class KCommonDecorationButtonPrivate;
52 class KCommonDecorationPrivate;
115 LM_ExplicitButtonSpacer,
117 LM_RightButtonsMarginTop
138 virtual TQString visibleName()
const = 0;
144 virtual TQString defaultButtonsLeft()
const = 0;
150 virtual TQString defaultButtonsRight()
const = 0;
156 virtual bool decorationBehaviour(DecorationBehaviour behaviour)
const;
165 virtual int layoutMetric(LayoutMetric lm,
bool respectWindowState =
true,
const KCommonDecorationButton *button = 0)
const;
176 virtual TQRegion cornerShape(WindowCorner corner);
185 virtual void updateWindowShape();
190 virtual void paintEvent(TQPaintEvent *e) = 0;
196 virtual void updateCaption();
198 int buttonsLeftWidth()
const;
199 int buttonsRightWidth()
const;
204 void updateLayout()
const;
208 void updateButtons()
const;
212 void resetButtons()
const;
218 bool isToolWindow()
const;
223 TQRect titleRect()
const;
233 virtual void reset(
unsigned long changed );
234 virtual void borders(
int& left,
int& right,
int& top,
int& bottom )
const;
236 virtual void resize(
const TQSize& s);
245 void keepAboveChange(
bool above);
246 void keepBelowChange(
bool below);
249 void slotKeepAbove();
250 void slotKeepBelow();
251 void menuButtonPressed();
252 void menuButtonReleased();
256 virtual bool eventFilter( TQObject* o, TQEvent* e );
257 virtual void resizeEvent(TQResizeEvent *e);
258 virtual void mouseDoubleClickEvent(TQMouseEvent *e);
259 virtual void wheelEvent(TQWheelEvent *e);
264 void moveWidget(
int x,
int y, TQWidget *widget)
const;
265 void resizeWidget(
int w,
int h, TQWidget *widget)
const;
267 typedef TQValueVector <KCommonDecorationButton*> ButtonContainer;
268 int buttonContainerWidth(
const ButtonContainer &btnContainer,
bool countHidden =
false)
const;
269 bool isModalSystemNotification();
270 void addButtons(ButtonContainer &btnContainer,
const TQString& buttons,
bool isLeft);
274 ButtonContainer m_buttonsLeft;
275 ButtonContainer m_buttonsRight;
277 TQWidget *m_previewWidget;
280 void calcHiddenButtons();
282 int btnHideLastWidth;
286 KCommonDecorationPrivate *d;
308 ManualReset = 1 << 0,
310 ToggleChange = 1 << 2,
311 StateChange = 1 << 3,
313 DecorationReset = 1 << 5
318 virtual void reset(
unsigned long changed) = 0;
327 ButtonType type()
const;
337 void setRealizeButtons(
int btns);
341 void setSize(
const TQSize &s);
345 void setTipText(
const TQString &tip);
351 TQSize sizeHint()
const;
354 void setToggleButton(
bool toggle);
356 void setLeft(
bool left);
357 void mousePressEvent(TQMouseEvent *e);
358 void mouseReleaseEvent(TQMouseEvent *e);
363 int m_realizeButtons;
365 ButtonState m_lastMouse;
369 KCommonDecorationButtonPrivate *d;
372 #endif // KCOMMONDECORATION_H