kwin Library API Documentation

WebButton.h

00001 /* 00002 'Web' kwin client 00003 00004 Copyright (C) 2001 Rik Hemsley (rikkus) <rik@kde.org> 00005 00006 This program is free software; you can redistribute it and/or 00007 modify it under the terms of the GNU General Public 00008 License as published by the Free Software Foundation; either 00009 version 2 of the License, or (at your option) any later version. 00010 00011 This program is distributed in the hope that it will be useful, 00012 but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00014 General Public License for more details. 00015 00016 You should have received a copy of the GNU General Public License 00017 along with this program; see the file COPYING. If not, write to 00018 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 00019 Boston, MA 02111-1307, USA. 00020 */ 00021 00022 #ifndef KWIN_WEB_BUTTON_H 00023 #define KWIN_WEB_BUTTON_H 00024 00025 #include <qwidget.h> 00026 #include <qbitmap.h> 00027 #include <qbutton.h> 00028 #include <klocale.h> 00029 00030 namespace Web 00031 { 00032 class WebClient; 00033 00034 class WebButton : public QButton 00035 { 00036 Q_OBJECT 00037 00038 public: 00039 00040 enum Position 00041 { 00042 Left, Mid, Right 00043 }; 00044 00045 WebButton(QWidget * parent, const QString& tip, WebClient* deco); 00046 00047 virtual ~WebButton(); 00048 00049 virtual QSize sizeHint() const; 00050 virtual QSize minimumSizeHint() const; 00051 00052 void setPosition(Position); 00053 00054 void setShape(bool); 00055 00056 void setTipText(const QString &tip); 00057 00058 protected: 00059 00060 virtual void clickEvent(int button) = 0; 00061 00062 void setBitmap(const QBitmap &); 00063 00064 void mousePressEvent(QMouseEvent *); 00065 void mouseReleaseEvent(QMouseEvent *); 00066 void mouseMoveEvent(QMouseEvent *) { /* Empty */ } 00067 void enterEvent(QEvent *); 00068 void leaveEvent(QEvent *); 00069 void paintEvent(QPaintEvent *); 00070 void resizeEvent(QResizeEvent *); 00071 00072 private: 00073 QBitmap bitmap_; 00074 00075 bool mouseOver_; 00076 bool mouseDown_; 00077 00078 Position position_; 00079 00080 bool shape_; 00081 WebClient* deco_; 00082 }; 00083 } 00084 00085 #endif 00086 00087 // vim:ts=2:sw=2:tw=78:set et:
KDE Logo
This file is part of the documentation for kwin Library Version 3.3.0.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Fri Aug 13 21:47:06 2004 by doxygen 1.3.8 written by Dimitri van Heesch, © 1997-2003