picprogrammer.h

00001 /***************************************************************************
00002  *   Copyright (C) 2005 by David Saxton                                    *
00003  *   david@bluehaze.org                                                    *
00004  *                                                                         *
00005  *   This program is free software; you can redistribute it and/or modify  *
00006  *   it under the terms of the GNU General Public License as published by  *
00007  *   the Free Software Foundation; either version 2 of the License, or     *
00008  *   (at your option) any later version.                                   *
00009  ***************************************************************************/
00010 
00011 #ifndef PICPROGRAMMER_H
00012 #define PICPROGRAMMER_H
00013 
00014 #include "externallanguage.h"
00015 
00016 
00017 class KConfig;
00018 class KProcess;
00019 
00020 
00021 class ProgrammerConfig
00022 {
00023         public:
00024                 ProgrammerConfig();
00025                 
00029                 void reset();
00030                 
00031                 QString initCommand;
00032                 QString readCommand;
00033                 QString writeCommand;
00034                 QString verifyCommand;
00035                 QString blankCheckCommand;
00036                 QString eraseCommand;
00037                 
00038                 QString description;
00039                 QString executable; // The name of the program executable
00040 };
00041 
00042 typedef QMap< QString, ProgrammerConfig > ProgrammerConfigMap;
00043 
00044 
00045 
00055 class PicProgrammerSettings
00056 {
00057         public:
00058                 PicProgrammerSettings();
00059                 
00064                 void load( KConfig * config );
00068                 void save( KConfig * config );
00075                 ProgrammerConfig config( const QString & name );
00079                 void removeConfig( const QString & name );
00084                 void saveConfig( const QString & name, const ProgrammerConfig & config );
00090                 QStringList configNames( bool makeLowercase ) const;
00094                 bool isPredefined( const QString & name ) const;
00095                 
00096         protected:
00101                 void initStaticConfigs();
00102                 
00103                 ProgrammerConfigMap m_customConfigs;
00104                 
00105                 static bool m_bDoneStaticConfigsInit;
00106                 static ProgrammerConfigMap m_staticConfigs;
00107 };
00108 
00109 
00113 class PicProgrammer : public ExternalLanguage
00114 {
00115         public:
00116                 PicProgrammer( ProcessChain *processChain, KTechlab *parent );
00117                 ~PicProgrammer();
00118         
00119                 virtual void processInput( ProcessOptions options );
00120                 virtual ProcessOptions::ProcessPath::Path outputPath( ProcessOptions::ProcessPath::Path inputPath ) const;
00121 
00122         protected:
00123                 virtual bool isError( const QString &message ) const;
00124                 virtual bool isWarning( const QString &message ) const;
00125 };
00126 
00127 #endif

Generated on Tue May 8 17:05:32 2007 for KTechLab by  doxygen 1.5.1