umbrello/umbrello
simplecodegenerator.h
Go to the documentation of this file.00001 /*************************************************************************** 00002 * * 00003 * This program is free software; you can redistribute it and/or modify * 00004 * it under the terms of the GNU General Public License as published by * 00005 * the Free Software Foundation; either version 2 of the License, or * 00006 * (at your option) any later version. * 00007 * * 00008 ***************************************************************************/ 00009 00010 /* This code generated by: 00011 * Author : thomas 00012 * Date : Sep Mon 1 2003 00013 * 00014 * copyright (C) 2004 00015 * Umbrello UML Modeller Authors <uml-devel@uml.sf.net> 00016 */ 00017 00018 00019 #ifndef SIMPLECODEGENERATOR_H 00020 #define SIMPLECODEGENERATOR_H 00021 00022 #include <QtCore/QStringList> 00023 #include <QtCore/QString> 00024 #include <QtCore/QMap> 00025 00026 #include "../codegenerator.h" 00027 #include "../umlnamespace.h" 00028 00029 class UMLDoc; 00030 00035 class SimpleCodeGenerator : public CodeGenerator 00036 { 00037 Q_OBJECT 00038 public: 00039 00040 // Constructors/Destructors 00041 // 00042 00046 SimpleCodeGenerator (bool createDirHierarchyForPackages = true); 00047 00051 virtual ~SimpleCodeGenerator ( ); 00052 00053 // Public attribute accessor methods 00054 // 00055 00056 void writeCodeToFile ( UMLClassifierList & concepts); 00057 void writeCodeToFile ( ); 00058 00063 virtual void writeClass(UMLClassifier *c) = 0; 00064 00070 CodeDocument * newClassifierCodeDocument (UMLClassifier * classifier); 00071 00072 protected: 00073 00074 QString className_; 00075 QString fileName_; 00076 00077 // compatibility methods.. 00078 QString findFileName(UMLPackage* concept, const QString &ext); 00079 QString overwritableName(UMLPackage* concept, const QString &name, const QString &ext); 00080 bool hasDefaultValueAttr(UMLClassifier *c); 00081 bool hasAbstractOps(UMLClassifier *c); 00082 00086 QString getIndent (); 00087 00092 QMap<UMLPackage*,QString> m_fileMap; 00093 00094 // the parent document 00095 UMLDoc *m_doc; 00096 00103 bool m_createDirHierarchyForPackages; 00104 00105 /* Old Attributes writers will look for */ 00106 QString m_indentation; 00107 int m_indentLevel; 00108 QString m_endl; 00109 00110 // override parent method..we need special handling 00111 void initFromParentDocument( ); 00112 00113 private: 00114 00115 void initFields ( UMLDoc * doc) ; 00116 00117 public slots: 00118 00119 void syncCodeToDocument ( ); 00120 00121 }; 00122 00123 #endif // SIMPLECODEGENERATOR_H
KDE 4.0 API Reference