00001 /********************************************************************** 00002 ** Copyright (C) 2000 Trolltech AS. All rights reserved. 00003 ** 00004 ** This file is part of Qtopia Environment. 00005 ** 00006 ** This file may be distributed and/or modified under the terms of the 00007 ** GNU General Public License version 2 as published by the Free Software 00008 ** Foundation and appearing in the file LICENSE.GPL included in the 00009 ** packaging of this file. 00010 ** 00011 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 00012 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 00013 ** 00014 ** See http://www.trolltech.com/gpl/ for GPL licensing information. 00015 ** 00016 ** Contact info@trolltech.com if any conditions of this licensing are 00017 ** not clear to you. 00018 ** 00019 **********************************************************************/ 00020 00021 #ifndef Tvlistview_H 00022 #define Tvlistview_H 00023 00024 #include "../db/common.h" 00025 #include <qlistview.h> 00026 #include <qmap.h> 00027 00028 class QListViewItemIterator; 00029 00030 class TVListViewPrivate : public QListView 00031 { 00032 Q_OBJECT 00033 00034 signals: 00035 void sortChanged(int i); 00036 00037 public: 00038 TVListViewPrivate( QWidget *parent = 0, const char *name = 0, WFlags fl = 0); 00039 00040 void setColumnWidth(int c, int w); 00041 void setSorting(int i, bool increasing=true); 00042 }; 00043 00044 class TVListView : public QWidget 00045 { 00046 Q_OBJECT 00047 00048 signals: 00049 void loadFile(); 00050 void browseView(); 00051 void filterView(); 00052 void editView(); 00053 00054 protected slots: 00055 void setSorting(int); 00056 void setCurrent(QListViewItem *); 00057 00058 public: 00059 TVListView(TableState *t, QWidget* parent = 0, 00060 const char* name = 0, WFlags fl = 0); 00061 ~TVListView(); 00062 00063 /* to be used for setting up the list */ 00064 void addItem(DataElem *); 00065 void removeItem(); // remove from list, not from program 00066 void clearItems(); 00067 00068 /* DBStore clone functions */ 00069 void first(); 00070 void last(); 00071 void next(); 00072 void previous(); 00073 00074 void rebuildKeys(); 00075 void rebuildData(); 00076 void reset(); 00077 00078 DataElem *getCurrentData(); 00079 00080 void findItem(int i, TVVariant v); 00081 00082 protected: 00083 QListViewItemIterator *it; 00084 TableState *ts; 00085 00086 TVListViewPrivate *listViewDisplay; 00087 00088 QMap<int, int> keyIds; 00089 00090 }; 00091 00092 #endif
1.4.2