kpilot Library API Documentation

dbviewerWidget.h

00001 #ifndef _KPILOT_DBVIEWERWIDGET_H
00002 #define _KPILOT_DBVIEWERWIDGET_H
00003 /* dbViewerWidget.h     KPilot
00004 **
00005 ** Copyright (C) 2003 by Dan Pilone.
00006 **  Written 2003 by Reinhold Kainhofer and Adriaan de Groot
00007 **
00008 ** This is the generic DB viewer widget.
00009 */
00010 
00011 /*
00012 ** This program is free software; you can redistribute it and/or modify
00013 ** it under the terms of the GNU General Public License as published by
00014 ** the Free Software Foundation; either version 2 of the License, or
00015 ** (at your option) any later version.
00016 **
00017 ** This program is distributed in the hope that it will be useful,
00018 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00019 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00020 ** GNU General Public License for more details.
00021 **
00022 ** You should have received a copy of the GNU General Public License
00023 ** along with this program in a file called COPYING; if not, write to
00024 ** the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
00025 ** MA 02111-1307, USA.
00026 */
00027 
00028 /*
00029 ** Bug reports and questions can be sent to kde-pim@kde.org
00030 */
00031 
00032 #include "pilotComponent.h"
00033 
00034 class KListBox;
00035 class KTextEdit;
00036 class KPushButton;
00037 class KComboBox;
00038 class PilotLocalDatabase;
00039 class PilotRecord;
00040 class KListView;
00041 
00042 class GenericDBWidget : public PilotComponent
00043 {
00044 Q_OBJECT
00045 
00046 public:
00047     GenericDBWidget(QWidget* parent, const QString& dbpath);
00048     virtual ~GenericDBWidget();
00049 
00050     // Pilot component methods
00051     /* virtual */ void showComponent();
00052     /* virtual */ void hideComponent();
00053 
00054     QString getCurrentDB() const {  return currentDB; }
00055 protected:
00056     void setupWidget();
00057 
00058 protected slots:
00059     void slotSelected(const QString &dbname);
00060     void slotDBType(int mode);
00061     void reset();
00062     void slotAddRecord();
00063     void slotEditRecord();
00064     bool slotEditRecord(QListViewItem*);
00065     void slotDeleteRecord();
00066     void slotShowAppInfo();
00067     void slotShowDBInfo();
00068     void enableWidgets(bool enable);
00069     void writeRecord(PilotRecord*r);
00070 
00071 private:
00072     KListBox*fDBList;
00073     KComboBox*fDBType;
00074     KTextEdit*fDBInfo;
00075     KPushButton*fDBInfoButton, *fAppInfoButton;
00076     KListView*fRecordList;
00077     KPushButton*fAddRecord, *fEditRecord, *fDeleteRecord;
00078 
00079     enum eDBType {
00080         eDatabase,
00081         eApplication
00082     } currentDBtype;
00083 
00084     PilotLocalDatabase*fDB;
00085     QString currentDB;
00086     QPtrList<PilotRecord> fRecList;
00087 };
00088 
00089 
00090 #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 Sat May 1 11:36:46 2004 by doxygen 1.2.15 written by Dimitri van Heesch, © 1997-2003