1 /********************************************************************
4 Copyright (c) 2005 Sandro Giessl <sandro@giessl.com>
5 Ported to the kde3.2 API by Luciano Montanaro <mikelima@cirulla.net>
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2 of the License, or
10 (at your option) any later version.
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program. If not, see <http://www.gnu.org/licenses/>.
19 *********************************************************************/
21 #ifndef LAPTOPCLIENT_H
22 #define LAPTOPCLIENT_H
26 #include <kcommondecoration.h>
27 #include <kdecorationfactory.h>
33 class LaptopButton
: public KCommonDecorationButton
36 LaptopButton(ButtonType type
, LaptopClient
*parent
, const char *name
);
37 void setBitmap(const unsigned char *bitmap
);
38 virtual void reset(unsigned long changed
);
41 void paintEvent(QPaintEvent
*);
42 virtual void drawButton(QPainter
*p
);
46 class LaptopClient
: public KCommonDecoration
49 LaptopClient( KDecorationBridge
* b
, KDecorationFactory
* f
);
52 virtual QString
visibleName() const;
53 virtual QString
defaultButtonsLeft() const;
54 virtual QString
defaultButtonsRight() const;
55 virtual bool decorationBehaviour(DecorationBehaviour behaviour
) const;
56 virtual int layoutMetric(LayoutMetric lm
, bool respectWindowState
= true, const KCommonDecorationButton
* = 0) const;
57 virtual KCommonDecorationButton
*createButton(ButtonType type
);
59 virtual QRegion
cornerShape(WindowCorner corner
);
63 void paintEvent( QPaintEvent
* );
64 void reset( unsigned long );
65 void updateActiveBuffer();
68 bool mustDrawHandle() const;
69 bool isTransient() const;
76 class LaptopClientFactory
: public QObject
, public KDecorationFactory
81 LaptopClientFactory();
82 virtual ~LaptopClientFactory();
83 virtual KDecoration
* createDecoration( KDecorationBridge
* );
84 virtual bool reset( unsigned long changed
);
85 virtual bool supports( Ability ability
) const;
86 virtual QList
< BorderSize
> borderSizes() const;
88 void findPreferredHandleSize();
93 #endif // LAPTOPCLIENT_H