~ubuntu-branches/ubuntu/lucid/kdebase/lucid

« back to all changes in this revision

Viewing changes to kicker/extensions/kasbar/kasgroupitem.h

  • Committer: Bazaar Package Importer
  • Author(s): Jonathan Riddell
  • Date: 2008-05-27 12:09:48 UTC
  • mfrom: (1.1.13 upstream)
  • Revision ID: james.westby@ubuntu.com-20080527120948-dottsyd5rcwhzd36
Tags: 4:4.0.80-1ubuntu1
* Merge with Debian
 - remove 97_fix_target_link_libraries.diff
 - Add replaces/conflicts on -kde4 packages

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
// -*- c++ -*-
2
 
 
3
 
/* kasgroupitem.h
4
 
**
5
 
** Copyright (C) 2001-2004 Richard Moore <rich@kde.org>
6
 
** Contributor: Mosfet
7
 
**     All rights reserved.
8
 
**
9
 
** KasBar is dual-licensed: you can choose the GPL or the BSD license.
10
 
** Short forms of both licenses are included below.
11
 
*/
12
 
 
13
 
/*
14
 
** This program is free software; you can redistribute it and/or modify
15
 
** it under the terms of the GNU General Public License as published by
16
 
** the Free Software Foundation; either version 2 of the License, or
17
 
** (at your option) any later version.
18
 
**
19
 
** This program is distributed in the hope that it will be useful,
20
 
** but WITHOUT ANY WARRANTY; without even the implied warranty of
21
 
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22
 
** GNU General Public License for more details.
23
 
**
24
 
** You should have received a copy of the GNU General Public License
25
 
** along with this program in a file called COPYING; if not, write to
26
 
** the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
27
 
** MA 02110-1301, USA.
28
 
*/
29
 
 
30
 
/*
31
 
** Redistribution and use in source and binary forms, with or without
32
 
** modification, are permitted provided that the following conditions
33
 
** are met:
34
 
** 1. Redistributions of source code must retain the above copyright
35
 
**    notice, this list of conditions and the following disclaimer.
36
 
** 2. Redistributions in binary form must reproduce the above copyright
37
 
**    notice, this list of conditions and the following disclaimer in the
38
 
**    documentation and/or other materials provided with the distribution.
39
 
**
40
 
** THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
41
 
** ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
42
 
** IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
43
 
** ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
44
 
** FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
45
 
** DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
46
 
** OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
47
 
** HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
48
 
** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
49
 
** OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
50
 
** SUCH DAMAGE.
51
 
*/
52
 
 
53
 
/*
54
 
** Bug reports and questions can be sent to kde-devel@kde.org
55
 
*/
56
 
// -*- c++ -*-
57
 
 
58
 
 
59
 
#ifndef KASGROUPITEM_H
60
 
#define KASGROUPITEM_H
61
 
 
62
 
#include <qpixmap.h>
63
 
#include <taskmanager.h>
64
 
#include "kasitem.h"
65
 
 
66
 
class KasPopup;
67
 
class KasTasker;
68
 
class KPixmap;
69
 
class Task;
70
 
 
71
 
/**
72
 
 * A KasItem that holds a list of Tasks.
73
 
 */
74
 
class KasGroupItem : public KasItem
75
 
{
76
 
   Q_OBJECT
77
 
 
78
 
public:
79
 
   enum GroupType {
80
 
       GroupRelated, GroupDesktop
81
 
   };
82
 
 
83
 
   KasGroupItem( KasTasker *parent/*, Group *group*/ );
84
 
   virtual ~KasGroupItem();
85
 
 
86
 
   uint groupType() const { return groupType_; }
87
 
   void setGroupType( uint type ) { groupType_ = type; }
88
 
 
89
 
   /** Reimplemented to paint the item. */
90
 
   virtual void paint( QPainter *p );
91
 
 
92
 
   KasTasker *kasbar() const;
93
 
 
94
 
   Task::Ptr task( uint i ) { return items.at( i ); }
95
 
   int taskCount() const { return items.count(); }
96
 
 
97
 
   QPixmap icon();
98
 
  
99
 
public slots:
100
 
   void addTask( Task::Ptr t );
101
 
   void removeTask( Task::Ptr t );
102
 
 
103
 
   void ungroup();
104
 
 
105
 
   void showGroupMenuAt( QMouseEvent *ev );   
106
 
   void showGroupMenuAt( const QPoint &p );
107
 
 
108
 
   void updateIcon();
109
 
 
110
 
   void updatePopup();
111
 
 
112
 
protected:
113
 
   /** Reimplemented to create a KasGroupPopup. */
114
 
   virtual KasPopup *createPopup();
115
 
 
116
 
private:
117
 
   QString title_;
118
 
   Task::List items;
119
 
   uint groupType_;
120
 
   KasTasker *bar;
121
 
};
122
 
 
123
 
#endif // KASGROUPITEM_H
124