codeblockwithcomments.h
00001 00002 /*************************************************************************** 00003 * * 00004 * This program is free software; you can redistribute it and/or modify * 00005 * it under the terms of the GNU General Public License as published by * 00006 * the Free Software Foundation; either version 2 of the License, or * 00007 * (at your option) any later version. * 00008 * * 00009 ***************************************************************************/ 00010 00011 /* This code generated by: 00012 * Author : thomas 00013 * Date : Wed Jun 18 2003 00014 */ 00015 00016 00017 00018 #ifndef CODEBLOCKWITHCOMMENTS_H 00019 #define CODEBLOCKWITHCOMMENTS_H 00020 00021 00022 #include "codeblock.h" 00023 #include "codecomment.h" 00024 00025 class HierarchicalCodeBlock; 00026 00032 class CodeBlockWithComments : public CodeBlock 00033 { 00034 Q_OBJECT 00035 public: 00036 00037 // Constructors/Destructors 00038 // 00039 00040 00044 explicit CodeBlockWithComments ( CodeDocument * doc , const QString & body = "", const QString & comment = ""); 00045 explicit CodeBlockWithComments ( HierarchicalCodeBlock * hblock, const QString & body = "", const QString & comment = "" ); 00046 00050 virtual ~CodeBlockWithComments ( ); 00051 00052 00056 void setComment ( CodeComment * object ); 00057 00061 CodeComment * getComment ( ); 00062 00066 virtual QString toString ( ); 00067 00071 void setOverallIndentationLevel ( int level ); 00072 00076 virtual void saveToXMI ( QDomDocument & doc, QDomElement & root ); 00077 00081 virtual void loadFromXMI ( QDomElement & root ); 00082 00085 virtual void setAttributesFromObject (TextBlock * obj); 00086 00087 protected: 00088 00092 virtual void setAttributesOnNode (QDomDocument & doc, QDomElement & blockElement); 00093 00097 virtual void setAttributesFromNode ( QDomElement & element); 00098 00099 private: 00100 00101 CodeComment * m_comment; 00102 00103 void initFields(CodeDocument *parent, QString comment); 00104 00105 }; 00106 00107 #endif // CODEBLOCKWITHCOMMENTS_H
