umbrello/umbrello
codegenerator.cpp
Go to the documentation of this file.
233 void CodeGenerator::loadCodeForOperation(const QString& idStr, const QDomElement& codeDocElement)
597 KMessageBox::sorry(0, i18n("Cannot open file %1 for writing. Please make sure the folder exists and you have permissions to write to it.", file.fileName()), i18n("Cannot Open File"));
UMLObject * getObject(Uml::RoleType::Enum role) const
Returns the UMLObject assigned to the given role.
Definition: association.cpp:476
This class contains the non-graphical information required for a UML Package.
Definition: package.h:32
This class defines the non-graphical information required for a UML Classifier (ie a class or interfa...
Definition: classifier.h:39
QString overwritableName(const QString &name, const QString &extension)
Remove (and possibly delete) all AutoGenerated content type CodeDocuments but leave the UserGenerated...
Definition: codegenerator.cpp:502
UMLClassifier * getType() const
Returns the type of the UMLClassifierListItem.
Definition: classifierlistitem.cpp:100
virtual CodeViewerDialog * getCodeViewerDialog(QWidget *parent, CodeDocument *doc, Settings::CodeViewerState state)
Get the editing dialog for this code document.
Definition: codegenerator.cpp:181
virtual void loadFromXMI(QDomElement &element)
Load codegenerator data from xmi.
Definition: codegenerator.cpp:191
class ClassifierCodeDocument A CodeDocument which represents a UMLClassifier (e.g.
Definition: classifiercodedocument.h:33
Definition: basictypes.h:209
bool addCodeDocument(CodeDocument *add_object)
Add a CodeDocument object to the m_codedocumentVector List.
Definition: codegenerator.cpp:127
bool openFile(QFile &file, const QString &name)
Opens a file named "name" for writing in the outputDirectory.
Definition: codegenerator.cpp:586
static QString formatDoc(const QString &text, const QString &linePrefix=" *", int lineWidth=80)
Format documentation for output in source files.
Definition: codegenerator.cpp:772
QString getNewLineEndingChars() const
Utility function to get the actual characters.
Definition: codegenerationpolicy.cpp:248
virtual bool isReservedKeyword(const QString &keyword)
Check whether the given string is a reserved word for the language of this code generator.
Definition: codegenerator.cpp:873
Definition: basictypes.h:210
virtual void loadFromXMI(QDomElement &root)
Load params from the appropriate XMI element node.
Definition: codedocument.cpp:347
virtual void writeCodeToFile()
This method is here to provide class wizard the ability to write out only those classes which are sel...
Definition: codegenerator.cpp:390
class CodeGenerationPolicy This class describes the code generation policy for this project...
Definition: codegenerationpolicy.h:29
This sub-class adds copyInto and clone to the QPtrList base class.
Definition: umlattributelist.h:26
void setCodeVerboseDocumentComments(bool new_var)
Set the value of m_codeVerboseDocumentComments Whether or not verbose code commenting for documentati...
Definition: codegenerationpolicy.cpp:134
virtual CodeDocument * newCodeDocument()
Create a new Code document belonging to this package.
Definition: codegenerator.cpp:458
Definition: umlobject.h:59
virtual QString getHeadingFile(const QString &file)
Gets the heading file (as a string) to be inserted at the beginning of the generated file...
Definition: codegenerator.cpp:482
UMLClassifier * getParentClassifier()
Get the value of m_parentclassifier.
Definition: classifiercodedocument.cpp:271
CodeDocument * findCodeDocumentByID(const QString &id)
Find a code document by the given id string.
Definition: codegenerator.cpp:112
virtual QString getPath()
Get the value of the path to this code document.
Definition: codedocument.cpp:100
Definition: basictypes.h:102
This class contains the non-graphic representation of an association.
Definition: association.h:32
virtual void checkAddUMLObject(UMLObject *obj)
This function checks for adding objects to the UMLDocument.
Definition: codegenerator.cpp:343
QDir getOutputDirectory()
Get the value of m_outputDirectory location of where output files will go.
Definition: codegenerationpolicy.cpp:206
UMLAssociationList getAssociations()
Return the list of associations for the CanvasObject.
Definition: umlcanvasobject.cpp:337
bool getCodeVerboseDocumentComments() const
Get the value of m_codeVerboseDocumentComments Whether or not verbose code commenting for documentati...
Definition: codegenerationpolicy.cpp:147
virtual Uml::ProgrammingLanguage::Enum language() const =0
Return the unique language enum that identifies this type of code generator.
static QString toString(ObjectType ot)
Helper function for debug output.
Definition: umlobject.cpp:1094
void setSourceCode(const QString &code)
Sets the source code for this operation.
Definition: operation.cpp:432
bool isInterface() const
Returns true if this classifier represents an interface.
Definition: classifier.cpp:112
virtual QStringList reservedKeywords() const
Get list of reserved keywords.
Definition: codegenerator.cpp:882
void codeGenerated(UMLClassifier *concept, bool generated)
Uml::AssociationType::Enum getAssocType() const
Returns the AssociationType::Enum of the UMLAssociation.
Definition: association.cpp:103
virtual QStringList defaultDatatypes()
Return the default datatypes for your language (bool, int etc).
Definition: codegenerator.cpp:860
QString toString(Enum item)
Return string corresponding to the given ProgrammingLanguage.
Definition: basictypes.cpp:801
QString getUniqueID(CodeDocument *codeDoc)
Get a unique id for this codedocument.
Definition: codegenerator.cpp:80
virtual void saveToXMI(QDomDocument &doc, QDomElement &root)
Save the XMI representation of this object.
Definition: codegenerator.cpp:258
static QString formatSourceCode(const QString &code, const QString &indentation)
Format source code for output in source files by adding the correct indentation to every line of code...
Definition: codegenerator.cpp:803
static void findObjectsRelated(UMLClassifier *c, UMLPackageList &cList)
Finds all classes in the current document to which objects of class c are in some way related...
Definition: codegenerator.cpp:682
void setCodeVerboseSectionComments(bool new_var)
Set the value of m_codeVerboseSectionComments Whether or not verbose code commenting for sections is ...
Definition: codegenerationpolicy.cpp:110
This class is sooo ugly I don't know where to begin.
Definition: codeviewerdialog.h:27
CodeGenerationPolicy * commonPolicy() const
Returns the default code generation policy.
Definition: uml.cpp:2132
CodeDocumentList * getCodeDocumentList()
Get the list of CodeDocument objects held by m_codedocumentVector.
Definition: codegenerator.cpp:171
UMLClassifierList classesAndInterfaces(bool includeNested=true)
Returns a list of the classes and interfaces in this UMLDoc.
Definition: umldoc.cpp:2491
OverwritePolicy getOverwritePolicy() const
Get the value of m_overwritePolicy Policy of how to deal with overwriting existing files...
Definition: codegenerationpolicy.cpp:80
bool getCodeVerboseSectionComments() const
Get the value of m_codeVerboseSectionComments Whether or not verbose code commenting for sections is ...
Definition: codegenerationpolicy.cpp:122
bool m_applyToAllRemaining
Used by overwriteDialogue to know if the apply to all remaining files checkbox should be checked (is ...
Definition: codegenerator.h:184
configurable params for the code viewer tool
Definition: codeviewerstate.h:20
virtual void createDefaultStereotypes()
Create the default stereotypes for your language (constructor, int etc).
Definition: codegenerator.cpp:891
UMLObject * findObjectById(Uml::ID::Type id)
Used to find a reference to a UMLObject by its ID.
Definition: umldoc.cpp:766
UMLAttributeList getAttributeList() const
Returns the attributes for the specified scope.
Definition: classifier.cpp:441
Used by CodeGenerator::findFileName when it needs to ask the user if they want to overwrite and exist...
Definition: overwritedialogue.h:29
virtual void checkRemoveUMLObject(UMLObject *obj)
This function checks for removing objects from the UMLDocument.
Definition: codegenerator.cpp:359
virtual CodeDocument * newClassifierCodeDocument(UMLClassifier *classifier)=0
A series of accessor method constructors that we need to define for any particular language...
void writeListedCodeDocsToFile(CodeDocumentList *docs)
The actual internal routine which writes code documents.
Definition: codegenerator.cpp:419
CodeDocument * findCodeDocumentByClassifier(UMLClassifier *classifier)
Find a code document by the given classifier.
Definition: codegenerator.cpp:380
QHash< QString, CodeDocument * > m_codeDocumentDictionary
Definition: codegenerator.h:178
QString getSourceCode() const
Returns the source code for this operation.
Definition: operation.cpp:440
bool removeCodeDocument(CodeDocument *remove_object)
Replace (or possibly add a new) CodeDocument object to the m_codedocumentVector List.
Definition: codegenerator.cpp:152
UMLOperationList getOpList(bool includeInherited=false, UMLClassifierSet *alreadyTraversed=0)
Return a list of operations for the Classifier.
Definition: classifier.cpp:960
static QString cleanName(const QString &name)
Replaces spaces with underscores and capitalises as defined in m_modname.
Definition: codegenerator.cpp:609
QString findFileName(CodeDocument *codeDocument)
Finds an appropriate file name for the given CodeDocument, taking into account the Overwrite Policy a...
Definition: codegenerator.cpp:625
void showGeneratedFile(const QString &filename)
virtual void syncCodeToDocument()
Force a synchronize of this code generator, and its present contents, to that of the parent UMLDocume...
Definition: codegenerator.cpp:328
QString getHeadingFile(const QString &str)
Gets the heading file (as a string) to be inserted at the beginning of the generated file...
Definition: codegenerationpolicy.cpp:540
Definition: umlobject.h:54
void setOverwritePolicy(OverwritePolicy new_var)
Set the value of m_overwritePolicy Policy of how to deal with overwriting existing files...
Definition: codegenerationpolicy.cpp:69
virtual void initFromParentDocument()
Initialize this code generator from its parent UMLDoc.
Definition: codegenerator.cpp:308
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 23:05:59 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 23:05:59 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.