add more spacing
[personal-kdebase.git] / workspace / kwin / clients / ozone / oxygenclient.h
blob70af9f246c05327ac12796ba926824a3d7a95911
1 //////////////////////////////////////////////////////////////////////////////
2 // oxygenclient.h
3 // -------------------
4 // Ozone window decoration for KDE
5 // -------------------
6 // Copyright (c) 2003, 2004 David Johnson <david@usermode.org>
7 // Copyright (c) 2006, 2007 Riccardo Iaconelli <ruphy@fsfe.org>
8 //
9 // Permission is hereby granted, free of charge, to any person obtaining a copy
10 // of this software and associated documentation files (the "Software"), to
11 // deal in the Software without restriction, including without limitation the
12 // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
13 // sell copies of the Software, and to permit persons to whom the Software is
14 // furnished to do so, subject to the following conditions:
16 // The above copyright notice and this permission notice shall be included in
17 // all copies or substantial portions of the Software.
19 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22 // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
24 // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
25 // IN THE SOFTWARE.
26 //////////////////////////////////////////////////////////////////////////////
28 #ifndef OXYGENCLIENT_H
29 #define OXYGENCLIENT_H
32 #include <kcommondecoration.h>
34 #include "lib/helper.h"
36 class QPoint;
38 namespace Ozone
40 namespace Oxygen {
42 class OxygenClient : public KCommonDecorationUnstable
44 Q_OBJECT
45 public:
46 OxygenClient(KDecorationBridge *b, KDecorationFactory *f);
47 virtual ~OxygenClient();
49 virtual QString visibleName() const;
50 virtual KCommonDecorationButton *createButton(::ButtonType type);
51 virtual bool decorationBehaviour(DecorationBehaviour behaviour) const;
52 virtual int layoutMetric(LayoutMetric lm, bool respectWindowState = true, const KCommonDecorationButton * = 0) const;
53 virtual void updateWindowShape();
54 virtual void init();
56 virtual QList<QRect> shadowQuads( ShadowType type ) const;
57 virtual double shadowOpacity( ShadowType type ) const;
59 private:
60 void paintEvent(QPaintEvent *e);
61 void drawScratch(QPainter *p, QPalette &palette, const int start, const int end, const int topMargin);
62 QColor titlebarTextColor(const QPalette &palette);
63 bool colorCacheInvalid_;
64 QColor cachedTitlebarTextColor_;
66 protected:
67 friend class OxygenButton;
68 OxygenHelper &helper_;
72 } // namespace Oxygen
73 } // namespace Ozone
75 #endif // EXAMPLECLIENT_H