flowcodedocument.h

00001 /***************************************************************************
00002  *   Copyright (C) 2003-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 FLOWCODEDOCUMENT_H
00012 #define FLOWCODEDOCUMENT_H
00013 
00014 #include "icndocument.h"
00015 
00016 #include <qguardedptr.h>
00017 
00018 class KTechlab;
00019 class FlowCode;
00020 class MicroInfo;
00021 class PicItem;
00022 class FlowPart;
00023 class MicroSettings;
00024 class TextDocument;
00025 class QString;
00026 
00027 typedef QValueList<FlowPart*> FlowPartList;
00028 typedef QMap<QString, int > StringIntMap;
00029 
00034 class FlowCodeDocument : public ICNDocument
00035 {
00036         Q_OBJECT
00037         public:
00038                 FlowCodeDocument( const QString &caption, KTechlab *ktechlab, const char *name = 0);
00039                 ~FlowCodeDocument();
00040         
00041                 virtual View *createView( ViewContainer *viewContainer, uint viewAreaId, const char *name = 0 );
00042 
00046                 MicroSettings *microSettings() const { return m_microSettings; }
00053                 void setPicType( const QString &id );
00054 
00055                 enum ConvertToTarget
00056                 {
00057                         MicrobeOutput,
00058                         AssemblyOutput,
00059                         HexOutput,
00060                         PICOutput
00061                 };
00062 
00063 #define protected public
00064         signals:
00065                 void picTypeChanged();
00066 #undef protected
00067 
00068         signals:
00069                 void pinMappingsChanged();
00070         
00071         public slots:
00075                 void slotConvertTo( int target );
00076                 void convertToMicrobe();
00077                 void convertToAssembly();
00078                 void convertToHex();
00079                 void convertToPIC();
00083                 void varNameChanged( const QString &newValue, const QString &oldValue );
00084 
00085         protected:
00086                 virtual bool isValidItem( Item *item );
00087                 virtual bool isValidItem( const QString &itemId );
00088                 
00089         private slots:
00090                 void setLastTextOutputTarget( TextDocument * target );
00091 
00092         private:
00093                 QGuardedPtr<TextDocument> m_pLastTextOutputTarget;
00094                 MicroInfo *m_microInfo; // Stores information about the PIC
00095                 MicroSettings *m_microSettings; // Stores initial settings of the PIC
00096                 PicItem *m_picItem; // Allows the user to change the PIC settings
00097                 StringIntMap m_varNames;
00098 };
00099 
00100 #endif

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