umbrello API Documentation

codegenobjectwithtextblocks.h

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  *   copyright (C) 2004-2006                                               *
00009  *   Umbrello UML Modeller Authors <uml-devel@uml.sf.net>                  *
00010  ***************************************************************************/
00011 
00012 /*  This code generated by:
00013  *      Author : thomas
00014  *      Date   : Tue Aug 19 2003
00015  */
00016 
00017 #ifndef CODEGENOBJECTWITHTEXTBLOCKS_H
00018 #define CODEGENOBJECTWITHTEXTBLOCKS_H
00019 
00020 #include <qmap.h>
00021 #include "codeaccessormethod.h"
00022 #include "textblocklist.h"
00023 
00024 class CodeBlock;
00025 class CodeBlockWithComments;
00026 class CodeClassField;
00027 class CodeComment;
00028 class CodeDocument;
00029 class CodeOperation;
00030 class HierarchicalCodeBlock;
00031 class TextBlock;
00032 
00033 class UMLDoc;
00034 class UMLOperation;
00035 
00041 class CodeGenObjectWithTextBlocks
00042 {
00043 public:
00044 
00045     // Constructors/Destructors
00046     //
00047 
00051     CodeGenObjectWithTextBlocks ( CodeDocument *parent );
00052 
00056     virtual ~CodeGenObjectWithTextBlocks ( );
00057 
00063     virtual bool addTextBlock ( TextBlock * add_object );
00064 
00068     virtual bool removeTextBlock ( TextBlock * remove_object );
00069 
00074     virtual bool insertTextBlock (TextBlock * newBlock, TextBlock * existingBlock, bool after) = 0;
00075 
00080     TextBlockList * getTextBlockList ( );
00081 
00091     virtual HierarchicalCodeBlock * getHierarchicalCodeBlock ( const QString &tag, const QString &comment, int indentLevel );
00092 
00102     virtual CodeBlockWithComments * getCodeBlockWithComments ( const QString &tag, const QString &comment, int indentLevel );
00103 
00113      CodeComment * addOrUpdateTaggedCodeComment (const QString &tag = "", const QString &text = "", int indentationLevel = 0 );
00114 
00126     CodeBlockWithComments * addOrUpdateTaggedCodeBlockWithComments (const QString &tag, const QString &text, const QString &comment, int indentLevel, bool forceUserBlockUpdate );
00127 
00132     virtual TextBlock * findTextBlockByTag ( const QString &tag );
00133 
00138     virtual QString getUniqueTag (QString prefix = "" ) = 0;
00139 
00142     virtual CodeBlock * newCodeBlock() = 0;
00143     virtual CodeBlockWithComments * newCodeBlockWithComments() = 0;
00144     virtual HierarchicalCodeBlock * newHierarchicalCodeBlock() = 0;
00145 
00151     CodeGenObjectWithTextBlocks * findParentObjectForTaggedTextBlock (const QString & tag);
00152 
00153 protected:
00154 
00158     virtual void setAttributesOnNode (QDomDocument & doc, QDomElement & elem );
00159 
00163     virtual void setAttributesFromNode ( QDomElement & element);
00164 
00165     virtual void setAttributesFromObject (CodeGenObjectWithTextBlocks * obj);
00166 
00174     virtual void loadChildTextBlocksFromNode ( QDomElement & root);
00175 
00176     // reset/clear the inventory text blocks held by this object
00177     virtual void resetTextBlocks();
00178 
00179     QMap<QString, TextBlock *> m_textBlockTagMap;
00180     TextBlockList m_textblockVector;
00181 
00182     // find specific text block belonging to code classfields.
00183     // block may not presently be alocated t othe textblock list.
00184     virtual TextBlock * findCodeClassFieldTextBlockByTag( const QString &tag) = 0;
00185 
00186 private:
00187 
00188     void initFields ();
00189 
00190     // needed in order to use findTextBlocksByTag
00191     CodeDocument *m_pCodeDoc;
00192 
00193 };
00194 
00195 #endif // CODEGENOBJECTWITHTEXTBLOCKS_H
KDE Logo
This file is part of the documentation for umbrello Version 3.1.0.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Tue Jun 26 08:07:55 2007 by doxygen 1.4.1 written by Dimitri van Heesch, © 1997-2003