korganizer

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 Qt, and distribute the resulting executable,
00024     without including the source code for Qt in the source distribution.
00025 */
00026 #ifndef KOTODOVIEWITEM_H
00027 #define KOTODOVIEWITEM_H
00028 
00029 #include <qmap.h>
00030 #include <qlistview.h>
00031 #include <qpalette.h>
00032 #include <qdatetime.h>
00033 
00034 namespace KCal {
00035 class Todo;
00036 }
00037 using namespace KCal;
00038 
00039 class KOTodoView;
00040 
00048 class KOTodoViewItem : public QCheckListItem
00049 {
00050   public:
00058     KOTodoViewItem(QListView *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( QListViewItem *i, int col, bool ascending ) const;
00068     virtual void paintCell(QPainter *p, const QColorGroup &cg,
00069       int column, int width, int alignment);
00070 
00071   protected:
00072 #if QT_VERSION >= 300
00073     void paintBranches(QPainter *p,const QColorGroup & cg,int w,int y,int h);
00074 #else
00075 #endif
00076   virtual void stateChange(bool);
00077 
00078   private:
00079     Todo *mTodo;
00080     KOTodoView *mTodoView;
00081     QDateTime mEffectiveDueDate;
00082     int compareDueDates( const KOTodoViewItem *b ) const;
00083 
00084     uint m_odd : 1;
00085     uint m_known : 1;
00086     uint m_unused : 30;
00087     bool m_init;
00088 };
00089 
00090 #endif
KDE Home | KDE Accessibility Home | Description of Access Keys