Make a branch to make krunner Good Enough For Aaron™.
[kdebase/uwolfer.git] / workspace / kwin / clients / oxygen / oxygenclient.h
blobf7b2f9cb802dd9ab1c74916f6273b4f29f88eb57
1 //////////////////////////////////////////////////////////////////////////////
2 // oxygenclient.h
3 // -------------------
4 // Oxygen 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 Oxygen {
40 class OxygenClient : public KCommonDecoration
42 Q_OBJECT
43 public:
44 OxygenClient(KDecorationBridge *b, KDecorationFactory *f);
45 virtual ~OxygenClient();
47 virtual QString visibleName() const;
48 virtual KCommonDecorationButton *createButton(::ButtonType type);
49 virtual bool decorationBehaviour(DecorationBehaviour behaviour) const;
50 virtual int layoutMetric(LayoutMetric lm, bool respectWindowState = true, const KCommonDecorationButton * = 0) const;
52 virtual void init();
54 private:
55 void paintEvent(QPaintEvent *e);
56 void doShape();
57 QColor titlebarTextColor(const QPalette &palette);
58 bool colorCacheInvalid_;
59 QColor cachedTitlebarTextColor_;
61 protected:
62 friend class OxygenButton;
63 OxygenHelper &helper_;
67 } // namespace Oxygen
69 #endif // EXAMPLECLIENT_H