kpilot
fileInstaller.h
Go to the documentation of this file.00001 /* fileInstaller.h KPilot 00002 ** 00003 ** Copyright (C) 1998-2001 by Dan Pilone 00004 ** Copyright (C) 2003-2004 Reinhold Kainhofer <reinhold@kainhofer.com> 00005 ** 00006 ** This is a class that does "the work" of adding and deleting 00007 ** files in the pending_install directory of KPilot. It is used 00008 ** by the fileInstallWidget and by the daemon's drag-and-drop 00009 ** file accepter. 00010 */ 00011 00012 /* 00013 ** This program is free software; you can redistribute it and/or modify 00014 ** it under the terms of the GNU General Public License as published by 00015 ** the Free Software Foundation; either version 2 of the License, or 00016 ** (at your option) any later version. 00017 ** 00018 ** This program is distributed in the hope that it will be useful, 00019 ** but WITHOUT ANY WARRANTY; without even the implied warranty of 00020 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00021 ** GNU General Public License for more details. 00022 ** 00023 ** You should have received a copy of the GNU General Public License 00024 ** along with this program in a file called COPYING; if not, write to 00025 ** the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 00026 ** MA 02110-1301, USA. 00027 */ 00028 00029 /* 00030 ** Bug reports and questions can be sent to kde-pim@kde.org 00031 */ 00032 00033 #ifndef _KPILOT_FILEINSTALLER_H 00034 #define _KPILOT_FILEINSTALLER_H 00035 00036 #include <qobject.h> 00037 00038 00039 class QStringList; 00040 class QString; 00041 00042 class FileInstaller : public QObject 00043 { 00044 Q_OBJECT 00045 public: 00046 FileInstaller(); 00047 virtual ~FileInstaller(); 00048 00049 void clearPending(); 00050 00051 void addFiles( const QStringList&, QWidget* w ); 00052 void addFile( const QString&, QWidget* w ); 00053 00054 void deleteFile(const QString &); 00055 void deleteFiles(const QStringList &); 00056 00062 const QString &dir() const { return fDirName; } ; 00063 const QStringList fileNames() const ; 00064 00065 00066 00067 protected: 00068 virtual bool runCopy( const QString &src, QWidget*w ); 00069 00070 public slots: 00071 void copyCompleted(); 00072 void setEnabled(bool); 00073 00074 signals: 00075 void filesChanged(); 00076 private: 00077 QString fDirName; 00078 int fPendingCopies; 00079 bool enabled; 00080 } ; 00081 00082 #endif