codegenerationpolicy.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef CODEGENERATIONPOLICY_H
00020 #define CODEGENERATIONPOLICY_H
00021
00022 #include <qobject.h>
00023 #include <qdir.h>
00024 #include <qdom.h>
00025
00026 class QWidget;
00027 class KConfig;
00028 class CodeGenerationPolicyPage;
00029
00035 class CodeGenerationPolicy : public QObject {
00036 Q_OBJECT
00037 public:
00038
00051 enum OverwritePolicy {Ok=0, Ask, Never, Cancel};
00052 enum ModifyNamePolicy {No=0, Underscore, Capitalise};
00053 enum NewLineType {UNIX=0, DOS, MAC};
00054 enum IndentationType {NONE=0, TAB, SPACE};
00055 enum CommentStyle { SingleLine=0, MultiLine };
00056 enum ScopePolicy { Public=200, Private, Protected, FromParent };
00057
00058
00059 OverwritePolicy defaultOverwritePolicy() const;
00060 bool defaultVerboseSectionComments() const;
00061 bool defaultVerboseDocumentComments() const;
00062 bool defaultIncludeHeadings() const;
00063 NewLineType defaultLineEndingType() const;
00064 IndentationType defaultIndentType() const;
00065 int defaultIndentAmount() const;
00066 ModifyNamePolicy defaultModifyNamePolicy() const;
00067 CommentStyle defaultCommentStyle() const;
00068 ScopePolicy defaultAttribAccessorScope() const;
00069 ScopePolicy defaultAssocFieldScope() const;
00070 bool defaultAutoGenerateConstructors() const;
00071
00072
00073
00074
00078
00079
00080 CodeGenerationPolicy (CodeGenerationPolicy * clone = 0);
00081 CodeGenerationPolicy (KConfig * config );
00082
00086 virtual ~CodeGenerationPolicy ( );
00087
00088
00089
00090
00091
00092
00093
00110 void setOverwritePolicy ( OverwritePolicy new_var );
00111
00118 OverwritePolicy getOverwritePolicy ( ) const;
00119
00120
00127 void setCodeVerboseSectionComments ( bool new_var );
00128
00135 bool getCodeVerboseSectionComments ( ) const;
00136
00137
00145 void setCodeVerboseDocumentComments ( bool new_var );
00146
00154 bool getCodeVerboseDocumentComments ( ) const;
00155
00161 void setHeadingFileDir ( const QString & path);
00162
00168 QString getHeadingFileDir ( ) const;
00169
00170
00175 void setIncludeHeadings ( bool new_var );
00176
00181 bool getIncludeHeadings ( ) const;
00182
00183
00189 void setOutputDirectory ( QDir new_var );
00190
00196 QDir getOutputDirectory ( );
00197
00203 void setLineEndingType ( NewLineType new_var );
00204
00210 NewLineType getLineEndingType ( );
00211
00214 QString getNewLineEndingChars ( ) const;
00215
00221 void setIndentationType ( IndentationType type );
00222
00226 IndentationType getIndentationType ( );
00227
00230 void setIndentationAmount ( int amount );
00231 int getIndentationAmount ( );
00232
00238 QString getIndentation ( ) const;
00239
00244 void setModifyPolicy ( ModifyNamePolicy new_var );
00245
00250 ModifyNamePolicy getModifyPolicy ( ) const;
00251
00256 void setAutoGenerateConstructors ( bool var );
00257
00262 bool getAutoGenerateConstructors ( );
00263
00268 void setAttributeAccessorScope(ScopePolicy var);
00269
00274 ScopePolicy getAttributeAccessorScope();
00275
00280 void setAssociationFieldScope(ScopePolicy var);
00281
00286 ScopePolicy getAssociationFieldScope();
00287
00292 virtual CodeGenerationPolicyPage * createPage ( QWidget *parent = 0, const char * name = 0);
00293
00309 QString getHeadingFile(QString str);
00310
00314 virtual void setDefaults (CodeGenerationPolicy * defaults, bool emitUpdateSignal = true);
00315
00319 virtual void setDefaults(KConfig * config, bool emitUpdateSignal = true);
00320
00324 virtual void writeConfig (KConfig * config);
00325
00326 void emitModifiedCodeContentSig();
00327
00332 void setCommentStyle ( CommentStyle new_var );
00333
00338 CommentStyle getCommentStyle ( );
00339
00340 signals:
00341
00342
00343
00344 void modifiedCodeContent();
00345
00346 protected:
00347
00348
00349 OverwritePolicy m_overwritePolicy;
00350
00351
00352
00353 bool m_codeVerboseSectionComments;
00354
00355
00356
00357
00358 bool m_codeVerboseDocumentComments;
00359
00360 QDir m_headingFiles;
00361 bool m_includeHeadings;
00362 QDir m_outputDirectory;
00363 NewLineType m_lineEndingType;
00364 IndentationType m_indentationType;
00365 int m_indentationAmount;
00366 ModifyNamePolicy m_modifyPolicy;
00367 bool m_autoGenerateConstructors;
00368 CommentStyle m_commentStyle;
00369 ScopePolicy m_attributeAccessorScope;
00370 ScopePolicy m_associationFieldScope;
00371
00372
00373 QString m_lineEndingChars;
00374 QString m_indentation;
00375
00376 void calculateIndentation ( );
00377
00378 protected:
00379
00380 void initFields ( );
00381
00382 };
00383
00384 #endif // CODEGENERATIONPOLICY_H
This file is part of the documentation for umbrello Version 3.1.0.