Start to fix some error
[kdeartwork.git] / kwin-styles / openlook / OpenLook.h
blob23f3570a307ff6ddca827e3ab92e4dbc69d517d5
1 /*
2 'OpenLook' kwin client
4 Porting to kde3.2 API
5 Copyright 2003 Luciano Montanaro <mikelima@cirulla.net>
7 Permission is hereby granted, free of charge, to any person obtaining a copy
8 of this software and associated documentation files (the "Software"), to
9 deal in the Software without restriction, including without limitation the
10 rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
11 sell copies of the Software, and to permit persons to whom the Software is
12 furnished to do so, subject to the following conditions:
14 The above copyright notice and this permission notice shall be included in
15 all copies or substantial portions of the Software.
17 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
21 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
25 #ifndef KWIN_WEB_H
26 #define KWIN_WEB_H
28 #include <q3ptrlist.h>
29 #include <q3button.h>
30 //Added by qt3to4:
31 #include <QMouseEvent>
32 #include <QShowEvent>
33 #include <Q3ValueList>
34 #include <QResizeEvent>
35 #include <QEvent>
36 #include <QPaintEvent>
38 #include <kdecoration.h>
39 #include <kdecorationfactory.h>
40 #include <kcommondecoration.h>
41 class QSpacerItem;
43 namespace OpenLook
45 class OpenLookButton;
47 class OpenLook : public KDecoration
49 Q_OBJECT
50 public:
52 OpenLook(KDecorationBridge *b, KDecorationFactory *f);
53 ~OpenLook();
54 void init();
56 protected:
57 bool eventFilter(QObject *o, QEvent *e);
58 void resizeEvent(QResizeEvent *e);
59 void paintEvent(QPaintEvent *e);
60 void showEvent(QShowEvent *e);
62 virtual void captionChange();
63 void desktopChange();
64 void activeChange();
65 void shadeChange();
66 void iconChange();
67 void maximizeChange();
68 void borders(int &left, int &right, int &top, int &bottom) const;
69 QSize minimumSize() const;
70 void resize( const QSize& );
71 virtual void mouseDoubleClickEvent(QMouseEvent *);
73 virtual Position mousePosition(const QPoint &) const;
74 virtual bool animateMinimize(bool);
76 private:
78 void doLayout();
80 QRect titleRect() const;
82 QRect topLeftRect() const;
83 QRect topRightRect() const;
84 QRect bottomLeftRect() const;
85 QRect bottomRightRect() const;
87 QRect buttonRect() const;
89 void paintBorder(QPainter &) const;
91 void paintTopLeftRect(QPainter &) const;
92 void paintTopRightRect(QPainter &) const;
93 void paintBottomLeftRect(QPainter &) const;
94 void paintBottomRightRect(QPainter &) const;
96 void paintButton(QPainter &) const;
97 void paintArrow(QPainter &) const;
99 bool isButtonPress(QMouseEvent *);
100 bool isButtonRelease(QMouseEvent *);
102 QSpacerItem * titleSpacer_;
103 QPoint mousePressPoint_;
104 bool tool_;
105 bool buttonDown_;
108 class DecorationFactory: public QObject, public KDecorationFactory
110 public:
111 DecorationFactory();
112 virtual ~DecorationFactory();
113 virtual KDecoration *createDecoration(KDecorationBridge *);
114 virtual bool reset(unsigned long changed);
115 virtual bool supports( Ability ability );
116 virtual QList< DecorationFactory::BorderSize > borderSizes() const;
120 #endif
121 // vim:ts=2:sw=2:tw=78:set et: