libkdepim
overlaywidget.h
00001 /* -*- c++ -*- 00002 * overlaywidget.h 00003 * 00004 * Copyright (c) 2004 David Faure <faure@kde.org> 00005 * 00006 * This program is free software; you can redistribute it and/or modify 00007 * it under the terms of the GNU General Public License as published by 00008 * the Free Software Foundation; version 2 of the License 00009 * 00010 * This program is distributed in the hope that it will be useful, 00011 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00013 * GNU General Public License for more details. 00014 * 00015 * You should have received a copy of the GNU General Public License 00016 * along with this program; if not, write to the Free Software 00017 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 00018 * 00019 * In addition, as a special exception, the copyright holders give 00020 * permission to link the code of this program with any edition of 00021 * the Qt library by Trolltech AS, Norway (or with modified versions 00022 * of Qt that use the same license as Qt), and distribute linked 00023 * combinations including the two. You must obey the GNU General 00024 * Public License in all respects for all of the code used other than 00025 * Qt. If you modify this file, you may extend this exception to 00026 * your version of the file, but you are not obligated to do so. If 00027 * you do not wish to do so, delete this exception statement from 00028 * your version. 00029 */ 00030 #ifndef OVERLAYWIDGET_H 00031 #define OVERLAYWIDGET_H 00032 00033 #include <qhbox.h> 00034 00035 namespace KPIM { 00036 00044 class OverlayWidget : public QHBox 00045 { 00046 Q_OBJECT 00047 00048 public: 00049 OverlayWidget( QWidget* alignWidget, QWidget* parent, const char* name = 0 ); 00050 ~OverlayWidget(); 00051 00052 QWidget * alignWidget() { return mAlignWidget; } 00053 void setAlignWidget( QWidget * alignWidget ); 00054 00055 protected: 00056 void resizeEvent( QResizeEvent* ev ); 00057 bool eventFilter( QObject* o, QEvent* e); 00058 00059 private: 00060 void reposition(); 00061 00062 private: 00063 QWidget * mAlignWidget; 00064 }; 00065 00066 } // namespace 00067 00068 #endif /* OVERLAYWIDGET_H */ 00069