kandy Library API Documentation

commandscheduler.h

00001 #ifndef COMMANDSCHEDULER_H
00002 #define COMMANDSCHEDULER_H
00003 // $Id: commandscheduler.h,v 1.3 2001/09/14 06:57:29 mlaurent Exp $
00004 
00005 #include <qobject.h>
00006 #include <qptrlist.h>
00007 
00008 #include "atcommand.h"
00009 #include "commandset.h"
00010 
00011 class Modem;
00012 
00013 class CommandScheduler : public QObject {
00014     Q_OBJECT
00015   public:
00016     CommandScheduler (Modem *modem,QObject *parent = 0, const char *name = 0);
00017 
00018     void execute(const QString &command);
00019     void execute(ATCommand *command);
00020     void executeId(const QString &id);
00021 
00022     Modem *modem() { return mModem; }
00023     CommandSet *commandSet() { return &mCommandSet; }
00024 
00025     bool loadProfile(const QString& filename);
00026     bool saveProfile(const QString& filename);
00027 
00028   signals:
00029     void result(const QString &);
00030     void commandProcessed(ATCommand *);
00031 
00032   private slots:
00033     void processOutput(const char *line);
00034 
00035   private:
00036     void sendCommand(const QString &command);
00037     void nextCommand();
00038 
00039   private:
00040     Modem *mModem;
00041     
00042     CommandSet mCommandSet;
00043 
00044     ATCommand *mLastCommand;
00045 
00046     QPtrList<ATCommand> mCommandQueue;
00047 
00048     enum State { WAITING, PROCESSING };
00049     State mState;
00050     
00051     QString mResult;
00052 };
00053 
00054 #endif
KDE Logo
This file is part of the documentation for kdelibs Version 3.1.5.
Documentation copyright © 1996-2002 the KDE developers.
Generated on Sun Feb 15 11:40:32 2004 by doxygen 1.3.5 written by Dimitri van Heesch, © 1997-2001