kotodoviewitem.h
00001 /* 00002 This file is part of KOrganizer. 00003 00004 Copyright (c) 2000, 2001 Cornelius Schumacher <schumacher@kde.org> 00005 Copyright (C) 2003-2004 Reinhold Kainhofer <reinhold@kainhofer.com> 00006 Copyright (c) 2005 Rafal Rzepecki <divide@users.sourceforge.net> 00007 00008 This program is free software; you can redistribute it and/or modify 00009 it under the terms of the GNU General Public License as published by 00010 the Free Software Foundation; either version 2 of the License, or 00011 (at your option) any later version. 00012 00013 This program is distributed in the hope that it will be useful, 00014 but WITHOUT ANY WARRANTY; without even the implied warranty of 00015 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00016 GNU General Public License for more details. 00017 00018 You should have received a copy of the GNU General Public License 00019 along with this program; if not, write to the Free Software 00020 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 00021 00022 As a special exception, permission is given to link this program 00023 with any edition of TQt, and distribute the resulting executable, 00024 without including the source code for TQt in the source distribution. 00025 */ 00026 #ifndef KOTODOVIEWITEM_H 00027 #define KOTODOVIEWITEM_H 00028 00029 #include <tqmap.h> 00030 #include <tqlistview.h> 00031 #include <tqpalette.h> 00032 #include <tqdatetime.h> 00033 00034 namespace KCal { 00035 class Todo; 00036 } 00037 using namespace KCal; 00038 00039 class KOTodoView; 00040 00048 class KOTodoViewItem : public TQCheckListItem 00049 { 00050 public: 00058 KOTodoViewItem(TQListView *parent, Todo *todo, KOTodoView *kotodo); 00059 KOTodoViewItem(KOTodoViewItem *parent, Todo *todo, KOTodoView *kotodo); 00060 virtual ~KOTodoViewItem() {} 00061 00062 void construct(); 00063 00064 Todo *todo() const { return mTodo; } 00065 00066 bool isAlternate(); 00067 int compare( TQListViewItem *i, int col, bool ascending ) const; 00068 virtual void paintCell(TQPainter *p, const TQColorGroup &cg, 00069 int column, int width, int alignment); 00070 00071 protected: 00072 void paintBranches(TQPainter *p,const TQColorGroup & cg,int w,int y,int h); 00073 virtual void stateChange(bool); 00074 00075 private: 00076 Todo *mTodo; 00077 KOTodoView *mTodoView; 00078 TQDateTime mEffectiveDueDate; 00079 int compareDueDates( const KOTodoViewItem *b ) const; 00080 00081 uint m_odd : 1; 00082 uint m_known : 1; 00083 uint m_unused : 30; 00084 bool m_init; 00085 }; 00086 00087 #endif