33#include <tdeversion.h>
35class KDecorationOptionsPrivate;
36class KDecorationBridge;
37class KDecorationPrivate;
38class KDecorationFactory;
40#define KWIN_EXPORT TDE_EXPORT
55 PositionCenter = 0x00,
59 PositionBottom = 0x08,
60 PositionTopLeft = PositionLeft | PositionTop,
61 PositionTopRight = PositionRight | PositionTop,
62 PositionBottomLeft = PositionLeft | PositionBottom,
63 PositionBottomRight = PositionRight | PositionBottom
73 MaximizeHorizontal = 2,
75 MaximizeFull = MaximizeVertical | MaximizeHorizontal
94 ToggleStoreSettingsOp = WindowRulesOp,
101 SetupWindowShortcutOp,
129 SettingDecoration = 1 << 0,
130 SettingColors = 1 << 1,
131 SettingFont = 1 << 2,
132 SettingButtons = 1 << 3,
133 SettingTooltips = 1 << 4,
134 SettingBorder = 1 << 5
159 AbilityAnnounceButtons = 0,
160 AbilityButtonMenu = 1000,
161 AbilityButtonOnAllDesktops = 1001,
162 AbilityButtonSpacer = 1002,
163 AbilityButtonHelp = 1003,
164 AbilityButtonMinimize = 1004,
165 AbilityButtonMaximize = 1005,
166 AbilityButtonClose = 1006,
167 AbilityButtonAboveOthers = 1007,
168 AbilityButtonBelowOthers = 1008,
169 AbilityButtonShade = 1009,
170 AbilityButtonResize = 1010,
171 ABILITY_DUMMY = 10000000
174 enum Requirement { REQUIREMENT_DUMMY = 1000000 };
177class KDecorationProvides
181 virtual bool provides( Requirement req ) = 0;
202 const TQColor& color(
ColorType type,
bool active=
true)
const;
210 const TQColorGroup& colorGroup(
ColorType type,
bool active=
true)
const;
218 const TQFont& font(
bool active=
true,
bool small =
false)
const;
226 bool customButtonPositions()
const;
248 TQString titleButtonsLeft()
const;
260 TQString titleButtonsRight()
const;
266 bool showTooltips()
const;
278 BorderSize preferredBorderSize( KDecorationFactory* factory )
const;
286 bool moveResizeMaximizedWindows()
const;
291 WindowOperation operationMaxButtonClick( TQt::ButtonState button )
const;
296 virtual unsigned long updateSettings() = 0;
302 KDecorationOptionsPrivate* d;
323 KDecoration( KDecorationBridge* bridge, KDecorationFactory* factory );
339 bool isActive()
const;
343 bool isCloseable()
const;
347 bool isMaximizable()
const;
357 bool isMinimizable()
const;
362 bool providesContextHelp()
const;
373 bool isOnAllDesktops()
const;
377 bool isModal()
const;
381 bool isShadeable()
const;
390 bool isShade()
const;
398 bool isSetShade()
const;
402 bool keepAbove()
const;
406 bool keepBelow()
const;
410 bool isMovable()
const;
414 bool isResizable()
const;
438 NET::WindowType windowType(
unsigned long supported_types )
const;
442 TQIconSet icon()
const;
446 TQString caption()
const;
473 void showWindowMenu(
const TQRect &pos );
478 void showWindowMenu( TQPoint pos );
492 void setMask(
const TQRegion& reg,
int mode = 0 );
502 bool isPreview()
const;
506 TQRect geometry()
const;
512 TQRect iconGeometry()
const;
521 TQRegion unobscuredRegion(
const TQRegion& r )
const;
526 TQWidget* workspaceWidget()
const;
540 WId windowId()
const;
554 void processMousePressEvent( TQMouseEvent* e );
570 virtual Position mousePosition(
const TQPoint& p )
const = 0;
585 virtual void borders(
int& left,
int& right,
int& top,
int& bottom )
const = 0;
593 virtual void resize(
const TQSize& s ) = 0;
629#if KDE_IS_VERSION( 3, 90, 0 )
630#warning Redo all the XYZChange() virtuals as signals.
657 virtual bool drawbound(
const TQRect& geom,
bool clear );
668 virtual bool animateMinimize(
bool minimize );
673 virtual bool windowDocked(
Position side );
680 virtual void reset(
unsigned long changed );
690 void setMainWidget( TQWidget* );
700 void createMainWidget( TQt::WFlags flags = 0 );
704 TQWidget* initialParentWidget()
const;
711 TQt::WFlags initialWFlags()
const;
718 void helperShowHide(
bool show );
726 const TQWidget* widget()
const;
730 KDecorationFactory* factory()
const;
738 void ungrabXServer();
771#if KDE_IS_VERSION( 3, 90, 0 )
772#warning Update the docs.
774 void maximize( ButtonState button );
788 void showContextHelp();
793 void setDesktop(
int desktop );
797 void toggleOnAllDesktops();
802 void titlebarDblClickOperation();
809 void titlebarMouseWheelOperation(
int delta );
814 void setShade(
bool set );
819 void setKeepAbove(
bool set );
824 void setKeepBelow(
bool set );
828 void emitKeepAboveChanged(
bool above ) { emit keepAboveChanged( above ); }
832 void emitKeepBelowChanged(
bool below ) { emit keepBelowChanged( below ); }
834 KDecorationBridge* bridge_;
836 KDecorationFactory* factory_;
839 KDecorationPrivate* d;
877 return desktop() == NET::OnAllDesktops;
This class provides a namespace for all decoration related classes.
Position
These values represent positions inside an area.
ColorType
Basic color types that should be recognized by all decoration styles.
@ ColorTitleBar
The color for the titlebar.
@ ColorButtonBg
The color to use for the titlebar buttons.
@ ColorFont
The titlebar text color.
@ ColorFrame
The color for the window frame (border)
@ ColorTitleBlend
The blend color for the titlebar.
@ ColorHandle
The color for the resize handle.
Ability
Used to find out which features the decoration supports.
MaximizeMode
Maximize mode.
@ BorderVeryHuge
Very huge borders.
@ BorderOversized
Oversized borders.
@ BorderHuge
Huge borders.
@ BorderVeryLarge
Very large borders.
@ BorderTiny
Minimal borders.
@ BorderNormal
Standard size borders, the default setting.
@ BorderLarge
Larger borders.
This class holds various configuration settings for the decoration.
This is the base class for a decoration object.
virtual void iconChange()=0
This function is called whenever the window icon changes.
virtual void desktopChange()=0
This function is called whenever the desktop for the window changes.
virtual void resize(const TQSize &s)=0
This method is called by twin when the style should resize the decoration window.
virtual void init()=0
This function is called immediately after the decoration object is created.
TQRect geometry() const
Returns the geometry of the decoration.
virtual void captionChange()=0
This function is called whenever the caption changes.
int height() const
Convenience function that returns the height of the decoration.
TQWidget * widget()
Returns the main widget for the decoration.
KDecorationFactory * factory() const
Returns the factory that created this decoration.
virtual void shadeChange()=0
This function is called whenever the window is shaded or unshaded.
virtual void maximizeChange()=0
This function is called whenever the maximalization state of the window changes.
virtual void activeChange()=0
This function is called whenever the window either becomes or stops being active.
int desktop() const
Returns the number of the virtual desktop the decorated window is currently on (including NET::OnAllD...
void keepBelowChanged(bool)
This signal is emitted whenever the window's keep-below state changes.
void keepAboveChanged(bool)
This signal is emitted whenever the window's keep-above state changes.
bool isOnAllDesktops() const
Convenience function that returns true if the window is on all virtual desktops.
int width() const
Convenience function that returns the width of the decoration.
virtual void borders(int &left, int &right, int &top, int &bottom) const =0
This function should return the distance from each window side to the inner window.
virtual TQSize minimumSize() const =0
This function should return the minimum required size for the decoration.