kpilot Library API Documentation

listItems.h

00001 /* listItems.h KPilot 00002 ** 00003 ** Copyright (C) 1998-2001 by Dan Pilone 00004 ** 00005 ** This file defines a subclasse of QListBoxText that carries 00006 ** additional information useful for Pilot records. In particular it 00007 ** carries an int (for the pilot's uid?) and a void * (for pilotrecord?) 00008 */ 00009 00010 /* 00011 ** This program is free software; you can redistribute it and/or modify 00012 ** it under the terms of the GNU General Public License as published by 00013 ** the Free Software Foundation; either version 2 of the License, or 00014 ** (at your option) any later version. 00015 ** 00016 ** This program is distributed in the hope that it will be useful, 00017 ** but WITHOUT ANY WARRANTY; without even the implied warranty of 00018 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00019 ** GNU General Public License for more details. 00020 ** 00021 ** You should have received a copy of the GNU General Public License 00022 ** along with this program in a file called COPYING; if not, write to 00023 ** the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, 00024 ** MA 02111-1307, USA. 00025 */ 00026 00027 /* 00028 ** Bug reports and questions can be sent to kde-pim@kde.org 00029 */ 00030 00031 #ifndef _KPILOT_LISTITEMS_H 00032 #define _KPILOT_LISTITEMS_H 00033 00034 #include <qlistbox.h> 00035 #include <qlistview.h> 00036 #include <pi-dlp.h> 00037 00038 class PilotListItem : public QListBoxText 00039 { 00040 public: 00041 PilotListItem(const QString &text, recordid_t pilotid=0, void *r=0); 00042 virtual ~PilotListItem(); 00043 recordid_t id() const {return fid;}; 00044 const void *rec() const {return fr;}; 00045 00046 00047 protected: 00048 recordid_t fid; 00049 void *fr; 00050 00051 #ifdef DEBUG 00052 public: 00053 static void counts(); 00054 private: 00055 static int crt,del,bal,count; 00056 #endif 00057 }; 00058 00059 class PilotCheckListItem : public QCheckListItem 00060 { 00061 public: 00062 PilotCheckListItem( QListView * parent, const QString & text, recordid_t pilotid=0, void *r=0); 00063 virtual ~PilotCheckListItem(); 00064 recordid_t id() const {return fid;}; 00065 const void *rec() const {return fr;}; 00066 protected: 00067 virtual void stateChange ( bool ); 00068 recordid_t fid; 00069 void *fr; 00070 #ifdef DEBUG 00071 public: 00072 static void counts(); 00073 private: 00074 static int crt, del, bal, count; 00075 #endif 00076 }; 00077 00078 struct PilotListViewItemData 00079 { 00080 int valCol; 00081 bool valOk; 00082 unsigned long val; 00083 }; 00084 00085 class PilotListViewItem : public QListViewItem 00086 { 00087 public: 00088 PilotListViewItem( QListView * parent, 00089 QString label1, QString label2 = QString::null, 00090 QString label3 = QString::null, QString label4 = QString::null, 00091 recordid_t pilotid=0, void *r=0); 00092 virtual ~PilotListViewItem(); 00093 recordid_t id() const {return fid;}; 00094 const void *rec() const {return fr;}; 00095 public: 00096 void setNumericCol(int col, bool numeric); 00097 int compare( QListViewItem *i, int col, bool ascending ) const; 00098 protected: 00099 QValueList<int> numericCols; 00100 recordid_t fid; 00101 void *fr; 00102 // Caching to make sorting faster: 00103 PilotListViewItemData*d; 00104 unsigned long colValue(int col, bool *ok) const; 00105 #ifdef DEBUG 00106 public: 00107 static void counts(); 00108 private: 00109 static int crt, del, bal, count; 00110 #endif 00111 }; 00112 00113 00114 #else 00115 #ifdef DEBUG 00116 #warning "File doubly included" 00117 #endif 00118 #endif
KDE Logo
This file is part of the documentation for kpilot Library Version 3.2.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Wed Jul 28 23:57:49 2004 by doxygen 1.3.7 written by Dimitri van Heesch, © 1997-2003