kfloppy
format.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef FORMAT_H
00025 #define FORMAT_H
00026
00056 #include "debug.h"
00057 #include <QObject>
00058
00066 class KFAction : public QObject
00067 {
00068 Q_OBJECT
00069
00070 public:
00071 KFAction(QObject *parent = 0L);
00072 virtual ~KFAction();
00073
00074 public slots:
00079 virtual void exec();
00084 virtual void quit();
00085
00086 signals:
00093 void done(KFAction *me,bool success);
00094
00102 void status(const QString &msg, int progress);
00103
00107 void error(const QString &msg, const QString &details);
00108 } ;
00109
00110
00115 class KFActionQueue : public KFAction
00116 {
00117 Q_OBJECT
00118
00119 public:
00120 KFActionQueue(QObject *parent = 0L);
00121 virtual ~KFActionQueue();
00122
00131 void queue(KFAction *);
00132
00133 virtual void exec();
00134
00135 protected slots:
00136 void actionDone(KFAction *,bool);
00137
00138 private:
00139 class KFActionQueue_p *d;
00140 } ;
00141
00142
00143
00144
00145
00146
00147
00148
00149
00162 typedef struct { const char **devices;
00163 int drive;
00164 int blocks;
00165 int tracks;
00166 int flags; } fdinfo;
00167
00168 class K3Process;
00169
00174 class FloppyAction : public KFAction
00175 {
00176 Q_OBJECT
00177
00178 public:
00179 FloppyAction(QObject *parent = 0L);
00180
00184 virtual void quit();
00185
00199 bool configureDevice(int driveno, int density );
00200
00209 bool configureDevice( const QString& newDeviceName );
00210
00211 protected:
00212 fdinfo *deviceInfo;
00213 QString deviceName;
00214
00215 protected slots:
00219 virtual void processDone(K3Process *);
00223 virtual void processStdOut(K3Process *, char *, int);
00231 virtual void processStdErr(K3Process *, char *, int);
00232
00233 protected:
00234 K3Process *theProcess;
00235 QString theProcessName;
00236
00242 bool startProcess();
00243 } ;
00244
00249 class FDFormat : public FloppyAction
00250 {
00251 public:
00252 FDFormat(QObject *parent = 0L);
00253
00254 virtual void exec();
00255
00256
00265 static bool runtimeCheck();
00266
00271 bool configure(bool verify);
00272
00273 virtual void processStdOut(K3Process *, char *,int);
00274
00275 protected:
00276 static QString fdformatName;
00277 int formatTrackCount;
00278 bool doVerify;
00279 } ;
00280
00285 class DDZeroOut : public FloppyAction
00286 {
00287 public:
00288 DDZeroOut(QObject *parent = 0L);
00289
00290 virtual void exec();
00291
00300 static bool runtimeCheck();
00301
00302 protected:
00306 virtual void processDone(K3Process *);
00307 protected:
00308 static QString m_ddName;
00309 } ;
00310
00311
00315 class FATFilesystem : public FloppyAction
00316 {
00317 public:
00318 FATFilesystem(QObject *parent = 0L);
00319
00320 virtual void exec();
00321
00322 static bool runtimeCheck();
00323
00330 bool configure(bool verify, bool label, const QString &l);
00331
00333 virtual void processStdOut(K3Process*, char* b, int l);
00334
00335 protected:
00336 static QString newfs_fat;
00337
00338 bool doVerify,doLabel;
00339 QString label;
00340
00341 } ;
00342
00346 class Ext2Filesystem : public FloppyAction
00347 {
00348 public:
00349 Ext2Filesystem(QObject *parent = 0L);
00350
00351 virtual void exec();
00352
00353 static bool runtimeCheck();
00354
00356 bool configure(bool verify, bool label, const QString &l);
00357
00359 virtual void processStdOut(K3Process*, char* b, int l);
00360
00361 protected:
00362 static QString newfs;
00363
00364 bool doVerify,doLabel;
00365 QString label;
00366 } ;
00367
00368 #ifdef ANY_BSD
00369
00374 class UFSFilesystem : public FloppyAction
00375 {
00376 public:
00377 UFSFilesystem(QObject *parent = 0L);
00378
00379 virtual void exec();
00380
00381 static bool runtimeCheck();
00382
00383 protected:
00384 static QString newfs;
00385
00386 bool doVerify,doLabel;
00387 QString label;
00388 } ;
00389 #endif
00390
00391 #ifdef ANY_LINUX
00392
00396 class MinixFilesystem : public FloppyAction
00397 {
00398 public:
00399 MinixFilesystem(QObject *parent = 0L);
00400
00401 virtual void exec();
00402
00403 static bool runtimeCheck();
00404
00406 bool configure(bool verify, bool label, const QString &l);
00407
00409 virtual void processStdOut(K3Process*, char* b, int l);
00410 protected:
00411 static QString newfs;
00412
00413 bool doVerify,doLabel;
00414 QString label;
00415 } ;
00416 #endif
00417
00423 QString findExecutable(const QString &);
00424
00425 #endif
00426