korganizer Library API Documentation

kotodoviewitem.h

00001 /*
00002     This file is part of KOrganizer.
00003 
00004     Copyright (c) 2000, 2001 Cornelius Schumacher <schumacher@kde.org>
00005 
00006     This program is free software; you can redistribute it and/or modify
00007     it under the terms of the GNU General Public License as published by
00008     the Free Software Foundation; either version 2 of the License, or
00009     (at your option) any later version.
00010 
00011     This program is distributed in the hope that it will be useful,
00012     but WITHOUT ANY WARRANTY; without even the implied warranty of
00013     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00014     GNU General Public License for more details.
00015 
00016     You should have received a copy of the GNU General Public License
00017     along with this program; if not, write to the Free Software
00018     Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
00019 
00020     As a special exception, permission is given to link this program
00021     with any edition of Qt, and distribute the resulting executable,
00022     without including the source code for Qt in the source distribution.
00023 */
00024 #ifndef KOTODOVIEWITEM_H
00025 #define KOTODOVIEWITEM_H
00026 
00027 #include <qmap.h>
00028 #include <qlistview.h>
00029 #include <qpalette.h>
00030 
00031 #include <libkcal/todo.h>
00032 #include <libkcal/incidence.h>
00033 
00034 using namespace KCal;
00035 
00036 class KOTodoView;
00037 
00045 class KOTodoViewItem : public QCheckListItem
00046 {
00047   public:
00054     KOTodoViewItem(QListView *parent, Todo *todo, KOTodoView *kotodo);
00055     KOTodoViewItem(KOTodoViewItem *parent, Todo *todo, KOTodoView *kotodo);
00056     virtual ~KOTodoViewItem() {}
00057 
00058     void construct();
00059 
00060     Todo *todo() { return mTodo; }
00061     Incidence *incidence() { return mTodo; }
00062     QDate itemDate() { return QDate(); }
00063 
00064     QString key(int, bool) const;
00065 
00066     void setSortKey(int column,const QString &key);
00067 
00068     bool isAlternate();
00069     int compare( QListViewItem *i, int col, bool ascending ) const;
00070     virtual void paintCell(QPainter *p, const QColorGroup &cg,
00071       int column, int width, int alignment);
00072 
00073 
00074     void setResourceColor(QColor color);
00075     QColor resourceColor() const { return mResourceColor; }
00076 
00077   protected:
00078 #if QT_VERSION >= 300
00079     void paintBranches(QPainter *p,const QColorGroup & cg,int w,int y,int h);
00080 #else
00081 #endif
00082   virtual void stateChange(bool);
00083   enum {
00084     eSummaryColumn=0,
00085     eRecurColumn=1,
00086     ePriorityColumn=2,
00087     ePercentColumn=3,
00088     eDueDateColumn=4,
00089     eCategoriesColumn=5,
00090     eDescriptionColumn=6
00091   };
00092     QColor mResourceColor;
00093 
00094 
00095   private:
00096     Todo *mTodo;
00097     KOTodoView *mTodoView;
00098 
00099     QMap<int,QString> mKeyMap;
00100     uint m_odd : 1;
00101     uint m_known : 1;
00102     uint m_unused : 30;
00103     bool m_init;
00104 };
00105 
00106 #endif
KDE Logo
This file is part of the documentation for korganizer Library Version 3.3.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Thu May 3 20:24:57 2007 by doxygen 1.4.2 written by Dimitri van Heesch, © 1997-2003