korganizer

kotodoviewitem.h
1 /*
2  This file is part of KOrganizer.
3 
4  Copyright (c) 2000, 2001 Cornelius Schumacher <schumacher@kde.org>
5  Copyright (C) 2003-2004 Reinhold Kainhofer <reinhold@kainhofer.com>
6  Copyright (c) 2005 Rafal Rzepecki <divide@users.sourceforge.net>
7 
8  This program is free software; you can redistribute it and/or modify
9  it under the terms of the GNU General Public License as published by
10  the Free Software Foundation; either version 2 of the License, or
11  (at your option) any later version.
12 
13  This program is distributed in the hope that it will be useful,
14  but WITHOUT ANY WARRANTY; without even the implied warranty of
15  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  GNU General Public License for more details.
17 
18  You should have received a copy of the GNU General Public License
19  along with this program; if not, write to the Free Software
20  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
21 
22  As a special exception, permission is given to link this program
23  with any edition of TQt, and distribute the resulting executable,
24  without including the source code for TQt in the source distribution.
25 */
26 #ifndef KOTODOVIEWITEM_H
27 #define KOTODOVIEWITEM_H
28 
29 #include <tqmap.h>
30 #include <tqlistview.h>
31 #include <tqpalette.h>
32 #include <tqdatetime.h>
33 
34 namespace KCal {
35 class Todo;
36 }
37 using namespace KCal;
38 
39 class KOTodoView;
40 
48 class KOTodoViewItem : public TQCheckListItem
49 {
50  public:
58  KOTodoViewItem(TQListView *parent, Todo *todo, KOTodoView *kotodo);
59  KOTodoViewItem(KOTodoViewItem *parent, Todo *todo, KOTodoView *kotodo);
60  virtual ~KOTodoViewItem() {}
61 
62  void construct();
63 
64  Todo *todo() const { return mTodo; }
65 
66  bool isAlternate();
67  int compare( TQListViewItem *i, int col, bool ascending ) const;
68  virtual void paintCell(TQPainter *p, const TQColorGroup &cg,
69  int column, int width, int alignment);
70 
71  protected:
72  void paintBranches(TQPainter *p,const TQColorGroup & cg,int w,int y,int h);
73  virtual void stateChange(bool);
74 
75  private:
76  Todo *mTodo;
77  KOTodoView *mTodoView;
78  TQDateTime mEffectiveDueDate;
79  int compareDueDates( const KOTodoViewItem *b ) const;
80 
81  uint m_odd : 1;
82  uint m_known : 1;
83  uint m_unused : 30;
84  bool m_init;
85 };
86 
87 #endif
This class provides a way of displaying a single Event of Todo-Type in a KTodoView.
This class provides a multi-column list view of todo events.
Definition: kotodoview.h:114