kpilot Library API Documentation

expense.h

00001 #ifndef _KPILOT_EXPENSE_H
00002 #define _KPILOT_EXPENSE_H
00003 /* expense.h            KPilot
00004 **
00005 ** Copyright (C) 2000-2001 by Adriaan de Groot
00006 **
00007 ** This file is part of the Expense conduit.
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 
00032 #include "plugin.h"
00033 
00034 class QTextStream;
00035 class QFile;
00036 
00037 class Expense;
00038 
00039 class PilotRecord;
00040 class PilotDatabase;
00041 
00042 
00043 
00044 class ExpenseConduit : public ConduitAction
00045 {
00046 Q_OBJECT
00047 
00048 public:
00049     // The public methods of a conduit's action are
00050     // just boilerplate. The factory is expected to
00051     // do the right dynamic casts to give the conduit
00052     // a KPilotDeviceLink. The conduit can interpret args
00053     // however it wishes. The expense conduit has no
00054     // additional arguments.
00055     //
00056     //
00057     ExpenseConduit(KPilotDeviceLink *,
00058         const char *name=0L,
00059         const QStringList &args = QStringList());
00060     virtual ~ExpenseConduit();
00061 
00062 
00063 protected:
00064     virtual bool exec();
00065 
00066 protected:
00071     PilotDatabase *fDatabase;
00072 
00078     QFile *fCSVFile;
00079     QTextStream *fCSVStream;
00080 
00085     int fDBType;
00086     QString fDBnm,fDBsrv,fDBtable,fDBlogin,fDBpasswd;
00087     int fRecordCount;
00088 
00092     void doTest();
00093 
00099     void csvOutput(QTextStream *,Expense *);
00100     void postgresOutput(Expense *);
00101 
00102 protected slots:
00108     void slotNextRecord();
00109 
00110 private:
00115     void dumpPostgresTable();
00116 
00121     void cleanup();
00122 };
00123 
00124 #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:47 2004 by doxygen 1.2.15 written by Dimitri van Heesch, © 1997-2003