00001 /* kaspopup.h 00002 ** 00003 ** Copyright (C) 2001-2004 Richard Moore <rich@kde.org> 00004 ** Contributor: Mosfet 00005 ** All rights reserved. 00006 ** 00007 ** KasBar is dual-licensed: you can choose the GPL or the BSD license. 00008 ** Short forms of both licenses are included below. 00009 */ 00010 00011 /* 00012 ** This program is free software; you can redistribute it and/or modify 00013 ** it under the terms of the GNU General Public License as published by 00014 ** the Free Software Foundation; either version 2 of the License, or 00015 ** (at your option) any later version. 00016 ** 00017 ** This program is distributed in the hope that it will be useful, 00018 ** but WITHOUT ANY WARRANTY; without even the implied warranty of 00019 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00020 ** GNU General Public License for more details. 00021 ** 00022 ** You should have received a copy of the GNU General Public License 00023 ** along with this program in a file called COPYING; if not, write to 00024 ** the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 00025 ** MA 02110-1301, USA. 00026 */ 00027 00028 /* 00029 ** Redistribution and use in source and binary forms, with or without 00030 ** modification, are permitted provided that the following conditions 00031 ** are met: 00032 ** 1. Redistributions of source code must retain the above copyright 00033 ** notice, this list of conditions and the following disclaimer. 00034 ** 2. Redistributions in binary form must reproduce the above copyright 00035 ** notice, this list of conditions and the following disclaimer in the 00036 ** documentation and/or other materials provided with the distribution. 00037 ** 00038 ** THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND 00039 ** ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 00040 ** IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 00041 ** ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 00042 ** FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 00043 ** DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 00044 ** OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 00045 ** HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 00046 ** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 00047 ** OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 00048 ** SUCH DAMAGE. 00049 */ 00050 00051 /* 00052 ** Bug reports and questions can be sent to kde-devel@kde.org 00053 */ 00054 // -*- c++ -*- 00055 00056 #ifndef KASPOPUP_H 00057 #define KASPOPUP_H 00058 00059 #include <tqguardedptr.h> 00060 #include <tqhbox.h> 00061 #include <kpixmap.h> 00062 00063 #include "kasitem.h" 00064 00065 class KasBar; 00066 00072 class KasPopup : public QHBox 00073 { 00074 Q_OBJECT 00075 00076 public: 00077 KasPopup( KasItem *item, const char *name=0 ); 00078 virtual ~KasPopup(); 00079 00081 KasItem *item() const { return item_; } 00082 KasBar *kasbar() const { return kasbar_; } 00083 00084 static TQPoint calcPosition( KasItem *item, int w, int h ); 00085 00086 public slots: 00091 void positionSelf(); 00092 00094 void show(); 00095 00096 signals: 00097 void aboutToShow(); 00098 void shown(); 00099 00100 private: 00101 TQGuardedPtr<KasItem> item_; 00102 KasBar *kasbar_; 00103 }; 00104 00105 #endif // KASPOPUP_H 00106 00107
1.6.1