This class eases development of decorations by implementing parts of
KDecoration which are error prone and common for most decorations.
More...
#include <kcommondecoration.h>
List of all members.
|
Public Types |
enum | DecorationBehaviour { DB_MenuClose,
DB_WindowMask,
DB_ButtonHide
} |
enum | LayoutMetric {
LM_BorderLeft,
LM_BorderRight,
LM_BorderBottom,
LM_TitleHeight,
LM_TitleBorderLeft,
LM_TitleBorderRight,
LM_TitleEdgeLeft,
LM_TitleEdgeRight,
LM_TitleEdgeTop,
LM_TitleEdgeBottom,
LM_ButtonWidth,
LM_ButtonHeight,
LM_ButtonSpacing,
LM_ExplicitButtonSpacer,
LM_ButtonMarginTop
} |
enum | WindowCorner { WC_TopLeft,
WC_TopRight,
WC_BottomLeft,
WC_BottomRight
} |
Public Slots |
void | closeWindow () |
void | keepAboveChange (bool above) |
void | keepBelowChange (bool below) |
void | maximize (MaximizeMode mode) |
void | maximize (Qt::MouseButtons button) |
void | menuButtonPressed () |
void | menuButtonReleased () |
void | minimize () |
void | setDesktop (int desktop) |
void | setKeepAbove (bool set) |
void | setKeepBelow (bool set) |
void | setShade (bool set) |
void | showContextHelp () |
void | slotKeepAbove () |
void | slotKeepBelow () |
void | slotMaximize () |
void | slotShade () |
void | titlebarDblClickOperation () |
void | titlebarMouseWheelOperation (int delta) |
void | toggleOnAllDesktops () |
Signals |
void | keepAboveChanged (bool) |
void | keepBelowChanged (bool) |
Public Member Functions |
virtual void | activeChange () |
virtual void | borders (int &left, int &right, int &top, int &bottom) const |
int | buttonsLeftWidth () const |
int | buttonsRightWidth () const |
QString | caption () const |
virtual void | captionChange () |
void | clearMask () |
virtual QRegion | cornerShape (WindowCorner corner) |
virtual KCommonDecorationButton * | createButton (ButtonType type)=0 |
void | createMainWidget (Qt::WFlags flags=0) |
KDecoration * | decoration () |
const KDecoration * | decoration () const |
virtual bool | decorationBehaviour (DecorationBehaviour behaviour) const |
virtual QString | defaultButtonsLeft () const |
virtual QString | defaultButtonsRight () const |
int | desktop () const |
virtual void | desktopChange () |
virtual bool | drawbound (const QRect &geom, bool clear) |
virtual bool | eventFilter (QObject *o, QEvent *e) |
KDecorationFactory * | factory () const |
QRect | geometry () const |
void | grabXServer () |
int | height () const |
QIcon | icon () const |
virtual void | iconChange () |
QRect | iconGeometry () const |
virtual void | init () |
QWidget * | initialParentWidget () const |
Qt::WFlags | initialWFlags () const |
bool | isActive () const |
bool | isCloseable () const |
bool | isMaximizable () const |
bool | isMinimizable () const |
bool | isModal () const |
bool | isMovable () const |
bool | isOnAllDesktops () const |
bool | isPreview () const |
bool | isResizable () const |
bool | isSetShade () const |
bool | isShade () const |
bool | isShadeable () const |
bool | isToolWindow () const |
| KCommonDecoration (KDecorationBridge *bridge, KDecorationFactory *factory) |
bool | keepAbove () const |
bool | keepBelow () const |
virtual int | layoutMetric (LayoutMetric lm, bool respectWindowState=true, const KCommonDecorationButton *button=0) const |
virtual void | maximizeChange () |
MaximizeMode | maximizeMode () const |
virtual QSize | minimumSize () const |
virtual void | mouseDoubleClickEvent (QMouseEvent *e) |
virtual Position | mousePosition (const QPoint &point) const |
virtual void | paintEvent (QPaintEvent *e)=0 |
void | performWindowOperation (WindowOperation op) |
void | processMousePressEvent (QMouseEvent *e) |
bool | providesContextHelp () const |
virtual void | reset (unsigned long changed) |
void | resetButtons () const |
virtual void | resize (const QSize &s) |
virtual void | resizeEvent (QResizeEvent *e) |
void | setMainWidget (QWidget *) |
void | setMask (const QRegion ®, int mode=0) |
virtual void | shadeChange () |
virtual void | show () |
void | showWindowMenu (QPoint pos) |
void | showWindowMenu (const QRect &pos) |
QRect | titleRect () const |
void | ungrabXServer () |
QRegion | unobscuredRegion (const QRegion &r) const |
void | updateButtons () const |
virtual void | updateCaption () |
void | updateLayout () const |
virtual void | updateWindowShape () |
virtual QString | visibleName () const =0 |
virtual void | wheelEvent (QWheelEvent *e) |
const QWidget * | widget () const |
QWidget * | widget () |
int | width () const |
virtual bool | windowDocked (Position side) |
WId | windowId () const |
NET::WindowType | windowType (unsigned long supported_types) const |
virtual | ~KCommonDecoration () |
Static Public Member Functions |
static const KDecorationOptions * | options () |
Detailed Description
This class eases development of decorations by implementing parts of
KDecoration which are error prone and common for most decorations.
It takes care of the window layout, button/action handling, and window mask creation. Note that for technical reasons KCommonDecoration does not inherit KDecoration but only provides the same API. If in rare cases you need to convert to KDecoration, use the decoration() function. See KDecoration documentation for all the wrapped functions.
Definition at line 65 of file kcommondecoration.h.
Member Enumeration Documentation
- Enumerator:
-
DB_MenuClose |
Close window on double clicking the menu. |
DB_WindowMask |
Set a mask on the window. |
DB_ButtonHide |
Hide buttons when there is not enough space in the titlebar. |
Definition at line 125 of file kcommondecoration.h.
Used to calculate the decoration layout.
The basic layout looks like this:
Window: _______________________________________________________________ | LM_TitleEdgeTop | |_______________________________________________________________| | LM_TitleEdgeLeft | [title] | LM_TitleEdgeRight | |__________________|________________________|___________________| | LM_TitleEdgeBottom | |_______________________________________________________________| | | | | | | | | | | | | |LM_BorderLeft LM_BorderRight| |_|___________________________________________________________|_| | LM_BorderBottom | |_______________________________________________________________|
Title: ___________________________________________________________________________________ | LM_ButtonMarginTop | | LM_ButtonMarginTop | |________________________________| |_________________________________| | [Buttons] | LM_TitleBorderLeft | LM_TitleHeight | LM_TitleBorderRight | [Buttons] | |___________|____________________|________________|_____________________|___________|
Buttons: _____________________________________________________________________________________________ | button | spacing | button | spacing | explicit spacer | spacing | ... | spacing | button | |________|_________|________|_________|_________________|_________|________|_________|________|
- See also:
- layoutMetric()
- Enumerator:
-
LM_BorderLeft |
|
LM_BorderRight |
|
LM_BorderBottom |
|
LM_TitleHeight |
|
LM_TitleBorderLeft |
|
LM_TitleBorderRight |
|
LM_TitleEdgeLeft |
|
LM_TitleEdgeRight |
|
LM_TitleEdgeTop |
|
LM_TitleEdgeBottom |
|
LM_ButtonWidth |
|
LM_ButtonHeight |
|
LM_ButtonSpacing |
|
LM_ExplicitButtonSpacer |
|
LM_ButtonMarginTop |
|
Definition at line 106 of file kcommondecoration.h.
- Enumerator:
-
WC_TopLeft |
|
WC_TopRight |
|
WC_BottomLeft |
|
WC_BottomRight |
|
Definition at line 132 of file kcommondecoration.h.
Member Function Documentation
Create a new title bar button.
KCommonDecoration takes care of memory management.
- Returns:
- a pointer to the button, or 0 if the button should not be created.
void KCommonDecoration::keepAboveChanged |
( |
bool |
|
) |
[signal] |
void KCommonDecoration::keepBelowChanged |
( |
bool |
|
) |
[signal] |
virtual void KCommonDecoration::paintEvent |
( |
QPaintEvent * |
e |
) |
[pure virtual] |
Draw the window decoration.
virtual QString KCommonDecoration::visibleName |
( |
|
) |
const [pure virtual] |
The name of the decoration used in the decoration preview.
The documentation for this class was generated from the following files: