00001 // -*- c++ -*- 00002 00003 /* kasgroupitem.h 00004 ** 00005 ** Copyright (C) 2001-2004 Richard Moore <rich@kde.org> 00006 ** Contributor: Mosfet 00007 ** All rights reserved. 00008 ** 00009 ** KasBar is dual-licensed: you can choose the GPL or the BSD license. 00010 ** Short forms of both licenses are included below. 00011 */ 00012 00013 /* 00014 ** This program is free software; you can redistribute it and/or modify 00015 ** it under the terms of the GNU General Public License as published by 00016 ** the Free Software Foundation; either version 2 of the License, or 00017 ** (at your option) any later version. 00018 ** 00019 ** This program is distributed in the hope that it will be useful, 00020 ** but WITHOUT ANY WARRANTY; without even the implied warranty of 00021 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00022 ** GNU General Public License for more details. 00023 ** 00024 ** You should have received a copy of the GNU General Public License 00025 ** along with this program in a file called COPYING; if not, write to 00026 ** the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 00027 ** MA 02110-1301, USA. 00028 */ 00029 00030 /* 00031 ** Redistribution and use in source and binary forms, with or without 00032 ** modification, are permitted provided that the following conditions 00033 ** are met: 00034 ** 1. Redistributions of source code must retain the above copyright 00035 ** notice, this list of conditions and the following disclaimer. 00036 ** 2. Redistributions in binary form must reproduce the above copyright 00037 ** notice, this list of conditions and the following disclaimer in the 00038 ** documentation and/or other materials provided with the distribution. 00039 ** 00040 ** THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND 00041 ** ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 00042 ** IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 00043 ** ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 00044 ** FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 00045 ** DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 00046 ** OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 00047 ** HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 00048 ** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 00049 ** OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 00050 ** SUCH DAMAGE. 00051 */ 00052 00053 /* 00054 ** Bug reports and questions can be sent to kde-devel@kde.org 00055 */ 00056 // -*- c++ -*- 00057 00058 00059 #ifndef KASGROUPITEM_H 00060 #define KASGROUPITEM_H 00061 00062 #include <tqpixmap.h> 00063 #include <taskmanager.h> 00064 #include "kasitem.h" 00065 00066 class KasPopup; 00067 class KasTasker; 00068 class KPixmap; 00069 class Task; 00070 00074 class KasGroupItem : public KasItem 00075 { 00076 Q_OBJECT 00077 00078 public: 00079 enum GroupType { 00080 GroupRelated, GroupDesktop 00081 }; 00082 00083 KasGroupItem( KasTasker *parent/*, Group *group*/ ); 00084 virtual ~KasGroupItem(); 00085 00086 uint groupType() const { return groupType_; } 00087 void setGroupType( uint type ) { groupType_ = type; } 00088 00090 virtual void paint( TQPainter *p ); 00091 00092 KasTasker *kasbar() const; 00093 00094 Task::Ptr task( uint i ) { return items.at( i ); } 00095 int taskCount() const { return items.count(); } 00096 00097 TQPixmap icon(); 00098 00099 public slots: 00100 void addTask( Task::Ptr t ); 00101 void removeTask( Task::Ptr t ); 00102 00103 void ungroup(); 00104 00105 void showGroupMenuAt( TQMouseEvent *ev ); 00106 void showGroupMenuAt( const TQPoint &p ); 00107 00108 void updateIcon(); 00109 00110 void updatePopup(); 00111 00112 protected: 00114 virtual KasPopup *createPopup(); 00115 00116 private: 00117 TQString title_; 00118 Task::List items; 00119 uint groupType_; 00120 KasTasker *bar; 00121 }; 00122 00123 #endif // KASGROUPITEM_H 00124
1.6.1